Generic RF Tx for the HAH

Requires a CHIP upgrade to the 328 (all kits from the Shop now ship with this)

Historically, the RF handling in the HAH was limited to a single protocol type, chosen from those that were supported. This was an annoying limitation. Further, we held rather a lot of 'static' data on the micro to define the pattern of the bits that were sent.

We needed a generic approach to allow most any 433MHz RF device to be controlled. We might define a xAP message that completely specifies the format and characteristics of the RF stream that requires to be transmitted.

If we use a 'scope to see what the output from an RF transmitter looks like, we see something like this:

Notice that there are quite a few transitions in this 'burst' of data. A burst is typically associated with pressing a button on a transmitter device, or perhaps caused by walking in front of a PIR unit. This image shows a single burst. In practice, there will be multiple repeats of the same burst pattern with a carefully timed gap between each burst. It isn't unusual to see the same burst pattern repeated 10 (or more) times with the same 'inter burst gap' timing.

Now, look at the various pulses that makeup the bitstream. We define a 'pulse' as a 'hi', followed by a 'low'. A pulse always starts with a 'hi'. The duration of the high part of the pulse, together with the duration of the following low part of the pulse is the way that a single bit of information is encoded. Depending on the type of RF device, there might be a number of different pulse definitions.

Looking at the above image, we can see that there are three different patterns of pulses.

So, what do we need to be able to specify?

bitsperframe - A Frame is a PULSE sequence of HI/LO as defined by the pulsedef. Valid values 1,2,4

pulsedef - Hex string to define a HI/LO pulse definition. A Pulse requires two WORDS of information. These WORD's are the number of microseconds (uS) of HI followed by LO.

GUI extended so up to 32 different RF devices can be controlled. This is an arbitrary maximum there is no limit but I figure it will do for now until somebody asks for more. The RF Delay allows multiple RF units to be controlled (in a single action) from the web GUI. It inserts a delay, default of 500 milliseconds, before issuing each command.

Sample 2-bit encoding

We are going to define a protocol that needs 2 bits of information to define the pulse type, which means there will be 4 pulse types available.

Bits per Frame is 02 the first byte of the pulse definition. Next define the size of each PULSE index

Status branded remote controlled sockets

There is a single button on the front to the unit. Training is started by pressing and holding this button for a few seconds. The red LED will flash slowly. Then, send an 'On' command - the LED will blink rapidly, then go out. Subsequent On/Off commands will now be honoured. A quick touch of the button turns the socket On/Off.

Note that the burstcount of 12 is required to be used when 'training' the socket (training sometimes takes a couple of attempts). Thereafter, a burstcount of 4 to 6 will give solid operation.

Also note that whilst these units are relatively inexpensive, there is quite a nasty limitation on this type of device. If mains power is lost for more than about 30secs, the unit forgets its training and needs to be re-trained.

Pulse definition

Encoding

HI

LO

0

300

887

1

887

300

stream

Description

B956BF00

Unit ON

B956B700

Unit OFF

Up to 16 sockets can be supported by altering the hex digit '9' in the above sequence thru '0'..'9' and 'A' .. 'F'.

HomeEasy (advanced)

Devices tested include the HE109 and the HE302. The HE302 sockets are interesting in that they can be trained to respond to both the BBSB and the HE Advanced protocol. However, the HE109 twin sockets will only respond to this 'advanced' version of the protocol.

Re the message protocol itself. This always starts with a latch signal of 275uS hi and 2675uS low. Then a unique 'group code' which is 26bits long (each bit being two 'wire bits'). The last 4 bits are the device code … these can be altered to address upto 16 devices on the given group code.

LightwaveRF dimmable CFL bulb

Tested on a JSJSLW561BC unit.

Note that on this unit, you must pair the bulb with the HAH. See the user guide that comes with the bulb for pairing info. Entering the 'pairing' mode involves repeatedly switching power to the bulb off/on four times. You must perform the off/on switching very quickly for the mode to be entered.

The 'mood' facility is nice. You use the remote control to get the required brightness level on the bulb. Next, you hold down the mood button until the light flashes. Thereafter, you can xmit the mood string from the HAH to cause the bulb to goto the trained level.

From what I can make out the packet starts with a single 'start bit' followed by 10 'groups' of bits each having a 'start bit' and then ends with another 'bit', (see the diagram below).

With changing between remotes I think I've worked out which groups of bits are associated with what.
There appear to be 6 groups for the unique remote ID, 1 group for the remote function (on, off etc.), 1 group for the switch on the remote (device) and 2 groups for the dim level.

Each group of bits appears to have 16 states.

I haven't managed to work out what encoding is being used for the bit groups but with your URF this doesn't really matter as I can just convert the bit patterns .

N.B. These little nightlights have built in 'hysteresis' when responding to commands. You are advised not to try to change the state of these more than once a minute.

12V relay module and keyfob remote

This is small, inexpensive, RF controlled relay that is powered by an external 12VDC supply. Sold on eBay by long standing seller 'rfremotech'. I used the 'latching' type of unit.

Inter burst gap is 2.92mS
Frame is 25bits long
Burstcount is 12
0 is a short hi 0.11mS followed by a longer lo 0.32mS
1 is a long hi 0.32mS followed by a short lo 0.09mS
Pattern for red button is :
0101010101010101110000000
Pattern for grey button is
0101010101010101001100000