1 of 1 people found this helpful
If you’re using the Arduino expansion board then I’d suggest you to use I2C6. The I2C1 wiring is not exposed on the Arduino board as can be seen here https://communities.intel.com/message/398630#398630 . In the Arduino expansion board you can see that I2C6 is exposed in GPIO 14 (I2C SDA) and GPIO 165 (I2C SCL)
You can also check https://communities.intel.com/message/406533#406533 , which discusses a very similar issue as well.
I'm very thankful for the reply and it is helpful for me.As you have said I have used I2C-6 and compiled the below attached C-program.I have got the output,but the temperature values showing are wrong.In the program given,for the different temperatures,the T0,T1,T2,T3 values are remaining same,though the temp value is changing ,temperature values are wrong after the conversion.The same repeates for humidity also.The formula for the conversion is correct as it is giving the correct values in the arduino board and raspberry pi.Can I know how can I get the correct temperature and humidity values as this completes my project.Thanks in advance.Please do needful.
Does this exact same code work on other boards and provides the correct output? In this case, are you using any IDE or are you compiling and running the code directly from the console? If you change the temperature values and then compile and run the program do you get different values?
Do you have a logic analyzer? With it you can see the output of the sensor and check it’s actually giving the correct values.
Thank you very much for the reply given.I'm using Intel-edison arduino board with yocto image.I'm using I2C-6.I have already mentioned that I have checked with arduino ,raspberry pi ,the sensor is giving the correct values for both temperature and humidity but for Intel-edison board only the T0,T2 and temp values are changing and therefore the temperature values showing are wrong.The same repeates with the humidity values also and incorrect output.
- Yes,I'm using the console only to get the output on intel-edison and arduino IDE for arduino.
- Yes,I'm getting the different temperature values if the temperature around the sensor is changing but incorrect.
- No,I donot have logic analyzer ,but I think the sensor is working correctly as its is giving correct output for arduino and Raspberry.
I'm not understanding whether it is the code problem or hardware problem.!!!!If it is the code problem,how can I get in arduino?the calibration registers(T0,T2),(H1,H2,H3) values and temp and hum(as per the code) itself are showing wrong and therefore the temperature and humidity values are also showing incorrect.
I'm pinning the source code,screenshots of the values and arduino values.
Any and Every help is appreciated.Please do needful.
Thank you for the detailed description.
Based on the information you provided I’d say that the problem is probably the calibration of the sensors and the code. The fact that a sensor works on the first try on a board doesn’t mean it’s going to work the same way on another. Different boards have different hardware that might not adapt to the sensor in the same way as others. In this case, you’d have to treat the Edison and this sensor differently than you have to other boards.
I’d suggest you to look at the datasheet of the sensor and make sure that the Edison is being provided with the necessary input from the sensor. An oscilloscope will help you determine if the signal of the sensor is clear for the Edison to interpret. This might also involve making some changes to the code and the formulas used to calculate temperature and humidity.