To make HCSR04 compatible with esp8266

How to make HCSR04 which has an operating voltage of 3.3v compatible with esp8266.

I'm pretty certain an HCSR04 won't work at 3.3V, so you're going to need a 5V supply and some level shifters.

1 Like

I thought of powering up the board(via Vin) and the sensor with a 5v supply,I am just worried regarding the output of the echo pin which, according to the logic should be 5v,that could possibly fry up the IC.Is my concerns Valid?

Yes, they are. That´s why @anon73444976 suggested you the level shifters. HCSR04 might receive 5V to work properly and will give back 5V logic signals that must be reduced to preserve your ESP.

Note that "level shifters" does not necessarily imply ICs or FETs, and the "bidirectional level shifters" available (which are simply an array of FETs) may or may not be appropriate if rapid response is required.

A 5 V level may be reduced to 3.3 V by either a voltage divider or a diode with cathode to 5 V logic and anode to 3.3 V logic with a pull-up to 3.3 V which may just be the internal pull-up.

It may not be necessary to convert the 3.3 V logic to 5 V as the latter device may already accept 3.3 V as a solid logic HIGH.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.