$8 Lamp (Outlet) "Smart Plug" Module
-
Hi All,
I created a second "Smart Plug" and thought I'd make a how to video this time. I have found them very useful for controlling various devices around the house. It's long but hopefully will be good for everyone including those not too familiar with MySensors. I know when I was first starting out I had little to no experience with any of this stuff and it was hard to piece it all together.
Here is the parts list (most of this stuff can be obtained from the my sensors store so don't forget to support them!)
- 1 Gang Outlet Box
- Outlet
- Computer power cord or extension cord
- Old cell phone charger or some other 5v power supply
- Items from MySensors Store http://www.mysensors.org/store/
- 22-24 gauge wire or similar (network cord)
- Female Pin Header Connector Strip
- Prototype Universal Printed Circuit Board
- NRF24L01 Radio
- Arduino Pro Mini
- Capacitors (10uf and .1uf)
- 3.3v voltage regulator
- Female Dupont cables
Here is a wiring diagram for the 3.3v regulator:


Here is the code I used. I made a few customizations but the example "Relay Actuator" code can be used as well.
https://codebender.cc/sketch:72358*edited to add wiring diagram
-
Hi All,
I created a second "Smart Plug" and thought I'd make a how to video this time. I have found them very useful for controlling various devices around the house. It's long but hopefully will be good for everyone including those not too familiar with MySensors. I know when I was first starting out I had little to no experience with any of this stuff and it was hard to piece it all together.
Here is the parts list (most of this stuff can be obtained from the my sensors store so don't forget to support them!)
- 1 Gang Outlet Box
- Outlet
- Computer power cord or extension cord
- Old cell phone charger or some other 5v power supply
- Items from MySensors Store http://www.mysensors.org/store/
- 22-24 gauge wire or similar (network cord)
- Female Pin Header Connector Strip
- Prototype Universal Printed Circuit Board
- NRF24L01 Radio
- Arduino Pro Mini
- Capacitors (10uf and .1uf)
- 3.3v voltage regulator
- Female Dupont cables
Here is a wiring diagram for the 3.3v regulator:


Here is the code I used. I made a few customizations but the example "Relay Actuator" code can be used as well.
https://codebender.cc/sketch:72358*edited to add wiring diagram
-
Very nice video! Thanks!
-
Thanks for sharing your video! I just finished watching it and I feel like I just learned more in that time than I have in months! If you can't tell, I am a bit of a visual learner :-) It was really helpful to be able to watch the whole project come together from beginning to end.
-
Thanks for sharing your video! I just finished watching it and I feel like I just learned more in that time than I have in months! If you can't tell, I am a bit of a visual learner :-) It was really helpful to be able to watch the whole project come together from beginning to end.
-
@Francois great question! To be honest, it's on the list but not very high. I have a few other projects I wanted to do and hopefully create videos for.
@hek Thanks! You have created something awesome and I am excited to give back just a little when I can. Thanks for all you've done (and continue to do)!!
-
Nice project.
I will build some plugs myself, but I would like to exclude the charger, we should be able to power the arduino directly from the ac plug.
I am thinking to use something like this
https://www.elfa.se/elfa3~tr_en/elfa/init.do?item=69-065-19&toc=19413
What do you think about it?
-
Nice project.
I will build some plugs myself, but I would like to exclude the charger, we should be able to power the arduino directly from the ac plug.
I am thinking to use something like this
https://www.elfa.se/elfa3~tr_en/elfa/init.do?item=69-065-19&toc=19413
What do you think about it?
@johnr said:
Nice project.
I will build some plugs myself, but I would like to exclude the charger, we should be able to power the arduino directly from the ac plug.
I am thinking to use something like this
https://www.elfa.se/elfa3~tr_en/elfa/init.do?item=69-065-19&toc=19413
What do you think about it?
That looks like an "charger" just in another package :) in my opinion it's a bit over the top, with a 10W power supply, to a device that uses arround 0,5W (0.1mA @ 5V) in peaks.
/ Thomas
-
Hi,
Sorry I Think I expressed myself to short and incorrect on my way to work.
I really like this Project. My personal problem is that when you have many sensors, sooner or later you run out of old chargers ;)
Therefore for the relay (wallplug) it would be nice to find a small ac/dc power supply, which is easy to integrate into the breadboard/pcb.
The Meanwell that I linked to i also availible in 5w, but personally I had some problems in the past, with the current consumption of the relays, using sub wall-warts. This is why I am thinking 10w.
Mean well have nice quality but pricing is quite high. Would be nice to find an alternative with enough quality that you can trust that it wont burst into flames.
Edit: Mybe this tread is the correct one to discuss ac/dc converters. http://forum.mysensors.org/topic/687/230v-power-supply-to-arduino
-
Hi,
Sorry I Think I expressed myself to short and incorrect on my way to work.
I really like this Project. My personal problem is that when you have many sensors, sooner or later you run out of old chargers ;)
Therefore for the relay (wallplug) it would be nice to find a small ac/dc power supply, which is easy to integrate into the breadboard/pcb.
The Meanwell that I linked to i also availible in 5w, but personally I had some problems in the past, with the current consumption of the relays, using sub wall-warts. This is why I am thinking 10w.
Mean well have nice quality but pricing is quite high. Would be nice to find an alternative with enough quality that you can trust that it wont burst into flames.
Edit: Mybe this tread is the correct one to discuss ac/dc converters. http://forum.mysensors.org/topic/687/230v-power-supply-to-arduino
-
servicexp, no I guess it have only over current protection.
I am going to test a smaller 5w converter. MW irm-05-5 which I was able to get for a ok price through work. It has also smaller physical dimensions.
@johnr said:
servicexp, no I guess it have only over current protection.
I am going to test a smaller 5w converter. MW irm-05-5 which I was able to get for a ok price through work. It has also smaller physical dimensions.
Nice, let us know how it works! I also find I run out of chargers. Thankfully I can get them from work occasionally when people recycle their old phone chargers.
-
@johnr said:
servicexp, no I guess it have only over current protection.
I am going to test a smaller 5w converter. MW irm-05-5 which I was able to get for a ok price through work. It has also smaller physical dimensions.
Nice, let us know how it works! I also find I run out of chargers. Thankfully I can get them from work occasionally when people recycle their old phone chargers.
Or hotel lost and found...
-
@BulldogLowell yeah, good idea! I wonder if electronics stores may have them too. I know Best Buy has a electronics recycling program. Maybe they get them there too? I just got a fresh supply from work so I should be good for a little while :)