-->
Page 1 of 2

Powering NodeMCU from 230V light

PostPosted: Wed May 17, 2017 5:25 pm
by Jan Kučera
Hello,
I want to create a WiFi controlled light switch with NodeMCU and a relay board. But the problem is, that NodeMCU usualy takes +- 90mA, so a battery is probably not a good choice. Is there any way to connect the NodeMCU to the power? (It is light on the ceiling - no sockets there) I thought of cutting the wires and connecting my old USB charger. Have someone tried it? Will it be legal in EU?

Thanks for all replies :)

Re: Powering NodeMCU from 230V light

PostPosted: Wed May 17, 2017 9:10 pm
by rudy
Will it be legal in EU?


I don't know what the laws are there. But I do no that the installation would never pass an electrical inspection. Does that mean it could not be done safely? No, it can be done safely but I don't know your capabilities and what you want to use to do it.

I don't have any issues as far as doing this kind of this. But I design this stuff for a living. :D

While it still wouldn't make you installation meet code requirements I think the safest thing for you to do is to buy an already made product, such as something like this.
https://www.itead.cc/sonoff-wifi-wireless-switch.html

https://www.itead.cc/wiki/Sonoff

https://www.aliexpress.com/item/New-Ite ... 86013.html

Image

Re: Powering NodeMCU from 230V light

PostPosted: Sat May 20, 2017 1:39 am
by taikapanu
That sonof looks nice!

And in general to installations. I wouldnt mess up the house wirings. If you rewire your own lamps that you would take with you anyway when moving, I would say it is OK. As long as you know what you are doing. 230 VAC is dangerous to play with.

Re: Powering NodeMCU from 230V light

PostPosted: Sat May 20, 2017 10:47 am
by trackerj
I've done a while ago, even before sonoff and other variants existed, my own MAINS Switch version for some specific appplications:
AC_MAINS_SW_16A_2.jpg

It has a proper rated OMRON 16A Latch Relay and yes, it takes care of the safety rules and regulations, it has MOV and FUSE, proper creepage and clearance distances, etc, etc.