Power supply control

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
User avatar
ernitron
Posts: 84
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: Power supply control

Postby ernitron » Thu Aug 04, 2016 8:35 pm

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

User avatar
ernitron
Posts: 84
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: Power supply control

Postby ernitron » Thu Aug 04, 2016 9:08 pm

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...

Lornioiz
Posts: 34
Joined: Wed Aug 03, 2016 11:39 am
Location: Florence, Italy

Re: RE: Re: Power supply control

Postby Lornioiz » Wed Dec 14, 2016 10:56 pm

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

Hello!
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

User avatar
pythoncoder
Posts: 1436
Joined: Fri Jul 18, 2014 8:01 am

Re: Power supply control

Postby pythoncoder » Thu Dec 15, 2016 10:32 am

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.
Peter Hinch

User avatar
ernitron
Posts: 84
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: RE: Re: Power supply control

Postby ernitron » Fri Dec 16, 2016 11:42 am

Lornioiz wrote:
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

Hello!
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


Hi, I don't know if you have already solved it.

Maybe you should look also at this post viewtopic.php?f=16&t=2642#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.

Lornioiz
Posts: 34
Joined: Wed Aug 03, 2016 11:39 am
Location: Florence, Italy

Re: RE: Re: Power supply control

Postby Lornioiz » Fri Dec 16, 2016 1:32 pm

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 :lol:

P.S. I was using D1 and D2 (gpio5 and 4).


Return to “Drivers for External Components”

Who is online

Users browsing this forum: No registered users and 1 guest