yu55 / multi-am2301

Linux kernel module that supports multiple AM2301 (DHT21) sensors simultaneously connected to Raspberry Pi.
https://github.com/yu55/multi-am2301
GNU General Public License v2.0
6 stars 3 forks source link

multiple 1w sensors on same pin #2

Closed transistorgit closed 5 years ago

transistorgit commented 5 years ago

Hi!

very interesting project. One question that was not obvious from your readme: Are there multiple devices allowed on one 1W bus, or must each have it's own pin? Example: I have 5 DS1820 on one bus line and want to add a DHT21 on the same wire.

Brds Bernd

yu55 commented 5 years ago

Hi @transistorgit Thank you for your comment. Very good question. Each DHT sensor must have its own pin. "One-wire" in DHT sensors is totally different than 1-Wire made by Dallas Semiconductor (used by DS1820). Dallas 1-Wire requires connected devices to have a unique 64-bit address (written in their internal ROM), so you can select which device you want to commnicate, using just single common wire. DHT sensor doesn't have any kind of address, so each DHT sensor requires it's own signal pin in microcontroller. So i guess DHT "One-wire" is not really a bus anyway. Search google for "dht21 datasheet" and you will easily find documents describing how DHT works (it's quite easy and straightforward). Greetings :)

P.S. If you like my project please give it a star (maybe more people will find it, use it and make it better). Thanks :)

transistorgit commented 5 years ago

Ok, then it‘s clear. I just thought, 1wire is the same, as I think Dallas 1wire is quite famous. Then I will have to use another pin. brgs Bernd