0
\$\begingroup\$

I'm a beginner in the field, and I'm working in a IoT application, especifically with sensor HCSR-04 and the WiFi module ESP8266.

ESP8266 works with 3.3v in the Vcc pin and HCSR-04 works with 5v, so I need to take down the 5v to 3.3v with a resistor. Searching on Internet I figured out I needed a Voltage Divider Resistor so I found this online calculator, put the values:

Input Voltage : 5v
R1            : X
R2            : 10
Output Voltage: 3.3v

Note that I put in R2 a 10k Ohm resistor, because I only have 5k, 10k, 15k resistors available. So, according to this calculator, X = 5.15k Ohm.

Question:

Is it ok if I use this resistors to take down the 5v input to 3.3v output? Will it work in real life? (not theoretically), or there is something I'm missing?

\$\endgroup\$
3
\$\begingroup\$

Sorry, but that won't even work theoretically. You are ignoring the fact that the 8266 needs to draw current, and quite a bit of it. You can model your proposed circuit as

schematic

simulate this circuit – Schematic created using CircuitLab

and the 8266 does not even have the decency to act as a simple resistor. From the data sheet you can see that the power supply drain can be in the range of 60 to 215 mA while operating, for an equivalent resistance of 15 to 55 ohms, and your standby equivalent is 3.7 Mohms. If you play around with your calculator you'll see that a simple voltage divider will not give you anything near the performance you want, and you'll need to step up to a voltage regulator. Start studying.

\$\endgroup\$
1
\$\begingroup\$

1) Powering up the ESP8266

To give power supply to the ESP8266 you will need low dropout voltage regulator powered from the 5V line.

5V --- [3.3V Voltage Reg] ---> 3.3V

2) Data connections between the ESP8266 and HCSR-04

You can use resistor voltage divider that you have discovered to connect output signal from HCSR-04 (btw ... is it HC-SR04 ??) to ESP8266.

You can directly connect digital signal output of ESP8266 to the trigger input of HCSR-04. However, better way would be to drive a small signal transistor (2N3904 / BC547) and then connect it's output to the HCSR-04. Note that, this scheme will invert the signal.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.