Posts: 4
Joined: Sun Mar 31, 2013 4:52 pm

Pi Light Switch

Sun Mar 31, 2013 5:01 pm

for my Google science fair project i am building a smart switch. it is a light switch that is based on a raspberry pi. the idea is that the raspberry pi will fit into the recess where a normal light switch fits and then connect to a touchscreen mounted over the top. the touch screen will be used to control the lights as
well as other services such as music streaming. the problem is though i have no idea how to control the lights with the raspberry pi

if anyone can help ill be extremely grateful thanks
p.p i cant use prebuilt systems as it has to be my work.

Posts: 71
Joined: Sat Dec 01, 2012 11:25 am
Location: Letchworth Garden City

Re: Pi Light Switch

Sun Mar 31, 2013 8:46 pm

First off I have to say if you are unsure of what you are doing, is this the right project? the pi and mains voltage connected incorrectly can result in making magic smoke, likewise connecting humans to mains voltage can produce "negative" results.

Given this is a project I don't think I should give you the answers, but the topic has been discussed on this site, a search may give you some clues. also check out their tutorials are great and may just help.

If you don't have any luck searching then post again, and someone will give you some more pointers.

Good luck!


User avatar
Posts: 951
Joined: Wed Dec 26, 2012 3:46 am

Re: Pi Light Switch

Sun Mar 31, 2013 8:51 pm

My help is that you should do it with a 12V or 5V light, and not use mains power.

If you don't know what you are doing, simply do not start experimenting with mains power, or you will probably die.

Posts: 4
Joined: Sun Mar 31, 2013 4:52 pm

Re: Pi Light Switch

Mon Apr 01, 2013 8:18 am

Oh lol no I'm not using mains power I'm using an old 6 v ikea lamp which Is run from battery's it just has to fit In the same space as a light switch as a proof of point. :lol:

Knowing me I would kill myself if I used mains power

Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: Pi Light Switch

Mon Apr 01, 2013 11:51 am

Nice and simple using a cheap Arduino relay board. You can use the Raspberry Pi to switch on/off using the GPIO pins.

Posts: 7
Joined: Mon Apr 01, 2013 11:33 am

Re: Pi Light Switch

Mon Apr 01, 2013 12:35 pm

This is my sort of project :) I originally planned on using my PI for something like this. The price point of the Pi does almost make it worth it compare the Arduino (which I have a few as well, big fan).

If you are doing a science fair thing, why not rather get a strip of RGB LEDs (don't even need to the expensive individually addressable ones), a few Mosfets and you could have your intelligent switch do some fancy colour stuff as well based on various incoming feeds, such as weather RSS feeds, door bell etc.

If you standardise on a 12v source which is safe, you can then get a 12v-5v DC converter (plenty of ebay, some modules even come with USB power adapters) to keep it neat.

Just a thought :P

Return to “Automation, sensing and robotics”