eclipse / upm

UPM is a high level repository that provides software drivers for a wide variety of commonly used sensors and actuators. These software drivers interact with the underlying hardware platform through calls to MRAA APIs.
MIT License
663 stars 411 forks source link

TH02 sensor does not work on Edison Arduino breakout. #351

Closed g-vidal closed 8 years ago

g-vidal commented 8 years ago

Hello,

I am using TH02 grove sensor connected to a grove board plugged on I2C connector of an Edison Arduino breakout.

With i2Cdetect -y -r 6 I can see that the sensor is recognized (0x40) but when I use the functions getHumidity() or getTemperature () in my python script I get the classical -50 -24 values corresponding to 0 0 measured by the sensor. A dump confirms that it is sending only 0 . Trying the same sensor on an arduino gives correct values. I have compiled UPM and I'll try to investigate but I am not a dev ;-( ..... Maybe I am doing something wrong or there is a bug in the python script in upm lib. Here is the step by step python script

import mraa
import pyupm_th02
import thread, time
th02 = pyupm_th02.TH02(6,0x40)
print th02.name()
TH02
print th02
<pyupm_th02.TH02; proxy of <Swig Object of type 'upm::TH02 *' at 0xb76a74a0> >
 temp = th02.getTemperature()
 print temp
-50.0
 th02.getStatus()
True
hygro = th02.getHumidity ()
print hygro
-24.0

Thanks for any help

g-vidal commented 8 years ago

Hi, I was suspecting a bug in TH02... I found some other people that got the same problem -50 -24 values only.

After wasting hours I finally come accross this post : https://community.hallard.me/topic/124/issues-about-th02-with-nodemcu-v1-0/2 Where Charles explain that TH02 does not fully comply on I2C standard ant it must be the only sensor on the bus.... I suppose that on the Arduino the I2C bus is used for some other household functions then the TH02 does not work. If anybody can crosscheck this explanation it could be nice to write a warning on TH02 upm module !

Thanks and hope my contribution is right....

Propanu commented 8 years ago

Thanks for reporting the issue, I will update the list of known limitations once I confirm it!

g-vidal commented 8 years ago

OK Perfect I stay tuned Thanks

HenkLaracker commented 8 years ago

When i use the arduino ide and the groove indoor environment demo this sensor works fine, when i use eclipse (inteliot) with java and this library the TH02 sensor produces -50 -24 values. But ones in a while the correct temperature is shown. Any idea

g-vidal commented 8 years ago

Sorry Henk, I have stopped wasting my time with that sensor... As Charles says in his post better to switch to another more reliable sensor.

Tried to get it working on ULPNode with a TSL2861 (see this post), no way, this device claim as an I2C device, it’s just not, so I decided to switch to SI7021 sensor but this one seems now had it price raised twice on each reseller, no luck. !!! Meanwhile your observation may suggest that the cpp library from "indoor environment demo" may have a trick to make this sensor work. Maybe it could be worth to compile ithis code inside upm and check what happens...If it works then pull a request to upgrade upm library. :-)

Good luck !

HenkLaracker commented 8 years ago

Hi, i'm unfortunately not an expert in this area but i found out that they use : https://github.com/Seeed-Studio/Grove_Temper_Humidity_TH02

randomswdev commented 8 years ago

If I switch Edison to 3V and set the switch on the Grove Shield to 3V, the sensor starts to work fine. But the LCD backlight monitor stops working. Which is the correct configuration to have both of them working?

randomswdev commented 8 years ago

Setting Edison to 3V and the Grove Shield to 5V appears to solve the issue both with the temperature sensor and the LCD display. Is it the correct configuration?

Propanu commented 8 years ago

If you don't plan on adding any more sensors yes. However keep in mind that with the board at 3V3 and the shield at 5V you won't get the full range for the ADC, and adding another I2C sensor might make the bus unstable again.

Propanu commented 8 years ago

Sensor is now listed on known limitations page as it is only usable at 3V3 on the Intel Edison with the Arduino board.