UPDATE: In addition to this post, there is also a more recent one titled “A Revisit of the PT2262 PT2272 with Arduino and r06a Receiver” If you find value in this post I believe that you will also like the newer post.
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.
There are several iterations of these chips sold under slightly varying names with PT2262/PT2272 and SC2262/SC2272 being the most common. The PT2262/PT2272 version is manufactured by Princeton Technology Corp. of Taipei , Taiwan, while the SC2262/SC2272 is manufactured by SilvanChip Electronics Tech.Co.,Ltd. of Shenzhen,China. Both are identical although the Princeton chips are more common and better documented.
There are several versions of these chips, identified by different suffixes, that pass through different amounts of data (2 to 6) or even no data at all, as well as latched or momentary data presentation. For example, the PT2272-L4 presents 4 bits of data passed from the PT2262 as latched data with a “VT” pin being a leading edge positive going strobe. The 4 data bits remain latched in their last state. On the other hand, the PT2272-M4 presents momentary data. The more data that is presented, the fewer address leads there are. Each address lead is tri-state – high, low or floating. With a maximum of 12 address leads a PT-2262 provides 531,441 unique device addresses (3^12). On the other hand, the commonly used PT2262-L4, with 4 data bits, only provides 6,561 (3^8) unique device addresses. Addressing is often implemented with solder pads but, occasionally with jumpers and rarely with tri-state dip switches – see images below.
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. The transmitter/receiver set that I am using are encoded (A7-toA0) FFLHHHLF and use 4.7MΩ (Xmit osc) 820k (Rx osc).
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, as this was written, 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.
Watch the test video on YouTube.
The source code is posted on PasteBin and may be freely downloaded for your use.
UPDATE: I recently came across another blog with an interesting article about a similar circuit that uses a different integrated circuit – the LP801B/LP802B