PaulS:
Print something before and after trying to read the temperature, and before and after trying to read the humidity.
Do you still get nothing?
Yes. I try to print something that you recommend. Show result as below, I think it’s jack and need pin or not?
08:50:10.876 → Start print begin
08:50:11.045 → 0 Start print before
08:50:11.045 → Humidity: nan % Temperature: nan *C
08:50:11.045 → Start print after
But if i use AM2301 it’s work by this code below ( No work for Si7021 )
Getting an output with nan is not the same as getting nothing!
But if i use AM2301 it's work by this code below ( No work for Si7021 )
The AM2301 (DHT22) is wired differently, it using kind of a 1-wire bus (not to be confused for a Dallas OneWire bus) but the SI7021 uses I2C. Most probably the wiring is wrong. Post a wiring diagram of your setup (may be hand drawn)!
You might need to make sure the device is powered and the ground is intact. Getting NaN means that you're likely getting garbage from the serial. Perhaps use a hex monitor to see what you're getting? Trashed data could come from bad GND and of course incorrect wiring.
pylon:
Getting an output with nan is not the same as getting nothing!
The AM2301 (DHT22) is wired differently, it using kind of a 1-wire bus (not to be confused for a Dallas OneWire bus) but the SI7021 uses I2C. Most probably the wiring is wrong. Post a wiring diagram of your setup (may be hand drawn)!
This is our circuit at IMG-7904 — ImgBB. I use Sonoff Si7021 and Sonoff model TH. Actually I have tested with old sonoff code. It's work but I try to flash via using our code. it's not work. I don't understand why is not work. I guess that about pin because all examples no use jack they use i2c as I know. If I misunderstand pls help us.
First: post picture here into the forum system and not to external sites that delete the link after short time frames. Second: Do you really think that this picture allows to see the circuit? Post schematics of the used components! And a wiring diagram (the white color on the connection doesn't allow to see any wiring).
pylon:
First: post picture here into the forum system and not to external sites that delete the link after short time frames. Second: Do you really think that this picture allows to see the circuit? Post schematics of the used components! And a wiring diagram (the white color on the connection doesn't allow to see any wiring).
The Sonoff sensor contains an Si7021 sensor but it’s not directly connected to the Sonoff TH but by some microcontroller that seems to translate the I2C signals to a kind of one wire bus.
There are some indicators on the Itead Wiki that this single wire bus is compatible with DHT11/22 sensors. So try to read the sensor using that protocol but you won’t be successful if you request data as if it was a directly connected SI7021.