Control HE830S switches using only an Arduino and RF Module
Hello,
Has anyone on this forum managed to control the HE830S switches using just an Arduino and RF transmitter?
I have a set of the HE830S switches, controlled by an HE300 remote, which I picked up from B&Q. I would like to be able to control the switches using an Arduino Uno and and a 433MHz RF transmitter (link to the transmitter / receiver set I am using).
I know most people on this forum will be using the modified router to control their switches but after reading some of the forum pages on other people who have the HE830S switches, it seems like the members of this forum have a good degree of technical knowledge on the rf codes/transmission packet sequences used to control these devices.
What I have tried so far:
I have logged the output of the remote using the rcswitch library for the Arduino, plus used the receiver code on the Arduino Playground Home Easy page to establish my remote control code but I can't successfully transmit and control the HE830S switches using either the rcswitch send code or the Arduino Playground Home Easy transmit scripts. I know the rf transmitter and receiver pair are working as I can send information between them using the rcswitch code (and see the results on the Arduino serial monitor).
Unfortunately my understanding of the remote control's raw data captured by the rcswitch code is limited and I'm not sure how to convert it into a successful transmit package to control the HE830S switches. If anyone could provide any guidance or sample Arduino code I would be most grateful!
The micro on the HAH PCB runs a sketch that, amongst other things, implements a command that takes an ASCII encoded string of RF data (as detailed in the wiki) and pumps out the bits to the RF Tx module.
The command in question is 'URF'.
Read the sketch at
https://code.google.com/p/livebox-hah/source/browse/trunk/userapps/arduino/liveboxHAH/liveboxHAH.ino
This might help get you going.
Hi Gary,
Also to add to this, it probably doesnt need to be said but make sure the HE830S is in learning mode before you send a packet.
thanks
Andrew
You could try the URFRX module this is pretty useful for automatically figure it out for you.
Its similar to what you where using for getting RAW data.
With the added benefit that you can graph and SEE what this RF pulse stream looks like.
Brett
If you don't see the 'Starting...' prompt when running at 57600 baud, something is wrong. Check the xtal on your board ... if it's not (at least) 16MHz, you will probably struggle with this code.
Check http://www.wormfood.net/avrbaudcalc.php - this shows why we use a 7.3728MHz xtal on the HAH PCB.
The URFRX code needs at least a 10ms as the inter pulse gap before kicking it. Its possible that the gap is shorter which is defeating the detection logic. You could try reducing the gap in the code down to say 5ms. Do make sure you have wired correctly as well Digital PIN 4 is the data pin (by default).
http://livebox-hah.googlecode.com/svn/trunk/userapps/arduino/libraries/R...
Where is says 10000uS reduce to 5000uS
Brett
Some of the remotes send new and old pulse streams so they will work with a variety of receivers.
With a little bit of adjustment the pulse stream looks like this. I've just normalized the high values to be consistent so it will pack better.
-10272,176,-2656,176,-320,176,-1344,176,-336,176,-1344,176,-336,176,-1344,176,-336,176,-1344,176,-336,176,-1344,176,-336,176,-1344,176,-336,176,-1344,176,-320,192,-1344,176,-336,176,-1344,176,-320,176,-1344,176,-320,176,-1344,176,-1344,176,-336,192,-1344,176,-336,176,-336,176,-1344,176,-1344,176,-336,176,-336,176,-1344,176,-1344,176,-336,176,-1344,176,-368,176,-1344,176,-352,176,-1344,176,-352,176,-1344,176,-336,176,-336,176,-1344,176,-1344,176,-336,176,-1344,176,-336,176,-336,176,-1344,176,-336,176,-1344,176,-320,176,-1344,176,-1344,176,-352,176,-320,176,-1344,176,-320,176,-1344,176,-352,176,-1344,176,-1344,176,-336,176,-10016
If you then plug that into the "Pulse train to URF converter"
http://www.dbzoo.com/public/pulseTrainToURF.html
It nicely converts to a packed URF string. Replace the bustcount with 10, and the interburst delay to 10000us and repack and I would give that a go.
Brett
I think that the output from the rcswitch demo gives the raw timings for the code that has been received listed as Raw Data i.e:
Decimal: 11850401 (24Bit) Binary: 101101001101001010100001 Tri-State: not applicable PulseLength: 310 microseconds Protocol: 1
Raw data: 9644,912,336,284,956,908,336,896,344,280,960,900,344,280,976,272,960,900,344,896,352,268,972,888,352,268,980,272,972,880,360,256,1012,264,24,24,68,396,460,12,964,280,956,284,956,292,948,904,336,
Decimal: 11850406 (24Bit) Binary: 101101001101001010100110 Tri-State: not applicable PulseLength: 308 microseconds Protocol: 1
Raw data: 9584,920,316,300,940,912,328,908,328,292,948,908,332,288,948,300,944,912,324,912,336,284,952,912,332,288,960,292,956,900,336,288,964,892,340,280,964,896,336,280,944,296,936,912,328,908,332,284,944,
I think the basic idea is to get your arduino to emulate these and then "learn" them into the socket.
In it's simplest form that would be something like:
digitalWrite(txPin, HIGH);
delayMicroseconds(920);
digitalWrite(txPin, LOW);
delayMicroseconds(316);
digitalWrite(txPin, HIGH);
delayMicroseconds(300);
digitalWrite(txPin, LOW);
delayMicroseconds(940);
digitalWrite(txPin, HIGH);
delayMicroseconds(912);
etc
where your transmitter is connected to txPin.
I haven't actually done this though so I don't have any working examples.