[Fixed!] Strange relay behaviour, not switching on/off on GPIO 0/1 command.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#11 Post by Shardan » 31 May 2017, 20:09

Alternatively you can use a small NPN transistor (2N2222 or similiar) or FET (2N7000 or similiar) between "In1" and ground.
Then you may drive the LED with 5 V too from the relay's voltage (Jumper Vcc -JDVcc closed).

Regards
Shardan
Regards
Shardan

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#12 Post by DeNB3rt » 13 Jun 2017, 10:38

Hi Shardan and Costo

Thanks for the feedback.
I did not have a lot of time the last day's do I did not see that feedback.

So yesterday, I tried to sort some things out...
I thought, why not replacing the relay board with a spare board just to test?

Left side new board, right side old board. (here you can see my board version)
That setup seems to do what it should.
Image

So I had to shut of the mains to replace the AC~ cables to the new relay.
After doing so and turning on the power again, the nodemcu/espeasy board did not came online again.
Weird, I did a few restarts and checked dhcp, no other ip...
Connected with usb cable to serial monitor and I saw some unreadable chars... :shock:
switched baud rate from 1152000 to all other options and found out that 74880 was showing one line

Code: Select all

  ets Jan  8 2013,rst cause:2, boot mode:(3,6)
I thought, fuck it, I'll replace it with another nodemcu on my breadboard (it was becoming darker outdoors and my wife was becoming angry that the lights did not work :twisted: ).
flashed the latest espseasy and reconfigured it, working!

So for now, all stuff is running again like it should :) I'll monitor the behaviour and I keep you guy's updated :) Thankss!
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#13 Post by DeNB3rt » 23 Jun 2017, 10:26

Dammit, setup was working perfectly for about 2 weeks (controlling my living and kitchen lights with domoticz app, web interface and MQTT button on another esp :) )
But since yesterday, again a similar problem like before.
The relay was not reacting anymore on any command.
But the leds on the opto do enlight/shutoff when I make gpio 1/0.
It looks like the coil does not get enough power to get triggered.

I make it more weird, I cut off the power to the relay board, restarted the ESP and connected the relay back like before (vcc 5v).
Everything is working fine again now? :|
PSU do deliver 5v 2a max.
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#14 Post by papperone » 23 Jun 2017, 10:48

May I ask you which type of PSu are you using?
In a friend of mine setup he had similar issue despite the "beefy" PSU (1.5A) but at the end the final solution was to replace it for another one!
I provided him a 700mA PSU which I normally use for all my project (HLK-PM01) mounted on a small PCB with varistor in parallel to the AC input and fuse on the Live line and since then (more than 2 months) no more problem!
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#15 Post by DeNB3rt » 29 Jun 2017, 10:01

Hi Paperpone

I'm using a 230~ 5V- smartphone charger.
I already tested with an iphone or samsung charger, but same shit :oops:

The weird thing now, is that I am not able to trigger both coil's at the same time, crasy shit :D
If I trigger both coils, the first triggered coil will enable, the 2nd will stay off (but optical led will enlight).
When I shutoff the first coil, the second will enable.
if I do the inverse, the 2nd will trigger.
So the behavior is predictable.

I will try to use two boards with only one relay per board to see what happens.
It's time to buy Eltako's I think :lol:
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#16 Post by toffel969 » 30 Jun 2017, 12:15

DeNB3rt wrote: 29 Jun 2017, 10:01 Hi Paperpone

I'm using a 230~ 5V- smartphone charger.
I already tested with an iphone or samsung charger, but same shit :oops:

The weird thing now, is that I am not able to trigger both coil's at the same time, crasy shit :D
If I trigger both coils, the first triggered coil will enable, the 2nd will stay off (but optical led will enlight).
When I shutoff the first coil, the second will enable.
if I do the inverse, the 2nd will trigger.
So the behavior is predictable.

I will try to use two boards with only one relay per board to see what happens.
It's time to buy Eltako's I think :lol:
For switching AC I can really recommend the SSR-Relays from Pollin http://www.pollin.de/shop/dt/NjYzOTU2OT ... 80_V_.html. They switch reliably with the current that the ESP GPIOs can sink and will not stick/ have mechanical units. Due to reliability issues (and therefore an angry wife), I swapped many of the electromagnetic relays for SSR. Beware they can only switch AC
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

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

Re: Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#17 Post by grovkillen » 30 Jun 2017, 13:31

Great pointer Toffel!
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:

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: [Fixed!] Strange relay behaviour, not switching on/off on GPIO 0/1 command.

#18 Post by DeNB3rt » 10 Jul 2017, 22:20

And it's fixed!
Don't hit me, le dumb me found the easy fix :roll: ...
I experimented with breadboards with external PSU and everything worked fine in test.
But in my wall switch setup, I was using an 5v 2Amps usb power supply.
Never thought that could be the issue, but there must be a power regulator or something like that on my nodeMCU board.
So I was draining power from the 5V pin on the nodeMCU board, thinking I was taking direct psu power....
That caused the strange behaviour.
After giving 5v power directly to the relay board, everything was working fine (stupid me) :roll:

See youtube illustration before/after:
https://www.youtube.com/watch?v=K6xgu1o1jh0
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

Post Reply

Who is online

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