Distance with HC-SR04

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Distance with HC-SR04

#1 Post by onlize » 18 Mar 2018, 04:54

I configured ESPEasy with HC-SR04 sensor.

I configured it using this https://www.letscontrolit.com/wiki/index.php/HC-SR04. I used the option with two resistors. The only difference is that I have NodeMCU and it does not have pin with 5V, and I had to connect VCC pin on HC-SR04 to 3.3V pin on NodeMCU.

The problem that I have is that the output is always 0.10 and does not change. Is it possible that the problem is 3.3V instead of the 5V? Do I have to buy 5V power supply for the HC-SR04 sensor? Or is there anything else that I should check?

Thank you.

TD-er
Core team member
Posts: 8749
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Distance with HC-SR04

#2 Post by TD-er » 18 Mar 2018, 12:30

The wiki page you linked does state something about the voltage:
The HC-SR04 must be run on 5V. Running it with 3,3V will show very weak results or nothing at all.
But the NodeMCU does have 5V, when powered via USB?
Or are there newer/other versions I don't know yet?
Also take into account you really need something to lower the 5V signal from the sensor.

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: Distance with HC-SR04

#3 Post by onlize » 18 Mar 2018, 13:04

As far as I can see, it does not have 5v pin:

Image

I guess, I have try to get 5V power supply.

Thank you.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Distance with HC-SR04

#4 Post by grovkillen » 18 Mar 2018, 13:35

Vin is 5V
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

onlize
Normal user
Posts: 44
Joined: 12 Aug 2017, 03:44

Re: Distance with HC-SR04

#5 Post by onlize » 18 Mar 2018, 14:32

It worked, thank you for your help.

Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests