Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Si7021 #216

Closed
xoseperez opened this issue Sep 13, 2017 · 15 comments
Closed

Add support for Si7021 #216

xoseperez opened this issue Sep 13, 2017 · 15 comments
Labels
enhancement New feature or request major sensors

Comments

@xoseperez
Copy link
Owner

Originally reported by: Sven Kopetzki (Bitbucket: TriCX, GitHub: TriCX)


Pleae add support for Itead's Sonoff Si7021 sensor:
https://www.itead.cc/wiki/Sonoff_Sensor_Si7021

The sensor is not being detected.

The sensor itself provides an I2C interface, but this interface is not routed towards the connector.
https://www.itead.cc/wiki/images/7/7c/Sonoff_Si7021_Sensor_Schematic.pdf

There is an MCU (EFM8BB10F2G-A) in between.
https://www.silabs.com/documents/public/data-sheets/efm8bb1-datasheet.pdf
The MCU is connected to the 2.5mm audio male plug connector.
Itead's wiki page named it "Single bus, data port ". Whatever this is.
It might be an UART or a 1-wire bus, but I'm not sure.

Thanks in advance!

@xoseperez
Copy link
Owner Author

There is no documentation anywhere about the protocol of Iteads Si7021 sensor.
I doubt it's UART, 1-wire looks like a better chance. Anyway you could try to sniff the protocol.
Another option would be to open it an rewire the I2C pins of the sensor to the audio cable...

@xoseperez
Copy link
Owner Author

Removing milestone: 1.9.4 (automated comment)

@xoseperez
Copy link
Owner Author

Last week I received a SI7021 sensor from Itead. Will try to find out how it works.

@xoseperez
Copy link
Owner Author

Original comment by The Soundlover (Bitbucket: sndlover, GitHub: sndlover):


Hi Xose!
First I have to say, I admire your work and have changed some of my self developed hobby projects to ESPURNA, because you made them obsolete ;-)
Currently I was also looking for Si7021 support and found this post.
I just wanted to let you know, that the Si7021 is I2C and I have implemented it using a Adafruit library for it.
EDIT: Sorry, I did not read the original request close enough, that this is a specific problem to a proprietary connection/protocol.

@xoseperez
Copy link
Owner Author

Original comment by Rui Marinho (Bitbucket: ruimarinho, GitHub: ruimarinho):


@xoseperez that's cool! Did you get around to analyse it? I'm looking at the SI7021 as a more accurate alternative to the DHT11.

@xoseperez
Copy link
Owner Author

Original comment by Rui Marinho (Bitbucket: ruimarinho, GitHub: ruimarinho):


@xoseperez this has been reverse engineered by kkuisma over at arendst/Tasmota#735 (comment). :)

@xoseperez
Copy link
Owner Author

Awesome, I had already done part of the path but didn't get so far. Actually, it looks a lot like the DHT protocol... I wonder if it would work with the DHT code, would make a lot of sense since it's already implemented in the original firmware, so it would be like creating a facade so the SI7021 behaves like the DHT22...

@xoseperez
Copy link
Owner Author

Yes, I can confirm it. A small change in the DHT code makes it compatible with the two of them, Itead's SI7021 behaves like their AM2301.

@xoseperez
Copy link
Owner Author

It's already in the dev branch. Will be released with 1.10.1

@xoseperez
Copy link
Owner Author

Released with 1.10.1

@xoseperez
Copy link
Owner Author

Removing milestone: 1.10.1 (automated comment)

@xoseperez
Copy link
Owner Author

Original comment by Daniel Izquierdo (Bitbucket: danisportmaniacs, GitHub: Unknown):


I have tried today the latest version (1.11.3) on my TH16 and it does not work.
It reports 0 from rest API, and timeout from web interface.

@xoseperez
Copy link
Owner Author

Original comment by Rui Marinho (Bitbucket: ruimarinho, GitHub: ruimarinho):


@danisportmaniacs working fine here - 1.11.3, v2.1 board using Si7021. Make sure the cable is completely plugged in. I got a "timeout" reading as the connector was not fully inserted.

Regarding sensor data, it seems to be real, although it reads as DHT22. @xoseperez, small nitpick but would it possible to distinguish a DHT22 from a Si7021? If not, I suggest showing "DHT22 / Si7021" on the interface.

Thanks very much for your work on Espurna!

@HummelsTech
Copy link

What's the correct setting/build for this to work? I can't get it work on my Sonoff TH16

@xoseperez
Copy link
Owner Author

SI7021 is supported via the I2C interface. But Sonoff's SI7021 sensor is behind a microcontroller that makes it behave like a DHT22 so you have to enable DHT22 support, not SI7021 support and point it to GPIO14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major sensors
Projects
None yet
Development

No branches or pull requests

2 participants