arduino 433MHz web based tranceiver


edsard boelen, 16 mar 2011


controlling your house with relay cards and cabled networks is just not going to make it. I have some RF controlled switches connected to some lights and devices in my living room. It would be nice if I could send and recieve the data from that system. I bought an aurel receiver from conrad and connected it to an arduino board. with some help from the homeeasy project I could easily decode the data!


The hardware

I used the following items:

the protocol

The protocol that is used, is like that of the leaked domia energy manager protocol specification: There is no start sequence, or device negotiation, or ack. It just starts sending the data. Each bit takes 1.5 mS. The bits are being send as follows:
A 'zero' consists of 375uS high, 1125 uS low,
a 'one' consists of 1125uS high, 375uS low.


The data itself consists of 25 bits for the simple protocol, 64 for the advanced. I will only use the simple protocol.
The simple protocol sends all the 'odd' bits as 'zero' the 'even bits' sends 3 values:
Bit 2, 4, 6, 8. define the Sender ID
Bit 10,12,14,16 define the Receiver ID
Bit 18,20,22,24 define the Command

Step 1: receiving data

Receiving data is my first step, because I have a cheap brand system called flamingo, so I really don't know what the device sends. First I tested the receiver with just a LED connected to the output pin. It did light up when I pressed a button on the flamingo remote. After that I connected the Aurel receiver to PIN B0 (ardiono port 8). I connected an LCD screen to PIN D6 and D7 (arduino port 6,7). It could also be done with the serial port, or some leds, instead of the LCD. It is just to see what values are being send.
This is how it's connected:


The code:
Thankfully, the people from the homeeasy project have made a lot of progress, so I could use their code as an example. Saved me a lot of time.
The main loop does nothing, evertything is handled via the interupt.
receive_test.c c .pde
This is how it looks. notice the top right item, that is the transmitter, it is not connected yet, next to it in the alu housing is the receiver.


Here you see some data received by the transmitter

Step 2: sending data

Now that I know what values are being send by the remote, I can test the transmitter. The setup is even more simple. Just the arduino and the Aurel TX-SAW MID module. The code will send an ON command to device 12, waits 2 seconds and then send an OFF command and waits two seconds. That is in the main loop.
The actual sending is being done in the timer interrupt routine.
transmit_test.c c .pde

Step 3: web connection

The Ethernet shield allows you to make web based devices in minutes.
What the web connection has to do is, send rf commands via http requests. And if commands ore detected, send it to a pre-defined server.
At first it did not work properly, after some testing, I discovered that pins 11,12,13 are being used for the ethernet connection
Pins 8 and 9 are being used for the interrupt timer (COM1A registers control the behavior of OC1A).
To test if the webserver works, just open the ip adres in a browser, it should respond with 'rfhandler ready.'
If so, just add the code after the ip adres: ex. http://10.10.10.111/07-12-11. This would send command '11' to device '12'
ethernet.c

This is an image of the arduino with ethernet shield and on top of it a board with in front the receiver, and in the back the transmitter.


Step 4: server app

Unfortunately, the IPv6 protocol is not supported yet by the ethernet shield. The wiznet w5100 chip has a hardware ipv4 stack, bypassing that (if even possible) would mean that the ip has to be handled by the arduino itself, which is an entirely new project on its own.
to make it short, I will use my server as a bridge between the 2 networks.
It consists of some php code which relays the commands.

this is the final device, the red and black cables sticking out are antennae for send and receive, the two leds are for signaling send and receive.

Step 5: android app