I already have board with soldered 4.7K pullup resistor for DS18B20 temp. sensor. I want to replace it with DHT22 temp/humidity sensor. Adafruit recommends 10K pullup, but will it also work with my 4.7K? I really don't want to de-solder it
it should be OK, that is the suggested value in this thread Class for DHT11, DHT21 and DHT22 (temperature & humidity) - Libraries - Arduino Forum
I use 4.7Kohm with DHT22, no problem
Great, thank you guys!
One more question. What exactly is purpose of pullup in this device? What will happen if I disconnect resistor when reading are not being taken (i.e. via transistor to save on power drain)?
(deleted)
spycatcher2k:
The device is an 'open drain' device - it can only pull a line low, so you need to supply the HIGH for it to pull down.
Thanks!
So what will happen if I disconnect resistor? Device simply won't work, or it can damage microcontroller connected to it?
bratan:
Thanks!
So what will happen if I disconnect resistor? Device simply won't work, or it can damage microcontroller connected to it?
Ever heard of Zero Volt Logic?
A logic 1 = 0V, a logic 0 = 0v, how does the microcontroller tell the difference?
bratan:
So what will happen if I disconnect resistor? Device simply won't work, or it can damage microcontroller connected to it?
It won't work.
DHT22 only draws around 40 ua when not measuring.
Theres no need to disconnect the resistor.
bratan:
Great, thank you guys!
One more question. What exactly is purpose of pullup in this device? What will happen if I disconnect resistor when reading are not being taken (i.e. via transistor to save on power drain)?
I have a project (below) where I turn off power to the DHT22 to save power. The resistor is connected to the switched power line, so it also is disconnected.
Wow I'm reading it now, great job on that project! 36 ยตA that's amazing!!!
I'm looking to build an outdoor temp/humidity sensor with wireless transmitter. So far it only lasted for 10 days on 2xAA (powered via 3.3V DC up converter). I'm not actually using DHT22 yet, only DS18B20 as proof of concept, but it's part of DHT22. I calculated that 4.7K resistor is possible power hog (at 3.3V 4.7K resistor will draw 0.7mA) that kills batteries since it's inserted between data VCC line, thus I wanted to power it down via transistor while microprocessor is "watchdog" sleeping (8*8 seconds) between measurements and transmissions...
The resistor only draws 0.7 ma when the DHT22 is actually measuring.
When its not measuring the resistor draws nothing as the data line is normally high.
What little current the DHT22 consumes is via its power pin, not the data pin.
mauried:
The resistor only draws 0.7 ma when the DHT22 is actually measuring.
When its not measuring the resistor draws nothing as the data line is normally high.
What little current the DHT22 consumes is via its power pin, not the data pin.
Oh I see, I didn't realize it. Thanks!
I have a DHT22 working @ 3V3 and connected to a Tiny85 using BT serial to report data from the outside sensor to my 'console' I just removed the pull-up while monitoring the output data and there was no change with a 12cm wire between the sensor and the controller. I did remove and replace the 10K resistor several times with No difference in the reported data.
Doc
The Adafruit library sets the pin to have the inbuilt pull-up, so it may work without it (contrary to what I said above).
According to their page:
You will want to place a 10K resistor between VCC and the data pin, to act as a medium-strength pull up on the data line. The Arduino has built in pullups you can turn on but they're very weak, about 100K
So you are getting a pull-up, just not the recommended one. And that is if you use that library.
The strength of the pullup resistor thats needed is largely determined by how long the cable is between the Arduino and the sensor.
The longer the cable , the lower the resistor needs to be.
The sensor sends data is the form of pulses, 28 us long and 70 us long, and as long as the rising and falling edges of the pulses are square enough to read
the sensor will work OK.
Ive got some sensors on 3 metre cables with 10K and they work fine.
I realize this is an old topic, but I wanted to add a little from my experience. The DHT22 will work at 3V3 using a 10K pullup, but only if the sensor is very close to the port. You could use the internal pullup in the Pi in this case. On a 6 meter cable I had to use 5 volts and a 4.7K pullup resistor.