Working with 5v component(s) in 3.3v Arduino?

Hi everyone

Lately I've been reading about how once has to use a resistor in the data line for an DHT22 sensor when using an Arduino (since my understanding is that the ATmega is being powered with less than 5v). This is detailed in the Adafruit tutorial (Connecting to a DHTxx Sensor | DHT11, DHT22 and AM2302 Sensors | Adafruit Learning System). I understand that due to the difference voltage references from the chip & the sensor, one needs to use a resistor in the signal line (as also explained » Voltage: 3.3 vs 5 » JeeLabs).

However, I am a bit confused about all this, and so I was hoping to ask a few questions to see if I can understand a bit better:

  1. why does the adafruit example use a 10K resistor, and in the Jeelabs they talk about a 1k resistor? In a recent forum discussion (I am having trouble with a DHT22 temperature sensor to work on Arduino Mini Pro - Sensors - Arduino Forum), there was a mention of using a DHT22 with resistors with a range between 3.3K - 10K. How are these values determined?

  2. If I was to have an Arduino Pro Mini 3.3v:
    a. which resistor value would I need to get reliable results from a DHT22?
    b. if I wanted to use a chronodot, I would a pullup resistor as well, correct? If so, how can I determine what resistor to use?

Thanks so much in advance... and I'm sorry for my "beginner" questions :slight_smile:

L.

You're refering to a pull up .. (or pulldown but not with this sensor)

Think of a pullup as a rope, the rope pulls keeping the object securely to the wall, how strong the rope is the resistance value, lower the resistance stronger the rope. Without the rope the object will move around the room giving you false results.

In Arduino terms, this is called floating, to keep it from floating a resistor keeps the value high at 5v or low at 0v so a 1k or 10k would work just fine if the sensor is able to overcome the current from the resistor.

The resistor for the DHT22 is a pullup resistor and has nothing to do with voltage differences between devices. The idea is to pull up that pin with the device pulling it to ground for signalling.

The Atmega in most Arduinos is powered with 5 volts. Some Arduinos run at 3.3 volts but these are clearly marked as 3.3v versions.
The advantage of running a 3.3v Arduino is that it can interface dirrectly with 3.3v devices.

If you have a 5 v Arduino and a 3.3v device you usuualy need to level shift between the two. A simple way is to use a voltage divider (Voltage divider - Wikipedia) to downshift the voltage from the Arduino to the device. The device will only give a 3.3v signal back but but this is enough for a logic high in the 5v Arduino and therefore still works. Without going into detail, some sensitive devices do not like voltage dividers due to speed of rise times and therefore you need to use voltage translators (8-channel Bi-directional Logic Level Converter [TXB0108] : ID 395 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits) between the two.

Thanks guys for the great explanations! It actually makes a lot of sense. Now I understand why it is so important to use the appropriate pullup resistors in order to minimize potential signal noise. Makes total sense :slight_smile:

One quick question about the use of the logic converters. So, I understand that you would use these in the signal wires when connecting a 5v chip to a 3.3v device in order to make the voltages in the signal wires match between the two. My question is... is the logic converter capable of powering the device with 3.3v, or you would need a separate power source (i.e.: a separate 3.3v power regulator)?

Thanks!! :slight_smile:

Never mind... I just realized that the 3.3v devices can be powered right off the logic board...

Just confirming that you shouldn't have any problem at all...both the DHT22 and the ChronoDot should work as-is on 3.3V.