Blog Archive

Tuesday 10 July 2012

RF signals, Audacity as an oscilloscope and Homeeasy remote sockets

figure a.
I have for some time wanted to properly control my Homeeasy remote controlled sockets from my PC.  In the past, I have tried to do it by using a parallel port, then a USB bit whacker to simulate presses on the remote unit by switching on relays.  This was never satisfactory as the soldering inside the remote was always messy and came undone and the remote really needed its own power supply.
Then I discovered that I could use the RF receiver in the configuration shown in this diagram (figure a.) to analyse the signal coming from the remote, then use an Arduino and an RF transmitter to reproduce that signal and control the remote sockets.   I spent a lot of time capturing signals, carefully measuring their length and working out how to retransmit them until I came to the point where I had Arduino code that could switch on and off two separate sets of remote codes, corresponding to two sets of on and off buttons on my remote control.  

I used the circuit (figure a.), taken from this blog post to "sniff" RF signals using Audacity on my Mac.  It basically means you can see what the RF signals look like without having to use an (expensive) oscilloscope. 

I was dead chuffed with what I had achieved and wanted to show off.  
Then I discovered this library (also to be found here) and found someone had already done all the hard work for me!  Never mind, I learned a lot in the process, including stuff about Manchester Code and other esoteric stuff.

The code I wrote is very simple and not at all "clever".  There are no fancy "for" loops or any "AND"ing of codes.  I consider myself to be a very amateur coder, particularly in C++, which is what the Arduino uses.  Here's the code I developed anyway:
[

]
Here is an example of the waveform produced in Audacity of the captured RF signals.  


What the RF signal looks like in Audacity.  This is actually the output from my central heating thermostat.



Whilst I was doing this I also "sniffed" the signals from my central heating thermostat which also transmits on the 433MHz range.  I might go ahead and produce a computer-controlled thermostat, just for a laugh. I was thinking of doing it using a Raspberry Pi instead of an Arduino.  That way the web server would all be built in and I could use PHP which I really understand.

Here is my assembled RF sound card "oscilloscope" :

"oscilloscope"



Here is my Arduino Leonardo, hooked up the RF transmitter.  

Arduino happily transmitting away.



And Finally, the obligatory YouTube video of it in action.  Terribly exciting.