[carving master learning programming] Arduino hands-on (71) -- infrared remote control expansion module

In fact, there are more than 37 popular sensor modules, which are compatible with the ardu sensor network. In view of the fact that I have accumulated some sensor and actuator modules in hand, according to the concept of "practice makes true knowledge" (we must do it by hand), and for the purpose of learning and communication, I am ready to try a series of experiments one by one. No matter whether the program is successful or not, it will be recorded - small progress or problems that can not be solved. I hope I can throw a brick and attract jade.

[Arduino] 168 kinds of sensor module series experiments (data code + graphic programming + simulation programming)

Experiment 71: HX1838 infrared wireless remote control kit infrared expansion module (remote controller + receiving board)


infrared
Also known as infrared light wave, in the electromagnetic spectrum, the wavelength range of light wave is 0.01um 1000um. According to different wavelengths, it can be divided into visible light and invisible light, with a wavelength of 0.38um0 The light wave of 76um can be visible light, which is red, orange, yellow, green, green, blue and purple in turn. The light wave is 0.01um0 The light wave of 38um is ultraviolet light (line), and the light wave with wavelength of 0.76um and 1000um is infrared light (line). Infrared light can be divided into near infrared, mid infrared, far infrared and extreme infrared according to the wavelength range. Infrared remote control uses near-infrared light to transmit remote control instructions, and the wavelength is 0.76um1 5um. Near infrared is used as the remote control light source because the peak wavelength of light emission and reception of infrared emitting devices (infrared light emitting tubes) and infrared receiving devices (photodiodes, triodes and photocells) is generally 0.8 um0.5 94um, in the near-infrared band, their spectra coincide exactly, which can match well, and can obtain high transmission efficiency and high reliability.


infrared remote control
Infrared remote control is the most widely used means of communication and remote control. Because the infrared remote control device has the characteristics of small volume, low power consumption, strong function and low cost, after color TV and video recorder, infrared remote control is also used in tape recorder, audio equipment, air conditioner, toys and other small electrical devices. In industrial equipment, under the environment of high voltage, radiation, toxic gas and dust, the infrared remote control is not only completely reliable, but also can effectively isolate electrical interference. The emission circuit of infrared remote control uses infrared light-emitting diode to emit modulated infrared light wave; The infrared receiving circuit is composed of infrared receiving diode, triode or silicon photocell. They convert the infrared light emitted by the infrared transmitter into the corresponding electrical signal, and then send it to the post amplifier.


VS/HX1838
Both vs1838 and HX1838 are infrared receiving heads. The difference between them is mainly reflected in the receiving distance. The maximum receiving distance of vs1838 is 18-20m and that of HX1838 is 15m.
The parameters of vs1838 are as follows - working voltage: 2.7-5.5V, receiving distance: 18-20M. Vs1838 has the characteristics of high sensitivity, strong resistance to light and electromagnetic interference. It should be widely used in set-top box, DVD, AV, TV, air conditioner, etc. it is an ideal choice for high-end electrical appliances.
The parameters of HX1838 are as follows - working voltage: 2.7~5.5V, working current: 1.4mA, distance: 15M, frequency: 38K, angle: ± 45 °, HX1838 has wide voltage adaptation, low power consumption, high sensitivity and excellent anti-interference characteristics; It is widely used in infrared remote control reception of household appliances, air conditioners, toys and so on.




characteristic
● small design
● built in special IC
● wide angle and long distance reception
● strong dry deflection resistance
● it can withstand the dry and flexible light of the environment
● low voltage operation
application
■ audio visual equipment (speaker, TV, video recorder, disc player)
■ household appliances (air conditioner, electric fan, electric lamp)
■ other infrared remote control products


Simple transmitting and receiving principle of infrared
At the transmitting end, the input signal is amplified and sent to the infrared transmitting tube for transmission. At the receiving end, after receiving the infrared signal, the receiving tube is amplified and processed by the amplifier and restored to the signal. This is the simple transmitting and receiving principle of infrared.


Infrared remote control system structure
The main parts of infrared remote control system are modulation, transmission and reception. Infrared remote control transmits data by modulation, which is to "and" the data with a certain frequency carrier, which can not only improve the transmission efficiency, but also reduce the power consumption. The modulation carrier frequency is generally between 30khz and 60khz. Most of them use a 38kHz square wave with a duty cycle of 1 / 3, as shown in Figure 2, which is determined by the 455kHz crystal oscillator used at the transmitter. At the transmitting end, the crystal oscillator shall be divided into integer frequency, and the frequency division coefficient is generally 12, so 455kHz ÷ 12 ≈ 37.9kHz ≈ 38kHz. 38KH carrier transmission (complete transmission) is shown in the figure below.


Arduino infrared wireless remote control expansion kit is composed of Mini ultra-thin infrared remote control and 38KHz infrared receiving module. The Mini ultra-thin infrared remote control has 17 function keys and the emission distance can be up to 8m. It is very suitable for controlling all kinds of equipment indoors. The infrared receiving module can receive the remote control signal modulated by standard 38KHz. By programming Arduino, the decoding operation of the remote control signal can be realized, so as to make various remote control robots and interactive works.

Ultra thin infrared remote control parameters
1.CR2025 environmental protection button battery, capacity 160mah
2. Transmitting distance: more than 8m (specifically related to surrounding environment, sensitivity of receiving end and other factors)
3. Effective angle: 60 degrees
4. Surface sticking material: 0.125mmPET, with an effective life of 20000 times.
5. Stable quality and high cost performance
6. Static current 3-5uA, dynamic current 3-5mA.


/*

[Arduino]168 A series of experiments of sensor modules (data code + graphic programming + simulation programming)

Experiment 71: HX1838 infrared wireless remote control kit infrared expansion module (remote controller + receiving board)

*/



#include <IRremote.h>

int PIN_RECV = 7;

IRrecv irrecv(PIN_RECV);

decode_results results;

void setup()

{

 Serial.begin(9600);

 irrecv.enableIRIn();

}

void loop() {

 if (irrecv.decode(&results)) {

  Serial.println(results.value);

  irrecv.resume();

 }

}

/*

[Arduino]168 A series of experiments of sensor modules (data code + graphic programming + simulation programming)

Experiment 71: HX1838 infrared wireless remote control kit infrared expansion module (remote controller + receiving board)

Program 2: 1 and 2 keys control the lighting and dimming of 13 pin LED lights on the board

*/



#include <IRremote.h>

int RECV_PIN = 7;

int LED_PIN = 13;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

{

 Serial.begin(9600);

 irrecv.enableIRIn(); // Start the receiver

 pinMode(LED_PIN, OUTPUT);

 digitalWrite(LED_PIN, HIGH);

}

void loop() {

 if (irrecv.decode(&results)) {

  Serial.println(results.value, HEX);

  if (results.value == 0xFFA25D) //Value of light on

  {

   digitalWrite(LED_PIN, LOW);

  } else if (results.value == 0xFF629D) //Light off value

  {

   digitalWrite(LED_PIN, HIGH);

  }

  irrecv.resume(); // Receive the next value

 }

 delay(100);

}

/*

[Arduino]168 A series of experiments of sensor modules (data code + graphic programming + simulation programming)

Experiment 71: HX1838 infrared wireless remote control kit infrared expansion module (remote controller + receiving board)

The third procedure is to query the infrared number and HEX coding value

*/



#include <IRremote.h>

int PIN_RECV = 7;

IRrecv irrecv(PIN_RECV);

decode_results results;

void setup()

{

 Serial.begin(9600);

 irrecv.enableIRIn();

}

void loop() {

 if (irrecv.decode(&results)) {

  Serial.print("Digital coding= "); 

  Serial.println(results.value);

  irrecv.resume();

  Serial.print("HEX code= ");      

  Serial.println(results.value, HEX); 

  Serial.print("Coding digit= ");      

  Serial.println(results.bits); 

 }

 delay(600);

}


Experimental scene

Experimental open source graphics programming (Mind +, editing and playing)



Experimental open source simulation programming (linkboy 3.7)

Posted by Zmodem on Mon, 02 May 2022 20:54:31 +0300