FraserL
Posts: 7
Joined: Tue May 28, 2013 1:18 pm

Control mains lighting with RF

Tue May 28, 2013 3:08 pm

Hi everyone!

So, I'm a complete noob to the world of Raspberry Pi, and, although I have been following lots of news about this exciting new technology, I still don't have a grasp of it.

I'd like to begin my journey into understanding the RPi with a project: controlling mains electricity. Now, I've seen a few videos on this, but all of them seem to use relays, huge breadboards, etc. I need my "device" to fit within a regular size light switch. I could be sounding bonkers to all you professionals out there, but would it be possible to create an executable program which sent a signal through an RF transmitter (connected to the RPi board on my desk) to a receiver (mounted in the light switch) which would toggle the switch and turn the lights on/off?

EDIT 1: I figured out one of the components I need is a SSR (solid state relay) so we can tick that off the list! Now all I need is the RF transmitters and code.
To give you guys some context, I do know basic Javascript, but no Python or C, so please try to explain this as if you were telling it to a 5 year old.

EDIT 2: More exciting developments! Talking to some other people and more research have lead me to believe that it would be best to buy a Lightwave RF socket and control it with a 433mhz transmitter attached to the Pi's GPIO. I've also took note of the tutorial here. Now, because I don't want to have to spend more money buying the Lightwave RF remote and an arduino and a breakout board, could someone point me to what to do next in order to get some coding running an get a file which could send a signal to the LWRF to turn on/off?

EDIT 3: For anyone who is following along (hard to believe seeing as only one person has even tried to help me so far) I stumbled upon this blog post, which helped greatly in how to gather the codes. Now I have a bunch of 1's and 0's, what next?

Thanks
- Fraser
Last edited by FraserL on Mon Jun 03, 2013 10:42 pm, edited 5 times in total.

Pielover
Posts: 1
Joined: Tue May 28, 2013 10:29 pm

Re: Control mains lighting with RF

Tue May 28, 2013 10:34 pm

You can communicate between your Transmitter and receiver by using a Whip antenna.
Although the frequency range isn't much (434MHZ), its a good way to start your project.

Now for the controlling of the appliance, in your case a light bulb for example. I think you would need to use relays to turn the device on and off. You would need to convert binary codes 0(means off) and 1(means on) into TTL logic so that your relay could understand the command.

Hope this helps.

PS- even I am working on this project. Will share my project once I start.

FraserL
Posts: 7
Joined: Tue May 28, 2013 1:18 pm

Re: Control mains lighting with RF

Tue May 28, 2013 11:06 pm

Pielover wrote:You can communicate between your Transmitter and receiver by using a Whip antenna.
Although the frequency range isn't much (434MHZ), its a good way to start your project.

Now for the controlling of the appliance, in your case a light bulb for example. I think you would need to use relays to turn the device on and off. You would need to convert binary codes 0(means off) and 1(means on) into TTL logic so that your relay could understand the command.

Hope this helps.

PS- even I am working on this project. Will share my project once I start.
Thanks! Nice to know someone else is working on the same thing! :D

So, after some more thinking, it would seem that if I could cram a whole RPi into the wall behind the light socket, I could simply wire one of the GPIOs to a SSR, which would then control the light switch. Of course, this is not the case. The RPi needs to be sitting on my desk, with some kind of transmitter connected to the GPIO and some kind of receiver connected to the SSR. Anyone got any bright ideas? (Get it? Light bulb reference? Ah...)

FraserL
Posts: 7
Joined: Tue May 28, 2013 1:18 pm

Re: Control mains lighting with RF

Mon Jun 03, 2013 5:07 pm

BUMP

ghans
Posts: 7873
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Control mains lighting with RF

Tue Jun 04, 2013 7:16 am

Perhaps this is useful :

http://www.skagmo.com/page.php?p=projects/22_pihat

WARNING : Its not my fault if the FCC or FBI or whatever come
after you ...


ghans

EDIT: Using a ready-made RF socket set may save your live from
dangerous mains wiring , comes much cheaper and prevents any
fines because you messed with RF without a license.

You can always wire the remote to the GPIO , saving you from
reverse-engineering.
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

FraserL
Posts: 7
Joined: Tue May 28, 2013 1:18 pm

Re: Control mains lighting with RF

Tue Jun 04, 2013 7:31 am

ghans wrote:Perhaps this is useful :

http://www.skagmo.com/page.php?p=projects/22_pihat

WARNING : Its not my fault if the FCC or FBI or whatever come
after you ...


ghans

EDIT: Using a ready-made RF socket set may save your live from
dangerous mains wiring , comes much cheaper and prevents any
fines because you messed with RF without a license.

You can always wire the remote to the GPIO , saving you from
reverse-engineering.
Yay, a reply!
Yeah, I saw the skagmo thing which kind of helped but it's slightly different than what I'm doing. And I plan to have multiple RFs on top, as well as maybe an IR transmitter (blaster?) to control my TV, so I'm trying to leave lots of space as I plan to have these on top of the case.

willz1200
Posts: 5
Joined: Sun Dec 02, 2012 3:33 pm

Re: Control mains lighting with RF

Mon Jul 08, 2013 6:45 pm

I am currently working on a project that controls relays, servos, leds, etc and can receive signals from sensors, I am using a raspberry pi to transmit signals over rf which are given by a webpage these are then received and processed by the atmega328 and then used to turn stuff on or off. I will release my source code once I have finished.

fuzail
Posts: 3
Joined: Mon Jul 08, 2013 10:28 pm

Re: Control mains lighting with RF

Tue Jul 09, 2013 9:32 am

what are you using for the wireless transmission williz ?


txt3rob
Posts: 365
Joined: Sat Aug 11, 2012 3:45 pm
Contact: Website

Re: Control mains lighting with RF

Thu Jul 11, 2013 11:42 am

im doing the same but have used an adruino to capture the 433 codes to make life easy.

have a look at RC-Switch it's been converted to the pi but might require wiring pi library but that has been updated so not sure if it works with the latest version
The Raspberry Pi Hell Guy - Random Ramblings to assist me and others.
http://raspberrypihell.blogspot.com
My Github - http:/www.github.com/random-robbie/
http://www.smspi.co.uk - send free uk sms via your raspberry pi from here

jfett619
Posts: 1
Joined: Thu Oct 25, 2012 9:22 pm

Re: Control mains lighting with RF

Thu Jul 25, 2013 12:35 am

Hi FraserL
Im currently working on this same project and was wondering have you managed to finish this project?

txt3rob
Posts: 365
Joined: Sat Aug 11, 2012 3:45 pm
Contact: Website

Re: Control mains lighting with RF

Sun Jul 28, 2013 7:29 pm

i've used pihat in the end and got things working now :D
The Raspberry Pi Hell Guy - Random Ramblings to assist me and others.
http://raspberrypihell.blogspot.com
My Github - http:/www.github.com/random-robbie/
http://www.smspi.co.uk - send free uk sms via your raspberry pi from here

dermotx
Posts: 11
Joined: Mon Dec 03, 2012 3:00 pm

Re: Control mains lighting with RF

Tue Jul 30, 2013 2:32 pm

You should have a look at http://shop.ciseco.co.uk/slice-of-radio ... pberry-pi/
which is a powerful transceiver which fits on to the raspberry pi. It costs £9.99.

It can be used with http://shop.ciseco.co.uk/xrf-relaybase- ... ching-kit/

These kits are great and have a good range and are easy to use. There is no complicated coding required.

I have no connection with this company. I just found their products easy to use for a beginner.

Good luck with your project and be careful with mains electricity.

Dermot

mongrol
Posts: 76
Joined: Wed Aug 01, 2012 2:43 am

Re: Control mains lighting with RF

Wed Jul 31, 2013 2:20 am

Also look at the www.ninjablocks.org forum. They have a Pi image of their client software and a guide to hook 433 up which a a rumuoured addon Ninja board of sorts coming soon. You can then use their cloud platform to setup rules and control things.s

txt3rob
Posts: 365
Joined: Sat Aug 11, 2012 3:45 pm
Contact: Website

Re: Control mains lighting with RF

Wed Jul 31, 2013 1:45 pm

i am using pi hat now for my setup and have made a simple webpage using jquery.

should be easy to control and have webcam showing like i have.
The Raspberry Pi Hell Guy - Random Ramblings to assist me and others.
http://raspberrypihell.blogspot.com
My Github - http:/www.github.com/random-robbie/
http://www.smspi.co.uk - send free uk sms via your raspberry pi from here

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Control mains lighting with RF

Thu Aug 01, 2013 6:01 am

Would be helpfull if there is a list of working remote controllers?

txt3rob
Posts: 365
Joined: Sat Aug 11, 2012 3:45 pm
Contact: Website

Re: Control mains lighting with RF

Fri Aug 02, 2013 1:54 pm

check pihat on git for the controllers
The Raspberry Pi Hell Guy - Random Ramblings to assist me and others.
http://raspberrypihell.blogspot.com
My Github - http:/www.github.com/random-robbie/
http://www.smspi.co.uk - send free uk sms via your raspberry pi from here

thienson30
Posts: 26
Joined: Mon Jul 08, 2013 7:53 am

Re: Control mains lighting with RF

Sat Nov 23, 2013 8:56 am

Here you can do more with RF transmitter. You can control garage, fan, gate, door entry, lock, sprinkler, car, etc . Here is a video
https://www.youtube.com/watch?v=KZ59sDgKqXE

You can goto http://CommandMe.net and click on SIMULATOR to try it out
Attachments
logo raspi-speech2txt with rc antenna.jpg
logo raspi-speech2txt with rc antenna.jpg (46.81 KiB) Viewed 6828 times

Return to “Automation, sensing and robotics”