wemos D1 R2 + two HC-SR04

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
sator86
Normal user
Posts: 7
Joined: 17 Jun 2019, 17:51

wemos D1 R2 + two HC-SR04

#1 Post by sator86 » 17 Jun 2019, 18:18

Hello,
I'm trying to make working a demos with ESPEasy-mega (the latest)
I tried to install who HC-SR04, however, only one works at time
as you can see at the enclosed pictures, I tried other GPIO, same issue, one at time
any one can help please ?
thank you

the FIRST
Capture d’écran 2019-06-17 à 18.15.52.png
Capture d’écran 2019-06-17 à 18.15.52.png (234.75 KiB) Viewed 2773 times
the SECOND
Capture d’écran 2019-06-17 à 18.16.13.png
Capture d’écran 2019-06-17 à 18.16.13.png (244.7 KiB) Viewed 2773 times
THE RESULT:
Capture d’écran 2019-06-17 à 18.19.28.png
Capture d’écran 2019-06-17 à 18.19.28.png (199.37 KiB) Viewed 2772 times

waspie
Normal user
Posts: 110
Joined: 09 Feb 2017, 19:35

Re: wemos D1 R2 + two HC-SR04

#2 Post by waspie » 17 Jun 2019, 19:43

This was supposedly fixed a long time ago but it never really was. I've attached a copy of the sketch from last year that i slightly modified to work with whatever big architecture change they made around april of 2018 i think ( i don't remember).

Anyway, replace the sketch with the same name with the file i've attached and recompile and it'll work fine.
http://h8rs.com:5000/sharing/HiiGlHIpY

sator86
Normal user
Posts: 7
Joined: 17 Jun 2019, 17:51

Re: wemos D1 R2 + two HC-SR04

#3 Post by sator86 » 18 Jun 2019, 08:00

ah ok,
thank you,
I'll try to compile tonight, I'll let you know
thank's again

sator86
Normal user
Posts: 7
Joined: 17 Jun 2019, 17:51

Re: wemos D1 R2 + two HC-SR04

#4 Post by sator86 » 20 Jun 2019, 21:24

hello,
I tried to compil it with ATOM
but I still have the same issue, only one is working ..
I don't know if it's correct
Capture.PNG
Capture.PNG (11.43 KiB) Viewed 2647 times
or if you have already a compiled version ?
thank you

waspie
Normal user
Posts: 110
Joined: 09 Feb 2017, 19:35

Re: wemos D1 R2 + two HC-SR04

#5 Post by waspie » 20 Jun 2019, 21:43

sator86 wrote:
20 Jun 2019, 21:24
hello,
I tried to compil it with ATOM
but I still have the same issue, only one is working ..
I don't know if it's correct
Capture.PNG
or if you have already a compiled version ?
thank you
http://h8rs.com:5000/sharing/9pbu3JjWL
This is built on 2.6 SDK3 for a 4m version with ONLY switch, dallas, mcp, hcsr04, tsl2561, and dummy plugins.

Test that to make sure your setup is working. I use this firmware and know it to be working.

sator86
Normal user
Posts: 7
Joined: 17 Jun 2019, 17:51

Re: wemos D1 R2 + two HC-SR04

#6 Post by sator86 » 22 Jun 2019, 01:07

hello,
I think I'm doing somethig wrong
I still have the same issue with your firmware
sometime one detector stay at 0, and sometimes the same freez at a different value like (high value) which not corresponding to a measure :roll:

waspie
Normal user
Posts: 110
Joined: 09 Feb 2017, 19:35

Re: wemos D1 R2 + two HC-SR04

#7 Post by waspie » 23 Jun 2019, 03:27

Not all gpio ports seem to work right.
Are you making sure you use a voltage divider?

sator86
Normal user
Posts: 7
Joined: 17 Jun 2019, 17:51

Re: wemos D1 R2 + two HC-SR04

#8 Post by sator86 » 23 Jun 2019, 18:21

hello,
I think this is my problem
I have read that hc-SR04 works on 5v, so I connect each one on +5v and gnd on the board
do you have a enample how must they to be connected ?
thank you

Shardan
Normal user
Posts: 1105
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: wemos D1 R2 + two HC-SR04

#9 Post by Shardan » 23 Jun 2019, 19:26

sator86 wrote:
23 Jun 2019, 18:21
hello,
I think this is my problem
I have read that hc-SR04 works on 5v, so I connect each one on +5v and gnd on the board
do you have a enample how must they to be connected ?
thank you
Hello,

take a look here: https://letscontrolit.com/wiki/index.ph ... _Converter

If you scroll down a bit you'll find a schematic for HC-SR04 and Wemos.
Regards
Shardan

sator86
Normal user
Posts: 7
Joined: 17 Jun 2019, 17:51

Re: wemos D1 R2 + two HC-SR04

#10 Post by sator86 » 24 Jun 2019, 18:38

thank you for your help Shardan
I don't have diode to test it, I'll let you know,
thank you again for your assistance ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests