Hello everyone I am working on a home project for the winter and i am confused on some stuff involving I2C. So i want to make a datalogger unit out of my arduino uno i have laying around. i will be using the following parts:
Datalogger shield: https://www.adafruit.com/products/1141
Arduino Uno
Inertial Measurement Unit(IMU) http://www.adafruit.com/product/1714
other analog sensor(photocell?)
I plan on using the shield to log all the data from my sensors into an SD card. now the only problem, is the fact that both the RTC in the Logging Shield and the IMU both transmit through I2C. I know I2C is famous for transmitting hundreds of slaves through one master controller. However, i am confused on how the controller can read IMU data to the Arduino then store it into the SD card at the same time with RTC values , without mixing up the data. Can someone please clarify this? is the signal transmission too fast for it to mix up? do i have to do something else to avoid the mix up? if anyone can please provide a link for a similar problem or maybe explain it on the comments i would really apreciate it.
Thank you for your time.
Datalogger shield HELP? I2C HELP?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Datalogger shield HELP? I2C HELP?
The SD card uses SPI, which is a much faster protocol than I2C.
All I2C and SPI communication is managed by the Arduino, so it decides who it wants to talk to at any given time. It will ask the IMU for sensor readings and the RTC for a timestamp, then tell the SD card to store those values in a file.
Each set of messages will last a few milliseconds at most, so the RTC and sensor values won't be absolutely in sync, but the offset will be so small it doesn't make any practical difference.
Once you have the sensor and RTC data, it doesn't strictly matter when you write it to the SD card. You could store several sets of readings in memory and write them all at once, for instance. Each set of readings will still be associated with the appropriate timestamp.
You'll probably have some amount of delay between readings, and you can do the SD write just that dead time. It doesn't matter how long it takes to send the data to the card as long as the write finishes before it's time to take the next set of readings.
All I2C and SPI communication is managed by the Arduino, so it decides who it wants to talk to at any given time. It will ask the IMU for sensor readings and the RTC for a timestamp, then tell the SD card to store those values in a file.
Each set of messages will last a few milliseconds at most, so the RTC and sensor values won't be absolutely in sync, but the offset will be so small it doesn't make any practical difference.
Once you have the sensor and RTC data, it doesn't strictly matter when you write it to the SD card. You could store several sets of readings in memory and write them all at once, for instance. Each set of readings will still be associated with the appropriate timestamp.
You'll probably have some amount of delay between readings, and you can do the SD write just that dead time. It doesn't matter how long it takes to send the data to the card as long as the write finishes before it's time to take the next set of readings.
-
- Posts: 7
- Joined: Mon Sep 22, 2014 1:15 am
Re: Datalogger shield HELP? I2C HELP?
Hello everyone, I hope they are right
my question regarding this shield (http://www.adafruit.com/product/1141) is, what if the RTC uses the analogous pins 4 and 5 to communicate with arduino, these pins are not would be available for use by a sensor I mean it could BMP180 ?, or they are only used for the shield and if I connect a sensor in the spaces corresponding shield 4 and 5 would generate me problems?
Please excuse my English :)
my question regarding this shield (http://www.adafruit.com/product/1141) is, what if the RTC uses the analogous pins 4 and 5 to communicate with arduino, these pins are not would be available for use by a sensor I mean it could BMP180 ?, or they are only used for the shield and if I connect a sensor in the spaces corresponding shield 4 and 5 would generate me problems?
Please excuse my English :)
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: Datalogger shield HELP? I2C HELP?
Yes, you can connect a BMP180 to those pins.
The RTC and BMP180 both use the I2C protocol to communicate. I2C devices can share the same pins.
The RTC and BMP180 both use the I2C protocol to communicate. I2C devices can share the same pins.
-
- Posts: 7
- Joined: Mon Sep 22, 2014 1:15 am
Re: Datalogger shield HELP? I2C HELP?
adafruit_support_mike wrote:Yes, you can connect a BMP180 to those pins.
The RTC and BMP180 both use the I2C protocol to communicate. I2C devices can share the same pins.
many thanks for your reply
Please be positive and constructive with your questions and comments.