i am new to this and I am trying to understand how to write the proper code to data log. I have 5 sensors set up on my UNO, all on the I2C data line (SDA,SCL).. I am confused about how to write the code to data log all 5 sensors. (SHT31-D,Si7021,BMP280,CCS811, VML6070)......
JAMES007MOORE:
i am new to this and I am trying to understand how to write the proper code to data log. I have 5 sensors set up on my UNO, all on the I2C data line (SDA,SCL).. I am confused about how to write the code to data log all 5 sensors. (SHT31-D,Si7021,BMP280,CCS811, VML6070)......
JAMES007MOORE:
I am trying to understand how to write the proper code to data log. I have 5 sensors set up on my UNO
Does set up mean that those sensors are all operational, reading their respective values into some variables? Or haven't you got that far yet. If you haven't then that's not a datalogging issue...
If you have, the datalog example with the SD library shows how to concatenate 3 readings into a String to send.
Would be simple enough to adapt making the String from 3x analog readings to making it from a bunch of variables.
Most of the hardware problems I see appear on the i@c buss. Be sure the I2C buss is terminated properly, if not you will get inconsistent results. This typically happens when you first test each sensor then place them on the I2C buss, the termination gets to stiff as most cards have pull up resistors on them. The bus should go from unit to unit, not a star configuration. Check your power supply and be sure it has enough power for everything, the UNO cannot reliably power that many sensors. The first test I do when connecting each sensor is run the I2C scan, it reports the I2C address. I record this in my source code. when you get this finished add sensors one at a time and scan again, if something is faulty you will probably find it at this point. Then one more scan when all sensors are connected. This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil