Sorry guys, I was on vacation and just read your follow ups.
I confirm that the relay I am using has NPN and diode-led. Besides I have realized few of this wifi-switches (look at picture in my previous post) and they work just fine. Tested with hundreds of toggles so far with very stable ESP and relay behavior. Feel free to check the technical specs also. I cannot do it myself right now but I can confirm the simplest wifi-switch-on-earth just works
Maybe a video will prove that
https://www.dropbox.com/sc/b0j71za4j86m ... qB7VRUErxa
The picture show better the direct connection of ESP to relay with included pnp and led-diode.
https://www.dropbox.com/sc/0y8tk55ydwjo ... WU3-TWj3Qa
Power supply control
Re: Power supply control
Besides, I have realized a temp based on ESP and temperature sensor 1-wire DS18b20 and it works even better.
I am programming in LUA in NodeMCU and migrating to micropython. What you see is the web server built into ESP that accepts commands from browser (scales also on smartphones) to toogle the relay. Putting wifi switch and temp would be just merge the two applications. I am positive it will satisfy the requirements of this topic.
I will implement it in the next few days...
I am programming in LUA in NodeMCU and migrating to micropython. What you see is the web server built into ESP that accepts commands from browser (scales also on smartphones) to toogle the relay. Putting wifi switch and temp would be just merge the two applications. I am positive it will satisfy the requirements of this topic.
I will implement it in the next few days...
Re: RE: Re: Power supply control
Hello!ernitron wrote:Sorry guys, I was on vacation and just read your follow ups.
I confirm that the relay I am using has NPN and diode-led. Besides I have realized few of this wifi-switches (look at picture in my previous post) and they work just fine. Tested with hundreds of toggles so far with very stable ESP and relay behavior. Feel free to check the technical specs also. I cannot do it myself right now but I can confirm the simplest wifi-switch-on-earth just works
Maybe a video will prove that
https://www.dropbox.com/sc/b0j71za4j86m ... qB7VRUErxa
The picture show better the direct connection of ESP to relay with included pnp and led-diode.
https://www.dropbox.com/sc/0y8tk55ydwjo ... WU3-TWj3Qa
I do realise it is an old post, but I tried to do something similar finding something I don't quite understand.
Board and really are the same as the ones used in the example.
After I connected all the pins and rebooted the board, I create the pin object that I need to drive the relay.
As soon as I have created it, the relay is turned on and clicks. It stays closed even if I change its value to zero (Pin.low() or Pin.value(0)). I expected that give zero value to the pin would release the relay.
In other words it seems that the pin goes high once initializzated as an output and stays high no matter what value I give him.
Can someone explain me why is that?
Thanks!
Inviato dal mio Nexus 7 utilizzando Tapatalk
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Power supply control
I would disconnect the switch signal from the Pyboard and test the relay board: if you connect the relay board switch signal to V+ the LED and the relay should turn on. If you disconnect it or link it to Gnd the relay should be off. If this doesn't work there is something wrong with the relay board or its wiring.
If it passes this test it should work from a GPIO pin.
If it passes this test it should work from a GPIO pin.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: RE: Re: Power supply control
Hi, I don't know if you have already solved it.Lornioiz wrote:Hello!ernitron wrote:Sorry guys, I was on vacation and just read your follow ups.
I confirm that the relay I am using has NPN and diode-led. Besides I have realized few of this wifi-switches (look at picture in my previous post) and they work just fine. Tested with hundreds of toggles so far with very stable ESP and relay behavior. Feel free to check the technical specs also. I cannot do it myself right now but I can confirm the simplest wifi-switch-on-earth just works
Maybe a video will prove that
https://www.dropbox.com/sc/b0j71za4j86m ... qB7VRUErxa
The picture show better the direct connection of ESP to relay with included pnp and led-diode.
https://www.dropbox.com/sc/0y8tk55ydwjo ... WU3-TWj3Qa
I do realise it is an old post, but I tried to do something similar finding something I don't quite understand.
Board and really are the same as the ones used in the example.
After I connected all the pins and rebooted the board, I create the pin object that I need to drive the relay.
As soon as I have created it, the relay is turned on and clicks. It stays closed even if I change its value to zero (Pin.low() or Pin.value(0)). I expected that give zero value to the pin would release the relay.
In other words it seems that the pin goes high once initializzated as an output and stays high no matter what value I give him.
Can someone explain me why is that?
Thanks!
Inviato dal mio Nexus 7 utilizzando Tapatalk
Maybe you should look also at this post http://forum.micropython.org/viewtopic. ... 642#p15721
and all the replies in the thread.
I also have discovered that connecting the relay to some pin has the undesirable effect to switch it on before the software can make it low. So I decided to connect the relay to D5 or GPIO14 (Pin(14) and it doesn't change at startup.
Then changing to high and low works straightforward.
Hope this help.
Re: RE: Re: Power supply control
ernitron wrote:
Hi, I don't know if you have already solved it.
Maybe you should look also at this post http://forum.micropython.org/viewtopic. ... 642#p15721
and all the replies in the thread.
I also have discovered that connecting the relay to some pin has the undesirable effect to switch it on before the software can make it low. So I decided to connect the relay to D5 or GPIO14 (Pin(14) and it doesn't change at startup.
Then changing to high and low works straightforward.
Hope this help.
Thank you for your answer!
I just made it work, but i dont know why... I'll go explain:
I realized few hours ago that the relay works correctly with the 3.3v. It opens and closed correctly when I change the contorl pin status. So, it seems that the reason it was not working before was that I connected the relay with the vcc... but why?
I mean, as long as I don't initialize the pin nothing happen. Once I do (even with a low value) it clicks and there is no way to bring it back.
As I said, I blame my utter ignorance in electronics... seems like black magic to me
P.S. I was using D1 and D2 (gpio5 and 4).