Started 17th March 2022
I wanted a way of software turning off the power to my 3D printer. Ideally I would have liked something controlled by optical fibre which turned off the power if it stopped receiving pulses - no risk of mains power leaking back, fail safe operation. To be going on with I found 433 MHz remote control mains sockets. I don't think this is a good idea - prone to radio frequency interference, open to hacking. In fact this is the worst application of radio controlled sockets, something which when turned on is capable of doing damage. I would always use the mains switch on my printer as well, and power in the room it lives in is turned off when I am not present.
Anyway I bought a pack of three PEL00551 and one controller from CPC for around £16 including VAT. They are well made and work nicely. Probably they would be worth it for the components, three good 433 Mhz receivers and one transmitter.
The receiving unit consists of a capacitive dropper, a bridge rectifier, a big Zener diode marked L1, followed by a 78L05 voltage regulator. There's a relay for switching, a driver transistor with back EMF diode and a small micro-controller. The actual RF receiver is on its own PCB. The black object above the relay is marked on the PCB as a fuse.
The 8 pin micro-controller has pin 1 +5 V, pin 2 connected to unused pads for a switch, pin 3 output to relay driver transistor, pin 4 not connected, pin 5 LED, pin 6 data input, pin 7 not connected, pin 8 Gnd.
I fancied I would hack the protocol and be able to send out the codes to turn off a socket from an Arduino connected to a 433 MHz transmitter. Not as easy as I thought, fortunately a lot of people have been down this path and much information is available on the web.
The approach to take is to open the transmitter and read off the chip number (HS2260C R4), then look online for the relevant code/data sheet etc. I found  particularly useful.
In photo #2 the 'scope probes are in the best configuration to get at the transmitter on/off signal without a big voltage offset. Power to the radio transmitter is routed via the red LED. We are in the land of OOK - on off keying.
Given a time T (around 176 μs), and a signal with states High and Low, pulses are generated:
Short = High(T), Low(3*T)
Long = High(3*T), Low(T)
Sync = High(T), Low(31*T)
Short and Long are combined in pairs to give sequences:
Float = Short Long
One = Long Long
Zero = Short Short
Finally a number of Float, One, Zero and Sync pulses are combined into a packet which is repeated six times.
'scope screen shots are at 500 mV x 2 ms per division and show one packet for the respective button push.
Channel 1 On (FFF0FFFF0101S)
Channel 1 Off (FFF0FFFF0110S)
Channel 2 On (FFF0FFFF1001S)
Channel 2 Off (FFF0FFFF1010S)
Channel 3 On (FFF0FFF10001S)
Channel 3 Off (FFF0FFF10010S)
A complete set of packets for one button press at 500 mV x 10 ms per division.
All this is distilled in the Arduino program below. It is designed to be talked to via the serial port at 9600 bps. Arduino pin 5 is connected to the data input of a 433 MHz transmitter. There is one command:
s <unit> <state>
Where the unit is 1,2 or 3 and the state is 0 or 1.
- Help identifying encoding scheme for RF device
- Wireless power outlets for home automation using Arduino
- Reverse Engineering Remote Control Power Sockets - Part 1: Information gathering