[Diao Ye learns programming] Arduino hands-on (155) --- 2262/2272 four-button wireless remote control kit module

The reference to 37 sensors and actuators has been widely circulated on the Internet. In fact, there must be more than 37 sensor modules compatible with Arduino. In view of the fact that I have accumulated some sensor and actuator modules on hand, according to the concept of practice to get true knowledge (must be done), for the purpose of learning and communication, I am going to try a series of experiments one by one, regardless of success (the program goes through) or not, They will be recorded - small progress or unsolvable problems, hoping to inspire others.

[Arduino] 168 kinds of sensor module series experiments (data code + simulation programming + graphic programming)
Experiment 155: 2262/2272 four-way wireless remote control kit M4 non-locking receiving board four-button wireless remote control transmitting module

insert image description here
Knowledge points: PT2262/2272 chip

It is a low-cost general-purpose circuit manufactured by Taiwan Pucheng Company. PT2262/2272 can have up to 12-bit (A0-A11) tri-state address pins (suspended, connected to high level, connected to low level ), any combination can provide 531441 address code, PT2262 can have up to 6 bits (D0-D5) data terminal pins, the set address code and data code are serially output from 17 pins, which can be used for wireless remote control transmitter circuit. The encoding signal sent by the encoding chip PT2262 is composed of: address code, data code, and synchronization code to form a complete code word. After the decoding chip PT2272 receives the signal, the address code is compared and checked twice, and the VT pin outputs a high level. At the same time, the corresponding data pin also outputs a high level. If the sender keeps pressing the button, the encoding chip will also transmit continuously. When no button is pressed on the transmitter, PT2262 is not connected, and its 17th pin is low level, so the 315MHz high-frequency transmitting circuit does not work. When a button is pressed, PT2262 is powered on, and its 17th pin outputs For the modulated serial data signal, when the 17 pin is high level, the 315MHz high-frequency transmitting circuit starts to vibrate and transmits a high-frequency signal of equal amplitude. When the 17 pin is low, the 315MHz high-frequency transmitting circuit stops oscillating, so the high frequency The transmitting circuit is completely controlled by the digital signal output by pin 17 of PT2262, so as to complete the amplitude keying (ASK modulation) of the high-frequency circuit, which is equivalent to 100% amplitude modulation.

insert image description here
insert image description here
PT2262 Features

1. Manufactured by CMOS process, low

2. Few external components

3. RC oscillator resistor

4. Wide working voltage range: 2.6-15v

5. Data up to 6 bits

6. Address codes can be up to 531441 kinds

Application range

1. Vehicle anti-theft system

2. Home anti-theft system

3. Remote control toys

4. Remote control of other electrical appliances

insert image description here
insert image description here
PT2262 pin description
A0-A111-8, 10-13 address pins, used for address coding, can be set to "0", "1", "f" (floating),
D0-D57-8, 10-13 Data input terminal, one of which is "1" means that code is sent out, the internal pull-down
Vcc18 power supply positive terminal (+)
Vss9 power supply negative terminal (-)
TE14 code start terminal, used for multi-data code transmission, active low;
OSC116 Oscillating resistance input terminal, and the resistance connected to OSC2 determines the oscillation frequency;
OSC215 oscillating resistance oscillator output terminal;
Dout17 coding output terminal (normally low level)

insert image description here
insert image description here
The encoding signal sent by the encoding chip PT2262

A complete code word is composed of address code, data code and synchronization code. After the decoding chip PT2272 receives the signal, the address code is compared and checked twice, and the VT pin outputs a high level. At the same time, the corresponding data pin It also outputs high level. If the sender keeps pressing the button, the encoding chip will also transmit continuously.

When no button is pressed on the transmitter, PT2262 is not powered on, and its 17th pin is low level, so the 315MHz high-frequency transmitting circuit does not work. When a button is pressed, PT2262 is powered on, and its 17th pin outputs For the modulated serial data signal, when the 17-pin is high-level, the 315MHz high-frequency transmitting circuit starts to oscillate and transmits a high-frequency signal of equal amplitude, and when the 17-pin is low-level, the 315MHz high-frequency transmitting circuit stops oscillating, so the high-frequency The frequency transmitting circuit is fully controlled by the digital signal output by the 17-pin of PT2262, so as to complete the amplitude keying (ASK modulation) of the high-frequency circuit, which is equivalent to 100% amplitude modulation.

PT2262/2272 can have up to 12-bit (A0-A11) tri-state address pins (suspended, connected to high level, connected to low level), any combination can provide 531441 address code, PT2262 can have up to 6 bits (D0- D5) The data terminal pin, the set address code and data code are serially output from pin 17, which can be used in the wireless remote control transmitter circuit.

insert image description here

PT2262 application circuit
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
knowledge points: PT2272 (SC2272) chip

It is a chip for decoding. The encoding signal sent by the encoding chip PT2262 is composed of address code, data code and synchronization code to form a complete code word. After the decoding chip PT2272 receives the signal, its address code is compared and checked twice. , the VT pin outputs a high level, and at the same time the corresponding data pin also outputs a high level. If the transmitter keeps pressing the button, the encoding chip will also transmit continuously. When no button is pressed on the transmitter, PT2262 is not powered on, and its 17th pin is low level, so the 315MHz high-frequency transmitting circuit does not work. When a button is pressed, PT2262 is powered on, and its 17th pin outputs For the modulated serial data signal, when the 17-pin is high-level, the 315MHz high-frequency transmitting circuit starts to oscillate and transmits a high-frequency signal of equal amplitude, and when the 17-pin is low-level, the 315MHz high-frequency transmitting circuit stops oscillating, so the high-frequency The frequency transmitting circuit is fully controlled by the digital signal output by the 17 pin of PT2262, so as to complete the amplitude keying (ASK modulation) of the high frequency circuit, which is equivalent to the amplitude modulation with a modulation degree of 100%.

insert image description here
PT2272 (SC2272) pin description

A0-A11 1-8, 10-13 Address pins, used for address encoding, can be set to "0", "1", "f" (floating), must be consistent with 2262, otherwise no decoding

D0-D5 7-8, 10-13 address or data pin, when used as a data pin, only when the address code is consistent with 2262, the data pin can output the high level corresponding to the 2262 data terminal, otherwise the output is low Level, the latch type can only be converted when the next data is received

Vcc 18 Positive power supply (+)

Vss 9 Negative terminal of power supply (-)

DIN 14 data signal input, output from receiving module

OSC1 16 Oscillation resistance input terminal, the resistance connected with OSC2 determines the oscillation frequency

OSC2 15 Oscillation resistor oscillator output terminal

VT 17 Decoding valid confirmation output (normally low) decoding valid becomes high level (transient)

insert image description here
PT2272 application circuit

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
2262/2272 four-button wireless remote control kit module

remote control

Working voltage: DC12V (one 27A/12V battery)

Working current: 10mA@12V

Radiation power: 10mw@12V

Modulation method: ASK (amplitude modulation)

Transmission frequency: 315 or 433.92MHZ (sound meter frequency stabilization)

Transmission distance: 50-100M (in open space, the sensitivity of the receiving device is negative 100dbm)

Encoder type: fixed code

Receiver board with decoding

The working voltage is DC5V, and the receiving sensitivity is -98db. There are 7 pins, namely VT, D3, D2, D1, D0, +5V, GND. VT is a valid signal high-level output pin. Once a valid signal is received, this pin outputs a high level and can also drive a relay.

Dimensions: 6.6 22 41mm

insert image description here
Wireless encoding module (remote control) based on PT2262

The coding transmitter module has a small and beautiful appearance, which is the same as the remote controller in many vehicle anti-theft systems. The number of buttons varies depending on the function. The transmitter module we use in this chapter has four buttons A, B, C, and D. The encoding and transmitting module is mainly composed of PT2262 encoding IC and high-frequency modulation and power amplification circuit. The commonly used encoding and transmitting module and its internal block diagram are shown in Figure 3.

The operating voltage of the remote control transmitter is DC 12V (battery powered)

Dimensions (mm): 58 39 14

Working frequency: 315MHz

Working current: 13mA

Coding type: fixed code (pad jumper setting on the board)

Application description: It is used in conjunction with various types of receiving modules with decoding functions, and corresponding control is performed after decoding the output, such as using a single-chip microcomputer to read and receive and decode the data and then control the corresponding lights or power switches.

insert image description here
Wireless coding receiver module based on PT2272

The super-regenerative receiving module adopts LC oscillator circuit, which includes amplification and shaping, and the output data signal is a decoded high-level signal. It is extremely convenient to use and low in price, so it is widely used. With four-way decoding output (can also be changed to six-way jog or interlock output), easy to use; easy to debug frequency points, short delivery cycle; good product quality consistency, high cost performance.

The receiving module has a wide receiving bandwidth, generally ±10MHz, and it is generally adjusted at 315MHz or 433.92MHZ when leaving the factory (if there are special requirements, the frequency can be adjusted, and the frequency adjustment range is 266MHz~433MHz). The receiving module is generally powered by DC5V, and the voltage range can be adjusted if there are special requirements.

insert image description here
The receiving module has a total of eight external interfaces, which are indicated in English. "5V" means to connect to the positive pole of the power supply, "D0, D1, D2, D" 3" means to connect to the output, "GND" means to connect to the negative pole of the power supply, and "ANT" means to connect to the antenna terminal.

insert image description here
The PT2272 decoder chip has different suffixes, indicating different functions, and it is divided into L4/M4/L6/M6, where L is the latch output, as long as the data is successfully received, it can maintain the corresponding level state until the next remote control data Change when something changes. M means non-latching output, the output level of the data pin is instantaneous and corresponds to whether the transmitter is transmitting, and can be used for control similar to jogging. The 6 and 4 in the suffix indicate that there are several parallel control channels. When using 4 channels of parallel data (PT2272-M4), the corresponding address code should be 8 bits. If using 6 channels of parallel data (PT2272-M6), The corresponding address code should be 6 bits. There is also a T4, T means latch output, and L is also a latch, but it is interlocked. When the second key is pressed, the first key can be released, but T can control the corresponding pin with a single key. output. So L is interlocking, T is self-locking, and M is non-locking.

M4 (jog: press and hold to output, and stop output as soon as you let go)
L4 (interlock: four channels can only have one output at the same time)
T4 (self-locking: four channels output independently of each other and do not affect each other, press to output Press again to stop output)

insert image description here
2262/2272 four-button wireless remote control kit module application environment

Wireless remote control switches, remote control sockets, data transmission, remote control toys, anti-theft alarm hosts, garage doors, rolling gates, road gates, retractable doors and other door control industries and remote control audio fields, etc.

insert image description here
insert image description here
insert image description here
Setting of oscillation resistance

The codec circuit composed of PT2262/2272 is a circuit widely used in radio. Of particular note is the setting of the oscillating resistor. If the oscillation resistance is not set properly, the circuit will not vibrate. Wireless signals cannot be sent out, so the oscillating resistor is very important for the operation of the entire circuit.

Selection of Oscillation Resistor

The oscillating resistors of PT2262/PT2272 are generally paired according to the following values:

PT2262 PT2272

1.2M 200K

1.5M 270K

2.2M 390K

3.3M 680K

4.7M 820K

Precautions

For some low-quality components, it is possible that such a pairing still cannot produce a response. In the case of no response, the resistance value can be changed under the condition that the element is judged to be intact. In general, we change one end of PT2262 to make the resistance of the resistor smaller. For example, 4.7M can be changed to 3.9M, or even changed to 3.3M.

insert image description here

PT2262/2272 module test and application:

After the hardware is connected, in order to facilitate the test circuit, connect the positive pole of the light-emitting tube to the four output pins, connect the negative pole of the light-emitting tube to the 2K-4.7K resistor to the ground, press the remote control key during the test, and the corresponding light-emitting tube will light up (2272 divided into two types, For L4 and M4, the former will lock the output, and the light-emitting tube will go out until it receives other key signals, and the other corresponding light-emitting tube will light up; the latter will light up when the corresponding remote control key is pressed, and the time is less than one second. up to you).

If you need to control a larger load, add 8050, and its base connects a 4.7K-10K resistor to 2272. Or use 2003 to drive. A relay can be connected at the back. If a 220V relay is used to control a 380V AC contactor, it can control the forward and reverse rotation of the motor (such as an electric fence gate). Don’t forget to connect another relay to power off the control line of the AC contactor, otherwise the motor will fail. fiery.

insert image description here
insert image description here
Precautions for using PT2262/2272 module

1. The antenna uses a flexible wire or other hard metal (such as a rod antenna), the length is about 24cm (315MHz) or 18cm (434MHz), and it should be straightened as much as possible. Do not get near metal objects.

2. The power supply voltage is required to be stable and the ripple coefficient is low, and multi-stage filtering is required (such as adding magnetic beads, inductors, capacitors, etc.).

  1. If it is used with a single-chip microcomputer, it is recommended that the MCU clock frequency is below 4MHZ and the crystal should be as far away from the RF receiving module as possible, otherwise the high-order harmonics of the crystal will affect the communication distance.

  2. Note that the rate of the encoding IC and the decoding IC are consistent and the format of the code is consistent, otherwise it will affect the distance and even fail to communicate.

insert image description here

Introduction to PT2262/PT2272 wireless remote control module (5 minutes video)

https://v.youku.com/v_show/id_XMzAwMDM3ODczMg==.html?spm=a2hzp.8253869.0.0

insert image description here

Arduino experiment open source code

/*

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百五十五:2262/2272四路无线遥控套件 M4非锁接收板 四键无线遥控器发射模块

*/



/*以下四个管脚定义,对应遥控器上的四个按键(遥控器为推荐的无线遥控器315MHz(SKU:FIT0355))*/

int D0 = 8;  //解码芯片数字输出管脚D0,串口值0001,按键A

int D1 = 9;  //解码芯片数字输出管脚D1,串口值0010,按键B

int D2 = 10;  //解码芯片数字输出管脚D2,串口值1000,按键C

int D3 = 11;  //解码芯片数字输出管脚D3,串口值0100,按键D

int ledPin = 13;  //接收指示灯

volatile int state = LOW;

void setup()

{
    
    

 Serial.begin(9600);

 /*以下管脚的顺序分别对应遥控器的4个按键*/

 pinMode(D3, INPUT); //分别初始化为输入端口,读取解码芯片输出管脚的电平

 pinMode(D1, INPUT);

 pinMode(D0, INPUT);

 pinMode(D2, INPUT);

 pinMode(ledPin, OUTPUT);

 attachInterrupt(1, blink, RISING); //数字口2,中断1,对应解码芯片的接收中断管脚

 digitalWrite(ledPin, LOW);

}

void loop()

{
    
    

 if (state != LOW) //如果接收到遥控器的命令,则进入该语句

 {
    
    

  state = LOW;

  delay(1);  //适当延时,等待管脚电平稳定

  digitalWrite(ledPin, HIGH);

  Serial.print(digitalRead(D3)); //分别读取解码芯片输出管脚的电平,并打印出来

  Serial.print(digitalRead(D1));

  Serial.print(digitalRead(D0));

  Serial.println(digitalRead(D2));

  delay(300);

  digitalWrite(ledPin, LOW);

 }

}

void blink()

{
    
    

 state = ! state;

}


Experimental serial port return

insert image description here
Arduino experiment scene diagram

insert image description here
Arduino experiment open source code 2

/*

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百五十五:2262/2272四路无线遥控套件 M4非锁接收板 四键无线遥控器发射模块

 程序之二:Arduino IC 2262/2272遥控器



*/

#define PIN_D2_INT 0

#define R06A_VT 2

#define R06A_D0 3

#define R06A_D1 4

#define R06A_D2 5

#define R06A_D3 6

bool r06a_0, r06a_1, r06a_2, r06a_3 = false;

int dirty = 0;

void pinD2ISR() {
    
    

 digitalWrite(13, !digitalRead(13));

 if (digitalRead(R06A_D0) == HIGH) {
    
    

  r06a_0 = !r06a_0;

 }

 if (digitalRead(R06A_D1) == HIGH) {
    
    

  r06a_1 = !r06a_1;

 }

 if (digitalRead(R06A_D2) == HIGH) {
    
    

  r06a_2 = !r06a_2;

 }

 if (digitalRead(R06A_D3) == HIGH) {
    
    

  r06a_3 = !r06a_3;

 }

 dirty = 1;

}

void setup() {
    
    

 attachInterrupt(PIN_D2_INT, pinD2ISR, RISING);

 pinMode(R06A_D0, INPUT);

 pinMode(R06A_D1, INPUT);

 pinMode(R06A_D2, INPUT);

 pinMode(R06A_D3, INPUT);

 Serial.begin(9600);

}

void loop() {
    
    

 if (dirty) {
    
    

  dirty = 0;

  Serial.print("A: ");

  Serial.println(r06a_2 ? "HIGH" : "LOW ");

  Serial.print("B: ");

  Serial.println(r06a_0 ? "HIGH" : "LOW ");

  Serial.print("C: ");

  Serial.println(r06a_3 ? "HIGH" : "LOW ");

  Serial.print("D: ");

  Serial.println(r06a_1 ? "HIGH" : "LOW ");

  Serial.println("");

 }

}

Experimental serial port return

insert image description here

Guess you like

Origin blog.csdn.net/weixin_41659040/article/details/131607336
Recommended