Wish List 0

5V Nec Code Infrared Decoding Encoding Module Infrared Wireless Communication Serial Communication

Rs. 171.00 Rs. 211.00

  • Product Code: SEN-COM
  • SKU - SE-2968
  • Availability: In Stock
  • Price in reward points: 2
  • For Bulk Order 9962060070
    Quick support on WhatsApp (+919962060070) only between morning 11am-4pm, no call will be answered
Supply voltage: 5V
Communication method: serial communication (TTL level)
Launching distance: 6-10 meters (the actual environmental test of our shop is 8 meters stable control)
First, the function description
With infrared emission function.
With infrared coding function.
With infrared transmitter expansion interface.
With serial communication function, the communication level is TTL.
It can control infrared format equipment, including electronic appliances such as TV sets and electric fans.
Support coding chip: (Typical coding chip such as uPD6121, uPD6122, TC9012 and many compatible chip models, such as PT2221, PT2222, SC6121, SC6122, SC9012, etc.)
Can be used as infrared wireless data communication, data transmission, infrared control and other functions
 Second, the scope of application
Smart home student electronic design infrared to wireless intelligent industrial equipment
MP3 Controller Remote Infrared Control Infrared Decoding Device Electronic Building Blocks
Electronic equipment control wireless to infrared design infrared coding equipment smart car remote control
Three. How to use
The use of this module is very simple. The following is an explanation of the electronic professional and non-electronic majors:
 
Electronic major:
Only need to use the serial port communication knowledge of the single-chip microcomputer, send the specified instruction through the serial port to carry out the control module transmission; perform the infrared coding operation through the serial port receiving mode to obtain the remote control coding information.
 
decoding:
There is no need to send any instructions during decoding, just pick up the receiver of the remote control alignment module, and the serial port of the module outputs the infrared code.
 
Coding (emission):
When encoding, you need to send the instruction according to a certain format, and send the 5-byte instruction through the serial port of the computer or the single-chip microcomputer to restore the corresponding encoded infrared signal.
Using this infrared transceiver function, we can do infrared data transmission and control, and purchase 2 sets to complete the transceiver operation.
 
Non-electronic major:
If you don't know the knowledge of single-chip computer, you can use our USB to TTL combined with computer to control other devices. After connecting the circuit, the PC software can simply send and receive commands to realize the codec function.


SPECIFICATIONS:
-Size 27''17mm
-Supply voltage 5V
-Communication Serial communication (TTL level)
-Firing distance 6-10 meters (OUR actual environmental testing eight meters Stability Control)

OVERVIEW:

-With the infrared emission function

-With infrared encoding.

-With the infrared emission head expansion interface.

-With serial communication functions, communication level is TTL.

-It can control 99% of the infrared format devices, including televisions, fans and other electrical and electronic equipment.

-Support for NEC encoding chips

PACKAGE INCLUDES:

1 PCS x 5V Nec Code Infrared Decoding Encoding Module Infrared Wireless Communication Serial Communication


// SOURCE CODE TAKEN FROM BELOW LINK

//https://simple-circuit.com/arduino-nec-remote-control-decoder/

Arduino NEC Protocol IR remote control decoder

 

 

// include LCD library code

#include <LiquidCrystal.h>

 

// LCD module connection (RS, E, D4, D5, D6, D7)

LiquidCrystal lcd(3, 4, 5, 6, 7, 8);

 

char text[5];

boolean nec_ok = 0;

byte  i, nec_state = 0, command, inv_command;

unsigned int address;

unsigned long nec_code;

 

void setup() {

  // set up the LCD's number of columns and rows

  lcd.begin(16, 2);

  lcd.setCursor(0, 0);

  lcd.print("Address:0x0000");

  lcd.setCursor(0, 1);

  lcd.print("Com:0x00 In:0x00");

  // Timer1 module configuration

  TCCR1A = 0;

  TCCR1B = 0;                                    // Disable Timer1 module

  TCNT1  = 0;                                    // Set Timer1 preload value to 0 (reset)

  TIMSK1 = 1;                                    // enable Timer1 overflow interrupt

  attachInterrupt(0, remote_read, CHANGE);       // Enable external interrupt (INT0)

}

 

void remote_read() {

unsigned int timer_value;

  if(nec_state != 0){

    timer_value = TCNT1;                         // Store Timer1 value

    TCNT1 = 0;                                   // Reset Timer1

  }

  switch(nec_state){

   case 0 :                                      // Start receiving IR data (we're at the beginning of 9ms pulse)

    TCNT1  = 0;                                  // Reset Timer1

    TCCR1B = 2;                                  // Enable Timer1 module with 1/8 prescaler ( 2 ticks every 1 us)

    nec_state = 1;                               // Next state: end of 9ms pulse (start of 4.5ms space)

    i = 0;

    return;

   case 1 :                                      // End of 9ms pulse

    if((timer_value > 19000) || (timer_value < 17000)){         // Invalid interval ==> stop decoding and reset

      nec_state = 0;                             // Reset decoding process

      TCCR1B = 0;                                // Disable Timer1 module

    }

    else

      nec_state = 2;                             // Next state: end of 4.5ms space (start of 562µs pulse)

    return;

   case 2 :                                      // End of 4.5ms space

    if((timer_value > 10000) || (timer_value < 8000)){

      nec_state = 0;                             // Reset decoding process

      TCCR1B = 0;                                // Disable Timer1 module

    }

    else

      nec_state = 3;                             // Next state: end of 562µs pulse (start of 562µs or 1687µs space)

    return;

   case 3 :                                      // End of 562µs pulse

    if((timer_value > 1400) || (timer_value < 800)){           // Invalid interval ==> stop decoding and reset

      TCCR1B = 0;                                // Disable Timer1 module

      nec_state = 0;                             // Reset decoding process

    }

    else

      nec_state = 4;                             // Next state: end of 562µs or 1687µs space

    return;

   case 4 :                                      // End of 562µs or 1687µs space

    if((timer_value > 3600) || (timer_value < 800)){           // Time interval invalid ==> stop decoding

      TCCR1B = 0;                                // Disable Timer1 module

      nec_state = 0;                             // Reset decoding process

      return;

    }

    if( timer_value > 2000)                      // If space width > 1ms (short space)

      bitSet(nec_code, (31 - i));                // Write 1 to bit (31 - i)

    else                                         // If space width < 1ms (long space)

      bitClear(nec_code, (31 - i));              // Write 0 to bit (31 - i)

    i++;

    if(i > 31){                                  // If all bits are received

      nec_ok = 1;                                // Decoding process OK

      detachInterrupt(0);                        // Disable external interrupt (INT0)

      return;

    }

    nec_state = 3;                               // Next state: end of 562µs pulse (start of 562µs or 1687µs space)

  }

}

 

ISR(TIMER1_OVF_vect) {                           // Timer1 interrupt service routine (ISR)

  nec_state = 0;                                 // Reset decoding process

  TCCR1B = 0;                                    // Disable Timer1 module

}

 

void loop() {

  if(nec_ok){                                    // If the mcu receives NEC message with successful

    nec_ok = 0;                                  // Reset decoding process

    nec_state = 0;

    TCCR1B = 0;                                  // Disable Timer1 module

    address = nec_code >> 16;

    command = nec_code >> 8;

    inv_command = nec_code;

    sprintf(text, "%04X", address);

    lcd.setCursor(10, 0);

    lcd.print(text);                             // Display address in hex format

    sprintf(text, "%02X", command);

    lcd.setCursor(6, 1);

    lcd.print(text);                             // Display command in hex format

    sprintf(text, "%02X", inv_command);

    lcd.setCursor(14, 1);

    lcd.print(text);                             // Display inverted command in hex format

    attachInterrupt(0, remote_read, CHANGE);     // Enable external interrupt (INT0)

  }

}

15 days

Write a review

Please login or register to review