crocket
Posts: 100
Joined: Thu Mar 07, 2019 12:38 pm

Can a power line provide Raspberry Pi and a lamp with power?

Wed Apr 17, 2019 4:06 am

I want to control a lamp with Raspberry Pi and a relay. However, I want a single power line to provide power for Raspberry Pi and the lamp.

How can I do that? In other words, I want to construct a WiFi lamp with Raspberry Pi, a relay, and a lamp.

Andyroo
Posts: 1967
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Can a power line provide Raspberry Pi and a lamp with power?

Wed Apr 17, 2019 11:10 am

Mains can kill and burn down your house if you do not know what you are doing - it is also illegal to be unqualified and alter things in lots of places and if you need to ask a basic question like this then I would recommended getting professional advice if you want to design the hardware :)

Safer to use one of these https://energenie4u.co.uk/catalogue/cat ... ccessories to do the work.

Plug an extension lead into the wall
Plug the Pi into one socket
Plug the switch box into another
Plug the lamp into the switch box and off you go

Lots cheaper than buying a new house :lol:
Need Pi spray - these things are breeding in my house...

User avatar
omegaman477
Posts: 80
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: Can a power line provide Raspberry Pi and a lamp with power?

Wed Apr 17, 2019 12:17 pm

crocket wrote:
Wed Apr 17, 2019 4:06 am
I want to control a lamp with Raspberry Pi and a relay. However, I want a single power line to provide power for Raspberry Pi and the lamp.

How can I do that? In other words, I want to construct a WiFi lamp with Raspberry Pi, a relay, and a lamp.
If this is a table lamp and you have access to both the UNSWITCHED active and neutral wires, then you can splice in a small power supply to supply the RPI. The RPI relay then switches downstream of the power supply mains input. As said by others, make sure its an appropriate power supply and the mains wiring is done safely and correctly.

If its a built in ceiling light and wall switch then it gets complicated. Often (but not always) the wall switch just has the active wire and no neutral wire. In these situations its impossible to feed a standard power supply with running a neutral wire to the wall switch location. The neutral wire is found at the light socket, but to save cost, its rarely run down the wall to the switch.

Parasitic power supplies and HA smart wall switches are emerging, that will operate on just the active wire. But building one is a very complex task.

Consider using a WiFi or Phillips Hue style smart Bulb, and talking to it from the RPI directly or via IFTTT.
..the only thing worse than a stupid question is a question not asked.

crocket
Posts: 100
Joined: Thu Mar 07, 2019 12:38 pm

Re: Can a power line provide Raspberry Pi and a lamp with power?

Wed Apr 17, 2019 3:39 pm

"European Remote Controlled Sockets with Pi-mote" seems interesting. Is there a WiFi bulb that's not locked to a specific vendor software?

PhatFil
Posts: 1033
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Can a power line provide Raspberry Pi and a lamp with power?

Wed Apr 17, 2019 4:47 pm

Most 'smart' devices based on esp8265/6 wifi socs can with varying ease be reflashed with alternative firmware. Tasmota being a Very popular and fully featured option. - smart sockets advertised for use with an app called "smart Life" or "BrandName-Life" can CURRENTLY, be reflashed OTA without any physical mods or opening of cases.. (Google "Tuya-Convert" for the github repo and utubes detailing the process..)

so spend a fraction of the cost of a 240v ac safe Pi case psu grommets etc needed to make your oringinal proposal safe on 1 x smart socket.
reflash it, host a mqtt broker on your pi and then use any mqtt interface for easy control, use node-red and the alexa-local node for hassle free local alexa control etc..


https://github.com/arendst/Sonoff-Tasmota/wiki

https://github.com/arendst/Sonoff-Tasmota/wiki/Tuya-OTA

crocket
Posts: 100
Joined: Thu Mar 07, 2019 12:38 pm

Re: Can a power line provide Raspberry Pi and a lamp with power?

Thu Apr 18, 2019 1:38 am

PhatFil wrote:
Wed Apr 17, 2019 4:47 pm
Most 'smart' devices based on esp8265/6 wifi socs can with varying ease be reflashed with alternative firmware. Tasmota being a Very popular and fully featured option. - smart sockets advertised for use with an app called "smart Life" or "BrandName-Life" can CURRENTLY, be reflashed OTA without any physical mods or opening of cases.. (Google "Tuya-Convert" for the github repo and utubes detailing the process..)

so spend a fraction of the cost of a 240v ac safe Pi case psu grommets etc needed to make your oringinal proposal safe on 1 x smart socket.
reflash it, host a mqtt broker on your pi and then use any mqtt interface for easy control, use node-red and the alexa-local node for hassle free local alexa control etc..


https://github.com/arendst/Sonoff-Tasmota/wiki

https://github.com/arendst/Sonoff-Tasmota/wiki/Tuya-OTA
I do not want to reflash a device. Is there a WiFi bulb that I can control without a special vendor software and without reflashing?

PhatFil
Posts: 1033
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Can a power line provide Raspberry Pi and a lamp with power?

Thu Apr 18, 2019 5:59 am

crocket wrote:
Thu Apr 18, 2019 1:38 am
I do not want to reflash a device. Is there a WiFi bulb that I can control without a special vendor software and without reflashing?
not as far as i am aware..

you can ebay a very basic and blank esp8266-01 controlled relay module that you can program yourself
Image
https://www.ebay.co.uk/itm/ESP8266-5V-W ... 5b8d0425fa

using the arduino ide, platform-i0/atom, or visual code etc.. But there is a lot more work involved doing that.


whats your aversion to reflashing? it takes about an hour waiting for downloads and etcher to write an sd card and seting up a virgin raspbian system sd card with the software. most of which is sat supping tea or coffee waiting. but once done its a 5 minute job running a cli script
And once you have invested in one device, flashed it, played with it for 5 minutes, its VERY probable you will concieve of many more uses for devices and start collecting them,, hehe

https://youtu.be/MxiPRBd5HEg


Return to “Automation, sensing and robotics”