ESPEASY 120 Relay will not low with Ultrasonic sensor
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 8
- Joined: 20 Jun 2017, 12:45
ESPEASY 120 Relay will not low with Ultrasonic sensor
Hi All,
Started with ESP easy, installed it together with PI Matic Seems to work quite good.
i have a small problem though
192.168.1.143/control?cmd=GPIO,4,1 Turns on my LED no problem
logs shows 246476 : SW : GPIO 4 Set to 1
{
"log": "GPIO 4 Set to 1",
"plugin": 1,
"pin": 4,
"mode": "output",
"state": 1
}
Turning off do's not work
192.168.1.143/control?cmd=GPIO,4,0
{
"log": "GPIO 4 Set to 0",
"plugin": 1,
"pin": 4,
"mode": "output",
"state": 0
}
455492 : SW : GPIO 4 Set to 0
But the Relay stays on high position
I have no clue why ?
Thanks for any pointers where to look
Started with ESP easy, installed it together with PI Matic Seems to work quite good.
i have a small problem though
192.168.1.143/control?cmd=GPIO,4,1 Turns on my LED no problem
logs shows 246476 : SW : GPIO 4 Set to 1
{
"log": "GPIO 4 Set to 1",
"plugin": 1,
"pin": 4,
"mode": "output",
"state": 1
}
Turning off do's not work
192.168.1.143/control?cmd=GPIO,4,0
{
"log": "GPIO 4 Set to 0",
"plugin": 1,
"pin": 4,
"mode": "output",
"state": 0
}
455492 : SW : GPIO 4 Set to 0
But the Relay stays on high position
I have no clue why ?
Thanks for any pointers where to look
-
- New user
- Posts: 8
- Joined: 20 Jun 2017, 12:45
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
forgot to mention
Device: Switch Input
Name: Relay
Delay: 0
IDX: 123
1st GPIO: GPIO4 "D2 on the Wemos d1 mini"
Pullup: not checked
Inversed: not checked
Switch type:Switch
Switch button type: normal switch
Send boot state not checked
Send data: not checked
Value name 1: Switch
Device: Switch Input
Name: Relay
Delay: 0
IDX: 123
1st GPIO: GPIO4 "D2 on the Wemos d1 mini"
Pullup: not checked
Inversed: not checked
Switch type:Switch
Switch button type: normal switch
Send boot state not checked
Send data: not checked
Value name 1: Switch
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
Have you tried another GPIO (just to test)? Default setting for GPIO4 is to be used as part of the i2c communication (SDA).
https://www.letscontrolit.com/wiki/inde ... figuration
https://www.letscontrolit.com/wiki/inde ... figuration
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



-
- New user
- Posts: 8
- Joined: 20 Jun 2017, 12:45
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
I first used gpi0 d5 and d0 same problem there
Last edited by dumbme on 20 Jun 2017, 16:00, edited 1 time in total.
-
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
Try 12.
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



-
- New user
- Posts: 8
- Joined: 20 Jun 2017, 12:45
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
GPIO 13 D7 still same problem
128392 : SR04 : Distance: 182.45
128392 : EVENT: Regenton#Distance=182.45
128393 : {"idx":99,"nvalue":0,"svalue":"182"}
128600 : SW : GPIO 13 Set to 0
128641 : SW : State 0
128642 : EVENT: Relay#Switch=0.00
128734 : SW : GPIO 13 Set to 0
138403 : SR04 : Distance: 181.55
138403 : EVENT: Regenton#Distance=181.55
138404 : {"idx":99,"nvalue":0,"svalue":"182"}
128392 : SR04 : Distance: 182.45
128392 : EVENT: Regenton#Distance=182.45
128393 : {"idx":99,"nvalue":0,"svalue":"182"}
128600 : SW : GPIO 13 Set to 0
128641 : SW : State 0
128642 : EVENT: Relay#Switch=0.00
128734 : SW : GPIO 13 Set to 0
138403 : SR04 : Distance: 181.55
138403 : EVENT: Regenton#Distance=181.55
138404 : {"idx":99,"nvalue":0,"svalue":"182"}
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
Hello dumbme, welcome aboard.
Which type of relay board do you use?
Can you please give a picture or a link to ebay/AliExpress or whatever?
We have seen some relay boards with some strange circuitry not switching on or off with an ESP-Chip.
If you have a digital voltmeter you might do this:
- send a "control?cmd=gpio,xx,1",
- check the voltage at GPIOxx, it should be around 3V
- send a "control?cmd=gpio,xx,0",
- check the voltage at GPIOxx, it should be around 0V.
If this works it is the relay board that's working a bit unexpected here,
would not be the first one
Regards
Shardan
Which type of relay board do you use?
Can you please give a picture or a link to ebay/AliExpress or whatever?
We have seen some relay boards with some strange circuitry not switching on or off with an ESP-Chip.
If you have a digital voltmeter you might do this:
- send a "control?cmd=gpio,xx,1",
- check the voltage at GPIOxx, it should be around 3V
- send a "control?cmd=gpio,xx,0",
- check the voltage at GPIOxx, it should be around 0V.
If this works it is the relay board that's working a bit unexpected here,
would not be the first one

Regards
Shardan
Regards
Shardan
Shardan
-
- New user
- Posts: 8
- Joined: 20 Jun 2017, 12:45
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
thank you happy to be part of such a big community"Hello dumbme, welcome aboard."
https://www.aliexpress.com/item/Free-sh ... 0.0.A10ZX7"Which type of relay board do you use?
Can you please give a picture or a link to ebay/AliExpress or whatever?"
Weirdly they come of an ESPmatic solution that was working without any issuesWe have seen some relay boards with some strange circuitry not switching on or off with an ESP-Chip.
So after you wrote this i got another 1 same issue, so was thinking probably the code or lib.
Then desided i needed a good night sleep before i was starting to measure everything "I tried though but i was getting strange readings wherever i measured"
This morning i thought lets grab another board 1 from keyes and what would you know it works so then i thought broken relay
While looking up the ali link i saw 5v and thought hmmzzzz it is connected to 5 volt but lets try 3v and what would you know i live up to my name all works fine now
so thank you guys for responding and thank you for triggering me to think

-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
Yep, i roughly can guess why.
The webpage says "This module is low level triggered".
Technically this says the little transistor (tiny black 3-pin rectangle on the board) is an PNP type.
So the Voltage for the transistors emitter is the +5Vcc. A voltage on the input has to be lower then
these 5Vcc to switch the relay. Ho much below 5Vcc? This depends on the circuit used.
If it is only the transistor a voltage of <4,3V is needed. If some other parts are in circuit, it might be lower.
If there is a red LED in the circuit of the transistor the voltage may go down to around 2.8V and lower.
This leads to the effect you described: If your ESP goes to "LOW" it switches the relay on.
Then your ESP goes back to high, this is around 3V. But for switching back to off you will need a
higher voltage to close the transistor completely.
If you set your Relay block to 3V as Vcc the on-level goes down to 0,8..1V, the off-level goes to 2,8...3 V
Then your ESP can switch both points.
Just watch out:
3V might be a bit low for the relay over long time.
It might be better to unse a cheap opto coupler (every 817-type does it),
put the LED inof the opto coupler on the ESP-Output (Resistor 330...560 Ohm in serial!)
and the transistor output to the in (Collector) and Gnd (Emitter) of the relay board.
Regards
Shardan
The webpage says "This module is low level triggered".
Technically this says the little transistor (tiny black 3-pin rectangle on the board) is an PNP type.
So the Voltage for the transistors emitter is the +5Vcc. A voltage on the input has to be lower then
these 5Vcc to switch the relay. Ho much below 5Vcc? This depends on the circuit used.
If it is only the transistor a voltage of <4,3V is needed. If some other parts are in circuit, it might be lower.
If there is a red LED in the circuit of the transistor the voltage may go down to around 2.8V and lower.
This leads to the effect you described: If your ESP goes to "LOW" it switches the relay on.
Then your ESP goes back to high, this is around 3V. But for switching back to off you will need a
higher voltage to close the transistor completely.
If you set your Relay block to 3V as Vcc the on-level goes down to 0,8..1V, the off-level goes to 2,8...3 V
Then your ESP can switch both points.
Just watch out:
3V might be a bit low for the relay over long time.
It might be better to unse a cheap opto coupler (every 817-type does it),
put the LED inof the opto coupler on the ESP-Output (Resistor 330...560 Ohm in serial!)
and the transistor output to the in (Collector) and Gnd (Emitter) of the relay board.
Regards
Shardan
Regards
Shardan
Shardan
-
- New user
- Posts: 8
- Joined: 20 Jun 2017, 12:45
Re: ESPEASY 120 Relay will not low with Ultrasonic sensor
Danke Schon ....
-
- Normal user
- Posts: 1156
- Joined: 03 Sep 2016, 23:27
- Location: Bielefeld / Germany
Who is online
Users browsing this forum: Bing [Bot] and 9 guests