There is an interesting pair of complementary Integrated Circuits, PT2262/PT2272 that make basic wireless remote control rather easy to implement. They are commonly used in inexpensive wireless devices to control garage doors, fans, toys and even some alarm systems. These ICs utilize fixed address codes and no inherent encryption so they are not high security devices but are maybe about as secure as the average home’s inexpensive door lock.
In addition to the addresses there is a resistor in both the 2262 and 2272 that controls an internal oscillator that controls the pulse width of the amplitude modulation and these resistors must be set to complementary values (listed in Princeton’s documentation). For example, if the 2262 uses a 4.7MΩ resistor, then the mating 2272 must use a 820kΩ resistor. The three most commonly used values are 1.5, 3.3 and 4.7M.
The title of this post indicates an Arduino compatible solution that uses this integrated circuit. I recently purchased an inexpensive, Chinese-made 433MHz super-regenerative receiver that utilizes an SC2272-T4, shown in Figure 3, below, which comes with a mated key-chain fob encoder control, shown in Figure 4, below. This set cost me $7US. The Chinese domestic retail price for the receiver is 9 Yuan (about $1.42) and the keyfob is 10 Yuan (about $1.57). The SC2272-T4 is a toggle version of the 2272 that toggles its data outputs rather than presenting the state of the 2262 data bits. Only SilvanChip makes the toggle version of the 2272. This same R06A is also available with the momentary (M) or latched (L) versions yet, ironically, the board designation of R06A remains the same. The schematic of a 315MHz version of this receiver/decoder is shown in Figure 6, below. Amazingly, Alibaba.com indicates that the typical price for the R06A receiver module is only 75 to 80 cents each in quantity 300 lots.
This particular keychain fob uses a PT2264 instead of a PT2262 but they are functionally equivalent. See Figure 5, below.
The PT2262 encoder sends out a serial string with a sync pulse and then data represented by pulse-width modulation, repeated four times. The PT2272 must match the addresses in two pulse trains to its own address, to accept. One bit is represented by 32 clock cycles. Refer to Figure 7, below to see the pulse widths that represent each value. During the 32 clock cycles two short duration pulses high represent a data bit “0″, two long duration high pulses represent a data bit “1″ and one short short duration pulse high followed by one short long duration pulse high represent a floating bit, “F”. Note that the “F” bit is only used in address bits. The leading sync pulse is 4 cycles high followed by low 124 cycles, for a total of 128 cycles. Thus, one individual twelve bit packet is 512 clock cycles long and the 2262 IC sends four repeats. One clock cycle is typically about 300 to 500 microseconds (~451 with my fob). The bit arrival sequence is A0, A1, A2, A3, A4, A5, A6, A7, D3, D2, D1, D0, SYNC.
If you would like to read some C source code that simulates all of this, take a look at the RC-SWITCH project. I compiled the test code “ReceiveDemo_Advanced.pde” and set up the breadboard with the simple ZABR1-1 433MHz receiver shown in Figure 10. When I press the keychain-fob’s “A” key, the output is:
Decimal: 5227968 (24Bit) Binary: 010011111100010111000000 Tri-State: F01110FF1000 PulseLength: 451 microseconds Protocol: 1 (plus the raw data)
When I paste the raw data into Sui’s RC-SWITCH visualization tool at http://test.sui.li/oszi/ the waveform in Figure 7A is the result. If you decode it you’ll see that it matches “F01110FF1000″. Pressing the “B” key yields “F01110FF0100″, the “C” key “F01110FF0010″ and the “D” key “F01110FF0001″. You can clearly see that the least significant digits are the data field with the “D” key being the least significant. The address field is “F01110FF” which, if you’ll refer back to Figure 5 and look at the solder pads on the right-side image, you’ll see that the solder address encoding is, in fact, ”F01110FF”. Note: remember that the solder pads are backwards – right to left – from the received address ”F01110FF”.
Bertrik Sikken’ web page entry, 433 MHz projects, shows a captured waveform of a 2262 transmission with its 4 repeats. See Figure 8, below.
I wrote a short test program for the R06A SC2272-T4 receiver and associated AK-TF04 keychain FOB using an Arduino NANO. The physical test arrangement is shown in Figure 9, below. A YouTube video of my test is at the link below. Note that the video was made using an earlier version of my test code that didn’t use interrupts. In my newer, interrupt driven version, shown below, the VT pin is not polled and displayed because it is, instead, used as the interrupt trigger for a rising edge external interrupt.