HC-SR04 implimentation with OpenHAB (looking for recomendations)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

HC-SR04 implimentation with OpenHAB (looking for recomendations)

#1 Post by espfrm883 » 04 Oct 2015, 03:07

Hello folks,

My first project with ESP Easy is to build a garage stop light. Using an old full size stop light powered by two relays, ESP8266-12, and HC-SR04. Here's the draft sketch.
Is this the correct level shifter? h**p://www.ebay.com/itm/381273402938
Any feedback is encouraged and appreciated.
ESP Diagrams small.png
ESP Diagrams small.png (87.9 KiB) Viewed 7460 times

chrille
Normal user
Posts: 88
Joined: 26 Aug 2015, 15:11
Location: Horsens, Denmark

Re: HC-SR04 implimentation with OpenHAB (looking for recomendations)

#2 Post by chrille » 04 Oct 2015, 19:41

espfrm883 wrote:My first project with ESP Easy is to build a garage stop light. Using an old full size stop light powered by two relays, ESP8266-12, and HC-SR04. Here's the draft sketch.
It should work fine without a level shifter. The trigger input on the HC-SR04 can be triggered with 3.3V and the echo output can be connected to a voltage divider, using two resistors at 470R and 1k. I plan to do something similar to what you're doing, but I still need to test the hardware

- Jan
Jan Chrillesen, Denmark

espfrm883
Normal user
Posts: 30
Joined: 28 Sep 2015, 00:07

Re: HC-SR04 implimentation with OpenHAB (looking for recomendations)

#3 Post by espfrm883 » 05 Oct 2015, 03:19

Could I use a 4.7K and 10k instead? The math seems to draw 5v down to 3.4v as well.

Thank you for the reply Jan. How does the diagram look now.
ESP Diagrams.png
ESP Diagrams.png (102.44 KiB) Viewed 7428 times

hamster
Normal user
Posts: 62
Joined: 27 Sep 2015, 21:01
Location: UK

Re: HC-SR04 implimentation with OpenHAB (looking for recomendations)

#4 Post by hamster » 21 Oct 2015, 00:41

Hi. I managed to get a HC-SR04 working on R38 as per the diagram above. However I think there is a bug in the software :(
If i set the mode to 'state' rather than 'value' and submit, when I then press edit the device the esp reboots
Is there anyway to remove the devices. Or restore to default ? As I now can't remove the device. Many Thanks

Backbone
Normal user
Posts: 106
Joined: 06 Oct 2015, 22:12

Re: HC-SR04 implimentation with OpenHAB (looking for recomendations)

#5 Post by Backbone » 21 Oct 2015, 08:29

Voltage devider looks OK.
As long as the devider range stays the same and inside 100K ohm range it is OK.
So 10K and 47K is also an option or 22K and 33K and so on as long you get around 3.3 volt.
Dont go to lower as 1K combined as this will draw more current from the device then needed.

Paco

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: HC-SR04 implimentation with OpenHAB (looking for recomendations)

#6 Post by BertB » 21 Oct 2015, 14:14

You can also use a small signal diode (like 1n4448 or 1n914) or schottky diode, with the anode connected to the ESP input and the cathode to the HC-SR04 output. The internal pull-up resistor pulls the input to 3.3 v level at a logic 1 and the HC-SR04 pulls the ESP input down to a logic 0 level.
It works fine for me.

mkotek
Normal user
Posts: 116
Joined: 15 Dec 2015, 10:58
Location: Lomianki, Poland
Contact:

Re: HC-SR04 implimentation with OpenHAB (looking for recomendations)

#7 Post by mkotek » 20 Dec 2015, 00:36

I am having issues with connecting my SR04 to ESP. Again, it works fine with Arduino, but when connected via level shifter or via voltage divider, I am seeing just 0. I have even tried one idea found on the internet, to connect Echo just via 1K ohm resistor, but that does not change anything.
What is quite interesting, if I connect the SR04 in voltage divider scenario and reboot ESP, it does not start - the blue led lights bright and that's it. I am using GPIO14 and GPIO2, so it should not matter.
all other items connected - Temperature sensor, Relays and LCD wor fine, issue is just with SR04 (so far).
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 26 guests