logo elektroda
logo elektroda
X
logo elektroda

Why connect DHT22 directly to ESP8266 NodeMCU V3 3.3V pins without level shifter?

labo 4830 18
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17567301
    labo
    Level 13  
    Hi,
    I found that the ESP8266 nodemcu v3 has a voltage on the data pins of 3.3V. In various places you can find info that the pins tolerate 5.8V, although I don't see this in the official materials.
    Now the question is, why are virtually all devices even the DHT22 connected without a level converter when the ESP8266 has 3.3V pins?
  • ADVERTISEMENT
  • #2 17567319
    piterek-23
    Level 33  
    And doesn't the DHT sometimes run on a 3V3 supply?
  • ADVERTISEMENT
  • #3 17567337
    Anonymous
    Anonymous  
  • #4 17567389
    labo
    Level 13  
    piterek-23 wrote:
    And doesn't the DHT sometimes run on a 3V3 supply?
    .
    Depending on the specification it has a 3.3-5V, 3.3-6V supply.
    However, with a 5V supply people feed the output directly to the ESP8266 nodemcu pins. This doesn't just apply to the DHT22 but to other circuits with 5V output, hence my question about the tolerance of the ESP8266 nodemcu inputs and the possible need for a level converter.
  • ADVERTISEMENT
  • #5 17567432
    Anonymous
    Anonymous  
  • #6 17567496
    labo
    Level 13  
    Maybe lame, but what's the difference? An acceptable pin voltage is an acceptable pin voltage. It doesn't matter which one, or what signal is flying with it.
  • #7 17567527
    Anonymous
    Anonymous  
  • #8 17567687
    labo
    Level 13  
    Er2lub wrote:
    So write what buses you are talking about.
    .
    I have a device giving TX, RX 3.3V so no such problem here.
    The thing is, I was looking through various examples on the net looking for an answer to my question about pin voltages.
  • #9 17567756
    Anonymous
    Anonymous  
  • ADVERTISEMENT
  • #10 17567899
    labo
    Level 13  
    Er2lub wrote:
    * 3.3V input 5V output.
    Here it can vary.
    .
    This was the essence of my question.

    [/quote]* I2C, 1-Wire and others with OC(OD) you pull up to +3.3V and there is no problem. [/quote]
    Unless you have a module on 5V and there is already a pull-up resistor there, which brings it to a higher point.

    Er2lub wrote:
    I guess you can count what and what will be the max allowable rate of voltage change?
    .
    No. You know, when you're retired, you don't always want to know everything or investigate everything anymore. Well, unless it turns out to be needed. ;)
    Which isn't to say you can't explain, this is an open forum after all, and it can be read by people who could use the knowledge as much as possible.
    Greetings
  • #11 17567919
    Anonymous
    Anonymous  
  • #12 17568259
    khoam
    Level 42  
    labo wrote:
    However, with a 5V power supply, people feed the output directly to the ESP8266 nodemcu pins. This does not only apply to the DHT22 but to other circuits with 5V output, hence my question about the tolerance of the ESP8266 nodemcu inputs and the possible need for a level converter.
    .

    The need for a level converter is indisputable in this case, the tolerable input voltage range of the processor has nothing to do with it.
  • #13 17568280
    Anonymous
    Anonymous  
  • #14 17568304
    khoam
    Level 42  
    Er2lub wrote:
    Are you saying that the ESP will be damaged when connected to the DHT22, which is powered by 5V? In what way? The recommended 4.7k resistor will force more than 20mA to flow when connected to 5V? How is this possible? Or will the voltage levels be incompatible?
    .

    It all depends on the particular copy of the ESP. The ESP8266 technical documentation is unambiguous in this regard, and clearly states an allowable voltage of 3V3.
    Yes, I know the internet is teeming with various experiments to confirm the possibility of control from 5V. People are always looking for a challenge and the cost of a converter is none.
  • #15 17568333
    kaczakat
    Level 34  
    Officially, the ESP8266 is allowed 3.3V+10% on the pins. The CEO of Expressive has admitted that it tolerates 5V, which is in line with user observations. Does this affect the circuit well? Probably not, which is why it is better to use logic level converters. However, in most cases nothing will happen if you make a mistake and apply 5V to the pins (even if you supply the ESP with 5V). I wired it that way myself once by accident. But you can damage the processor by supplying even 3.3V, so it is better to use a converter. I have provided links to CEO statements here: https://www.elektroda.pl/rtvforum/topic3509270.html ( and this is the manufacturer, contrary to the answer in the comment). The converter not only lowers the voltage for the ESP, but will also raise the voltage for the 5V device, so it's harder to have a communication error - something that is a 1 can be considered a 0 and vice versa.
    Helpful post? Buy me a coffee.
  • #16 17568339
    Anonymous
    Anonymous  
  • #17 17568347
    khoam
    Level 42  
    Er2lub wrote:
    Surely nowhere in the documentation does it say 3.3V, just VCC+iles there and GND-iles there.
    So read the documentation ALL over again! Note the max current causing input failure.
    .

    Yes, you should read that documentation before you even continue to post anything on this forum on this issue.

    Why connect DHT22 directly to ESP8266 NodeMCU V3 3.3V pins without level shifter? .
  • #18 17568351
    Anonymous
    Anonymous  
  • #19 17568466
    khoam
    Level 42  
    Er2lub wrote:
    Educate yourself mate, because I can see that you are completely unfamiliar with the design of the inputs and outputs of digital circuits, even worse, you do not distinguish between voltage and current.
    To make the issue of current and voltage easier to understand, why is it that 230V from the power grid very often kills a person, while tens or hundreds of thousands of volts from a stun gun does not?
    .

    The trick is to be able to read with understanding, not to write mindlessly.

Topic summary

The discussion addresses why the DHT22 sensor is commonly connected directly to the ESP8266 NodeMCU V3 3.3V pins without a level shifter, despite the sensor often being powered at 5V. The ESP8266 pins officially tolerate a maximum of about 3.6V (3.3V + 10%), but many users report that the inputs can withstand 5V signals without immediate damage. The key technical point is that communication protocols like 1-Wire, I2C, and similar use open-drain/open-collector outputs with pull-up resistors, typically to 3.3V, which prevents the input voltage from exceeding safe levels. When a 5V device has its own pull-up resistor, it can raise the line voltage above 3.3V, potentially risking damage. The current flowing through the input protection diodes limits the risk, and if the series resistor is chosen correctly (e.g., 4.7kΩ), the current remains within safe bounds. However, this is not guaranteed for all ESP8266 chips or setups, and using a logic level converter is the safest approach to prevent damage and ensure signal integrity. The ESP8266 datasheet specifies 3.3V tolerance, and while some users and even the ESP manufacturer acknowledge that 5V tolerance is often observed, it is not officially recommended. The level converter also helps maintain proper voltage levels in both directions, reducing communication errors. Overall, the absence of a level shifter in many DHT22-ESP8266 circuits is due to the nature of the sensor's communication protocol, the use of pull-up resistors, and practical tolerance observed in ESP8266 inputs, but it carries some risk and is not strictly compliant with official specifications.
Summary generated by the language model.
ADVERTISEMENT