HC-SR04+ and wemos d1 mini pro
Moderators: grovkillen, Stuntteam, TD-er
HC-SR04+ and wemos d1 mini pro
Hi,
I need help for what is the best practices to connect HC-SR04+ to wemos d1 mini pro? Do you have some connection schema?
And is it posible to power ultrasonic sensor separatly and only connect Trig and Echo pins to wemos?
Thank you,
BR
I need help for what is the best practices to connect HC-SR04+ to wemos d1 mini pro? Do you have some connection schema?
And is it posible to power ultrasonic sensor separatly and only connect Trig and Echo pins to wemos?
Thank you,
BR
Re: HC-SR04+ and wemos d1 mini pro
Hello,
i don't have a HC-SR04+, just some HC-SR04 (without the "+").
If they are driven the same way it's not too difficult to connect.
The HC-SR04 needs 5V so signal levels need a level shifter.
Anyways the trigger input can take 3.3V so there is no problem, just connect.
The echo output is just an output so level adaption can be done with two resistors.
. .
Configuration is as easy:
- -
Make sure you don't swap trigger/echo accidentally - output always need the resistors.
Hope that helps
Regards
Shardan
i don't have a HC-SR04+, just some HC-SR04 (without the "+").
If they are driven the same way it's not too difficult to connect.
The HC-SR04 needs 5V so signal levels need a level shifter.
Anyways the trigger input can take 3.3V so there is no problem, just connect.
The echo output is just an output so level adaption can be done with two resistors.
. .
Configuration is as easy:
- -
Make sure you don't swap trigger/echo accidentally - output always need the resistors.
Hope that helps
Regards
Shardan
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Thanks you Shardan.
Yes the HC-SR04+ is similar, only difference is that only need 3.3V, so I probably can connect it to 3.3V pin and than not need any resistors?
Is possible that I power sensor from external supply, so then I will put on wemos only triger and echo pins??
I am looking for water system monitoring solution and I am newbie on this, so I looking for best solution.
Water tank is around 300m from house, where I can mount some wifi antena. Do you think that is wemos d1 mini pro with external antena good for this?
From house to water tank I have 2 wires, which I maybe can use for power the wemos system - do you think that is good solution or is better that I power wemos system from solar and battery system?
Thank you
Yes the HC-SR04+ is similar, only difference is that only need 3.3V, so I probably can connect it to 3.3V pin and than not need any resistors?
Is possible that I power sensor from external supply, so then I will put on wemos only triger and echo pins??
I am looking for water system monitoring solution and I am newbie on this, so I looking for best solution.
Water tank is around 300m from house, where I can mount some wifi antena. Do you think that is wemos d1 mini pro with external antena good for this?
From house to water tank I have 2 wires, which I maybe can use for power the wemos system - do you think that is good solution or is better that I power wemos system from solar and battery system?
Thank you
Re: HC-SR04+ and wemos d1 mini pro
I can't say as i don't have a HC-SR04+. If you power it with 3.3V a direct connection is possible and necessary.karadn wrote: ↑23 Nov 2017, 17:22 Thanks you Shardan.
Yes the HC-SR04+ is similar, only difference is that only need 3.3V, so I probably can connect it to 3.3V pin and than not need any resistors?
Is possible that I power sensor from external supply, so then I will put on wemos only triger and echo pins??
Just give it a try. Even the older HC-SR04 runs with 3.3V but with very poor results.
A solar battery with a WeMos and a HC-SR04 will not work nicely or you need a big solar panel and battery.I am looking for water system monitoring solution and I am newbie on this, so I looking for best solution.
Water tank is around 300m from house, where I can mount some wifi antena. Do you think that is wemos d1 mini pro with external antena good for this?
From house to water tank I have 2 wires, which I maybe can use for power the wemos system - do you think that is good solution or is better that I power wemos system from solar and battery system?
Thank you
The WeMos has the USB part built in that takes up power permanently even if the ESP is powered down.
The HC-SR04 does not have a power down mode so it will consume some small current permanently too.
Using long wires isn't that easy either. There is a power loss on the wires depending on the current to the wemos.
As the HC-SR04 and the wemos can take some high peaks on current it is necessary to put 9 or 12 Volt on the
wire and a voltage regulator near the wemos to get a stable power supply.
300m distance might run into problems. It might work if you use a beam antenna on both ends.
Regards
Shardan
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Thank you for your recommendations.
I will put beam antennas on both side. What are the experiences with such antennas on wemos side?
And I need antenna with RP-SMA connector and another connector to wemos, and I read that must move one chip to external pin, is that right?
Yes, I know that long wires isn't that easy, but I don't have other solution for now, if you have other idea or solution for this project you are more than welcome
PS: Is this voltage regulator will be ok?
https://www.banggood.com/DC-DC-9V12V24V ... rmmds=cart
I will put beam antennas on both side. What are the experiences with such antennas on wemos side?
And I need antenna with RP-SMA connector and another connector to wemos, and I read that must move one chip to external pin, is that right?
Yes, I know that long wires isn't that easy, but I don't have other solution for now, if you have other idea or solution for this project you are more than welcome

PS: Is this voltage regulator will be ok?
https://www.banggood.com/DC-DC-9V12V24V ... rmmds=cart
Re: HC-SR04+ and wemos d1 mini pro
I've never tried an external antenna on a WeMos D1 as i use WeMos and nodeMCU just on breadboard testing.
For sensors and actors i use my own PCB's.
In this case i'd use a ESP-07S, which is the same chip as on the WeMos with a IPEX connector for external antenna.
The voltage regulator might run, but why such a big circuit?
A LF-33 CV voltage regulator and two capacitors gives the 3.3V for the ESP-Chip, it can be fed with 5...15 Volt.
Some additional parts are necessary, some resistors and a capacitor and that's it.
Regards
Shardan
For sensors and actors i use my own PCB's.
In this case i'd use a ESP-07S, which is the same chip as on the WeMos with a IPEX connector for external antenna.
The voltage regulator might run, but why such a big circuit?
A LF-33 CV voltage regulator and two capacitors gives the 3.3V for the ESP-Chip, it can be fed with 5...15 Volt.
Some additional parts are necessary, some resistors and a capacitor and that's it.
Regards
Shardan
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
ESP2866 GPIOs are 5V tolerant.
Resistor divider not needed.
Resistor divider not needed.
Re: HC-SR04+ and wemos d1 mini pro
It's a bit risky with 5V...
A typo "ESP2866" or other chip? I know only ESP8266....

Last edited by vader on 03 Dec 2017, 22:53, edited 3 times in total.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: HC-SR04+ and wemos d1 mini pro
Yeah I heard that as well. I can confirm both are correct, I have burnt two nodeMCU by feeding them 5V into a GPIO. But as well I have also mistakenly feed 5V into another nodeMCU with no problem.
With that being said, no, do not feed 5V into the GPIO pins.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: HC-SR04+ and wemos d1 mini pro
Nope, this is misleading.
The inputs can take 5V if and only if some specific settings are made by firmware.
This does not say they can take it for example at startup when pins are in
an undefined state first or if the settings are not made.
Took me some ESP's to find out......
Two resistors are much cheaper then an ESP..
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
"Espressif CEO Mr Teo Swee Ann commented that “i can reply officially here: it is 5V tolerant at the IO. while the supply voltage is at 3.3V.”
Page 17 of ESP8266 Datasheet it is mentioned “All digital IO pins are protected from over-voltage” ( 6V )
Of course some serial safety resistors are always very useful ( even with 3.3V - it can damage GPIO too with wrong configuration ), but this is something different than voltage divider.
For example with i2c bus connection is good news, that we do not need voltage converters between 3.3V and 5V.
Page 17 of ESP8266 Datasheet it is mentioned “All digital IO pins are protected from over-voltage” ( 6V )
Of course some serial safety resistors are always very useful ( even with 3.3V - it can damage GPIO too with wrong configuration ), but this is something different than voltage divider.
For example with i2c bus connection is good news, that we do not need voltage converters between 3.3V and 5V.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: HC-SR04+ and wemos d1 mini pro
A link to that and I'll mention it in the wiki.kimot wrote: ↑05 Dec 2017, 08:49 "Espressif CEO Mr Teo Swee Ann commented that “i can reply officially here: it is 5V tolerant at the IO. while the supply voltage is at 3.3V.”
Page 17 of ESP8266 Datasheet it is mentioned “All digital IO pins are protected from over-voltage” ( 6V )
Of course some serial safety resistors are always very useful ( even with 3.3V - it can damage GPIO too with wrong configuration ), but this is something different than voltage divider.
For example with i2c bus connection is good news, that we do not need voltage converters between 3.3V and 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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: HC-SR04+ and wemos d1 mini pro
https://ba0sh1.com/blog/2016/08/03/is-e ... -tolerant/
Page 17 here
https://cdn-shop.adafruit.com/product-f ... N_v4.3.pdf
And I saw some presentation about ESP2866 and spokesman said he talked with director of Espressif about this.
Page 17 here
https://cdn-shop.adafruit.com/product-f ... N_v4.3.pdf
And I saw some presentation about ESP2866 and spokesman said he talked with director of Espressif about this.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: HC-SR04+ and wemos d1 mini pro
Great! Thankskimot wrote: ↑05 Dec 2017, 11:45 https://ba0sh1.com/blog/2016/08/03/is-e ... -tolerant/
Page 17 here
https://cdn-shop.adafruit.com/product-f ... N_v4.3.pdf
And I saw some presentation about ESP2866 and spokesman said he talked with director of Espressif about this.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: HC-SR04+ and wemos d1 mini pro
Please explain what fried several ESP8266 on trying 5V feed here.
Talking to someone who talked to someone is no valid explanation for that.
Talking to someone who talked to someone is no valid explanation for that.
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
And datasheet is not valid information?
But better looking for graphs someone measured?
Look again at entire text and graphs:
https://ba0sh1.com/blog/2016/08/03/is-e ... -tolerant/
Of course there is written how you can destroy GPIOs, but in that case it is possible with 3V too.
Re: HC-SR04+ and wemos d1 mini pro
The Expressif ESP8266 datasheet can be found here:
http://espressif.com/sites/default/file ... eet_en.pdf
For I/O voltage it says for input values Vi:
http://espressif.com/sites/default/file ... eet_en.pdf
For I/O voltage it says for input values Vi:
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Indeed, better strongly advice to run on 3.3V logic levels and maybe mention there is some debate on whether the GPIO's are 5V tolerant.
The average user of these devices is probably not knowledged enough to know the implications, so better safe than sorry.
The average user of these devices is probably not knowledged enough to know the implications, so better safe than sorry.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: HC-SR04+ and wemos d1 mini pro
Yes, agree. Will try to formulate something in that direction.
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

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: HC-SR04+ and wemos d1 mini pro
Now I finaly connect my wemos d1 mini to ultrasonic HC-SR04, but it was not reading distance.
in log I see: 523491 : SR04 : Distance: SR04 : Distance: No reading!
In GPIO-12 I connect Trig, in GPIO-13 I connect Echo
in log I see: 523491 : SR04 : Distance: SR04 : Distance: No reading!
In GPIO-12 I connect Trig, in GPIO-13 I connect Echo
Re: HC-SR04+ and wemos d1 mini pro
If it is not the "+" version, no surprise. The gpio being 5v tolerant or not, the US needs 5v logic level to drive the speaker to send out a ping
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: HC-SR04+ and wemos d1 mini pro
It is not + version.
Now I power it from USB port, so what is yours suggestions, how I must power it?
Now I power it from USB port, so what is yours suggestions, how I must power it?
Re: HC-SR04+ and wemos d1 mini pro
you need to connect it to the gpio by using a 3,3/5v logiv level converter, all the info is there
check the wiki
https://www.letscontrolit.com/wiki/index.php/HC-SR04
https://www.letscontrolit.com/wiki/inde ... _Converter
My suggestion is to use a 5V power supply and a bidirectional level shifter. They are dead cheap and it works
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Re: HC-SR04+ and wemos d1 mini pro
For some clarification:
The HC-SR04 (old version without "+") definitely needs 5V to work nicely.
Some of them work, some not. Maybe depending on manufacturing tolerances.
Anyways if it works at all the ultrasonic "ping" is very weak so it detects about 30cm max, that's all.
The input ("Trigger") works quite nice with the 3.3V from the ESP.
This can be connected directly to the ESP without problem.
The output signal gives 5V, I'd be carefull with that. Many people tell the ESP is 5V friendly on the inputs...
If it really is or if it just can stand 5V on input for a (short?) while and might die later stays vague.
Whatever people say: The ESP8622 datasheet says inputs are not 5V tolerant and working with 5V at input can't be guaranteed.
Thats an instance I trust far more then an "it works for me" result from a few tests.
Anyways in this case a level shifter is not necessary, two resistors do the job quite well.
For example if using GPIO12, connect a resistor of 2.2 KOhm from GPIO12 to ground.
Connect a resistor of 1 KOhm from the GPIO12 to the output of the HC-SR04.
This works because we just need to lower the level of the output signal from the HC-SR04.
Level-converter are bi-directional so you can send data from low voltage side to high voltage
side and vice versa. Here we just go from "high" to "low" so a passive divider does well.
Regards
Shardan
PS: *Note to myself: Update the HC-SR04 Wiki, it's overdue*
The HC-SR04 (old version without "+") definitely needs 5V to work nicely.
Some of them work, some not. Maybe depending on manufacturing tolerances.
Anyways if it works at all the ultrasonic "ping" is very weak so it detects about 30cm max, that's all.
The input ("Trigger") works quite nice with the 3.3V from the ESP.
This can be connected directly to the ESP without problem.
The output signal gives 5V, I'd be carefull with that. Many people tell the ESP is 5V friendly on the inputs...
If it really is or if it just can stand 5V on input for a (short?) while and might die later stays vague.
Whatever people say: The ESP8622 datasheet says inputs are not 5V tolerant and working with 5V at input can't be guaranteed.
Thats an instance I trust far more then an "it works for me" result from a few tests.
Anyways in this case a level shifter is not necessary, two resistors do the job quite well.
For example if using GPIO12, connect a resistor of 2.2 KOhm from GPIO12 to ground.
Connect a resistor of 1 KOhm from the GPIO12 to the output of the HC-SR04.
This works because we just need to lower the level of the output signal from the HC-SR04.
Level-converter are bi-directional so you can send data from low voltage side to high voltage
side and vice versa. Here we just go from "high" to "low" so a passive divider does well.
Regards
Shardan
PS: *Note to myself: Update the HC-SR04 Wiki, it's overdue*
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Yes I already use two resistors for GPIO12.
I power D1 via USB connector (USB powerbank), ultrasonic sensor VCC pin is connected to D1 5V pin, is this ok or not?
I power D1 via USB connector (USB powerbank), ultrasonic sensor VCC pin is connected to D1 5V pin, is this ok or not?
Re: HC-SR04+ and wemos d1 mini pro
The ultrasonic ping takes some energy, on top i don't know how your power bank behaves.
Most likely there is some electronics for loading and protecting inside the power bank and
it might react to the pulses from the HC-SR04 or not.
I've tested taking the power from the WeMos pin, it should work. Anyways there might be
a diode in serial so you get only 4.3V instead of 5V so not the "full power".
I'd prefer a separate 5V power supply to get a test runing and then going on step by step.
Regards
Shardan
Most likely there is some electronics for loading and protecting inside the power bank and
it might react to the pulses from the HC-SR04 or not.
I've tested taking the power from the WeMos pin, it should work. Anyways there might be
a diode in serial so you get only 4.3V instead of 5V so not the "full power".
I'd prefer a separate 5V power supply to get a test runing and then going on step by step.
Regards
Shardan
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Thank you Shardan.
If I use separate 5V power for ultrasonic, how I must connect it, then I connect trig and echo pin only to wemos? Where I must connect ground?
Thank you
If I use separate 5V power for ultrasonic, how I must connect it, then I connect trig and echo pin only to wemos? Where I must connect ground?
Thank you
Re: HC-SR04+ and wemos d1 mini pro
Ground is the "common point for all".
So Gnd from WeMos, GND from HC-SR04 and GND from external power supply should be connected.
The "Trigger" of the HC-SR04 can be directly connected to one GPIO.
Output should be connected via resistors as described above to another GPIO.
+5V from Power supply to the Vin (or Vcc) of the HC-SR04.
Then power the WeMos from your power bank as before.
Regards
Shardan
So Gnd from WeMos, GND from HC-SR04 and GND from external power supply should be connected.
The "Trigger" of the HC-SR04 can be directly connected to one GPIO.
Output should be connected via resistors as described above to another GPIO.
+5V from Power supply to the Vin (or Vcc) of the HC-SR04.
Then power the WeMos from your power bank as before.
Regards
Shardan
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Are this settings for GPIO 12 and 13 are ok, or I must set something?
Re: HC-SR04+ and wemos d1 mini pro
I have a 3.3v version. But couldn't get it to work.
Re: HC-SR04+ and wemos d1 mini pro
I will take photo later.
Re: HC-SR04+ and wemos d1 mini pro
This is the one I had purchased:
https://www.ebay.de/itm/Micro-Mini-3-3- ... 2749.l2649
I cannot describe why it did not work well.
I should try again and document my steps.
I hada LoLin NodeMCU working with a contact switch input and I2C BMP-sensor.
Later I added the ultrasonic thingy and things stopped to work, but it may be a result of my non-linear trial and error.
(It was my first time working with ESP, and I was doubting if I had enough power, and all sorts of factors).
https://www.ebay.de/itm/Micro-Mini-3-3- ... 2749.l2649
I cannot describe why it did not work well.
I should try again and document my steps.
I hada LoLin NodeMCU working with a contact switch input and I2C BMP-sensor.
Later I added the ultrasonic thingy and things stopped to work, but it may be a result of my non-linear trial and error.
(It was my first time working with ESP, and I was doubting if I had enough power, and all sorts of factors).
Re: HC-SR04+ and wemos d1 mini pro
THe nodeMCU's have a voltage regulator 5V -> 3.3V. Usually this is a LM1117-3.3 or an even smaller one.
These regulators can take some current, it should be enough for a HC-SR04.
With the widespread WeMOS D1 Mini it might be near to limits as they use a very small regulator.
Anyways, together with nodeMCU it should work.
Another problem: Powering via USB cable? Try a short and thick cable!
Most cheaper USB cables have wires like a hair... if the HC-SR04 starts sending pulses it might be too much.
Another possible reason:
The US breakout you use is "like HC-SR04" but it obviously uses another circuit inside.
The HC-SR04 has a crystal onboard and another layout, this one has no crystal.
So it is questionable if they are really compatible to eachother.
These regulators can take some current, it should be enough for a HC-SR04.
With the widespread WeMOS D1 Mini it might be near to limits as they use a very small regulator.
Anyways, together with nodeMCU it should work.
Another problem: Powering via USB cable? Try a short and thick cable!
Most cheaper USB cables have wires like a hair... if the HC-SR04 starts sending pulses it might be too much.
Another possible reason:
The US breakout you use is "like HC-SR04" but it obviously uses another circuit inside.
The HC-SR04 has a crystal onboard and another layout, this one has no crystal.
So it is questionable if they are really compatible to eachother.
Last edited by Shardan on 16 Jan 2018, 20:02, edited 1 time in total.
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Yeah, unfortunately the seller contacted me to recommend this one (as I bought the NodeMCU at the same time).
I agree with you on USB cables.
I had my raspberry Pi indicating power issues even though I tried 3 USB power sources including a 3A capable block.
Finally I found the cable was the limiting factor.
1st cable: always caused power problems.
2nd cable: caused occasional problems.
3rd cable: raspberry pi has not once throttled due to power shortage.
I agree with you on USB cables.
I had my raspberry Pi indicating power issues even though I tried 3 USB power sources including a 3A capable block.
Finally I found the cable was the limiting factor.
1st cable: always caused power problems.
2nd cable: caused occasional problems.
3rd cable: raspberry pi has not once throttled due to power shortage.
Re: HC-SR04+ and wemos d1 mini pro
My sensor HC-SR04 still not working. I try with sepparate power the ultrasonic, but no luck.
Can you please check my connections and settings, now I power Wemos via USB adapter (5V).
Can you please check my connections and settings, now I power Wemos via USB adapter (5V).
Re: HC-SR04+ and wemos d1 mini pro
Hm.. looks good to me, as far as i can see.
That was my testing setup:
. .
It's same and worked, powered with a thick USB cable from my computer.
So what to do?
Check all cables first, a digital ohm meter helps a lot.
I've seen alot of these cheap DuPont cables having slack joints or no connection at all.
Breadboards are somewhat susceptible for bad contacts too.
Regards
Shardan
That was my testing setup:
. .
It's same and worked, powered with a thick USB cable from my computer.
So what to do?
Check all cables first, a digital ohm meter helps a lot.
I've seen alot of these cheap DuPont cables having slack joints or no connection at all.
Breadboards are somewhat susceptible for bad contacts too.
Regards
Shardan
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Just for the record:
I've assembled my test setup again, uploaded the actual v2.0-20180116 for testing.
It worked out of the box.
I've assembled my test setup again, uploaded the actual v2.0-20180116 for testing.
It worked out of the box.
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
So in settings must be:
- 1st GPIO set to GPIO-13, where Trig is connected.
- 2nd GPIO set to GPIO-12, where Echo is connected.
Is that ok?
- 1st GPIO set to GPIO-13, where Trig is connected.
- 2nd GPIO set to GPIO-12, where Echo is connected.
Is that ok?
Re: HC-SR04+ and wemos d1 mini pro
Yep..
Just it does not hurt if you swap accidentally, the device will just show 0.00.
If you doubt about that, swap the cables for a test.
Just it does not hurt if you swap accidentally, the device will just show 0.00.
If you doubt about that, swap the cables for a test.
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
The voltage that come from wemos 5v pin is 4.830V, it seams that is not enough for HC-SR04, because if I separate power 5V to ultrasonic it works now.
Is 4.8V realy too low for this sensor? So I must buy HC-SR04+ or P version?
Is 4.8V realy too low for this sensor? So I must buy HC-SR04+ or P version?
Re: HC-SR04+ and wemos d1 mini pro
I didn't have a problem using the 5V from the WeMOS D1 or nodeMCU.
Anyways, the nodeMCU has a diode separating the 5V output from the 5V input from USB.
Diodes have a forward-loss so this might be a problem.
This is difficult to decide without hands-on on your device at a well equipped test site.
It might be a problem of the HC-SR04 itself also, tolerances of parts or something.
These boards are cheapest china made stuff so this might occur.
I'd get some HC-SR-04 from a cheap source like AliExpress and check them out.
5 pieces come around 3,50€ at AliExpress.
Anyways, the nodeMCU has a diode separating the 5V output from the 5V input from USB.
Diodes have a forward-loss so this might be a problem.
This is difficult to decide without hands-on on your device at a well equipped test site.
It might be a problem of the HC-SR04 itself also, tolerances of parts or something.
These boards are cheapest china made stuff so this might occur.
I'd get some HC-SR-04 from a cheap source like AliExpress and check them out.
5 pieces come around 3,50€ at AliExpress.
Regards
Shardan
Shardan
Re: HC-SR04+ and wemos d1 mini pro
Like Shardan already mentioned. If the wires powering the device are too thin, then the voltage may drop when trying to use more power.
It is then simply a resistor with a voltage drop over the wire which will increase when the current increases.
Re: HC-SR04+ and wemos d1 mini pro
I have 3 sensors and with all is the same. I test sensor also with Wemos D1 pro and also not working.
Re: HC-SR04+ and wemos d1 mini pro
Then it gets difficult to check what's the reason without hand-on on a test site.
I suspice there is a problem with power supply, but honestly that's applied prophecy.
How do you supply power to the circuit? USB cable and power from PC?
I suspice there is a problem with power supply, but honestly that's applied prophecy.
How do you supply power to the circuit? USB cable and power from PC?
Regards
Shardan
Shardan
Who is online
Users browsing this forum: No registered users and 17 guests