License

Recommend Projects

Infrared (IR) Remote

3 years ago 7648
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

Infrared (IR) Remote

Here's the pinout for almost every 3-pin IR Receiver: IR REMOTE (Above): a diagram of connecting the receiver to an Arduino. There are many different manufacturers of IR Receivers and some have different pinouts: IR Receivers Image courtesy of Alberto Piganti. See: http://www.pighixxx.com/ There is also an easy-to-connect IR Receiver Electronic Brick like this (Down). It can be plugged into a Sensor Shield or YourDuinoRobo1 with a 3-pin cable. IR Brick CONNECTION NOTE: The IR Remote Receiver Electronic Brick has 3 pins. From left to right they are: (G) Ground, (V) Voltage, (S) Signal. BUT the marking sometimes vary on the little circuit board. In this photo they are marked G-R-Y. The 3-pin cable in the photo has the typical color code: (G) Ground = Black, (V) Voltage = Red, (S) Signal = White. IR Remote Receiver IR-REMOTE LIBRARY: Note: The following library must be installed in your Arduino installation for this to work! https://github.com/shirriff/Arduino-IRremote Below is the IR Remote Control Kit connected to a YourARDUINO with a 3-pin cable. On the right is the detail of the way the IR Receiver is carefully plugged into Gnd and Vcc on the cable, and the Out pin is insulated with a piece stripped from another wire, the pins are cut off evenly, and Out is routed into the Signal (White) pin of the cable. The software below displays the button that was pressed. ir romote Test Arduino Software Sketch for IR Infrared Remote Control [Other Versions below]


#include "IRremote.h"

/*-----( Declare Constants )-----*/
int receiver = 3; // pin 1 of IR receiver to Arduino digital pin 3

/*-----( Declare objects )-----*/
IRrecv irrecv(receiver);           // create instance of 'irrecv'
decode_results results;            // create instance of 'decode_results'
/*-----( Declare Variables )-----*/

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Serial.begin(9600);
  Serial.println("IR Receiver Raw Data + Button Decode Test");
  irrecv.enableIRIn(); // Start the receiver

}/*--(end setup )---*/

void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  if (irrecv.decode(&results)) // have we received an IR signal?

  {
//    Serial.println(results.value, HEX);  UN Comment to see raw values
    translateIR(); 
    irrecv.resume(); // receive the next value
  }  
}/* --(end main loop )-- */

/*-----( Declare User-written Functions )-----*/
void translateIR() // takes action based on IR code received

// describing Car MP3 IR codes 

{

  switch(results.value)

  {

  case 0xFFA25D:  
    Serial.println(" CH-            "); 
    break;

  case 0xFF629D:  
    Serial.println(" CH             "); 
    break;

  case 0xFFE21D:  
    Serial.println(" CH+            "); 
    break;

  case 0xFF22DD:  
    Serial.println(" PREV           "); 
    break;

  case 0xFF02FD:  
    Serial.println(" NEXT           "); 
    break;

  case 0xFFC23D:  
    Serial.println(" PLAY/PAUSE     "); 
    break;

  case 0xFFE01F:  
    Serial.println(" VOL-           "); 
    break;

  case 0xFFA857:  
    Serial.println(" VOL+           "); 
    break;

  case 0xFF906F:  
    Serial.println(" EQ             "); 
    break;

  case 0xFF6897:  
    Serial.println(" 0              "); 
    break;

  case 0xFF9867:  
    Serial.println(" 100+           "); 
    break;

  case 0xFFB04F:  
    Serial.println(" 200+           "); 
    break;

  case 0xFF30CF:  
    Serial.println(" 1              "); 
    break;

  case 0xFF18E7:  
    Serial.println(" 2              "); 
    break;

  case 0xFF7A85:  
    Serial.println(" 3              "); 
    break;

  case 0xFF10EF:  
    Serial.println(" 4              "); 
    break;

  case 0xFF38C7:  
    Serial.println(" 5              "); 
    break;

  case 0xFF5AA5:  
    Serial.println(" 6              "); 
    break;

  case 0xFF42BD:  
    Serial.println(" 7              "); 
    break;

  case 0xFF4AB5:  
    Serial.println(" 8              "); 
    break;

  case 0xFF52AD:  
    Serial.println(" 9              "); 
    break;

  default: 
    Serial.println(" other button   ");

  }

  delay(500);

} //END translateIR

If you use the IRrecvDemo Sketch (above) and count the 21 buttons from left to right and top to bottom, the codes received are these: (NOTE: Receiving "FFFFFFFF" means "repeat" if you hold the button down.) result

Documents

Infrared (IR) Remote

BOM

ID Name Designator Footprint Quantity Manufacturer Part Manufacturer Supplier Supplier Part Price LCSC Assembly Mounted
1 TSOP1738 U1 TSOP17XX 1
2 Arduino MEGA 2560 U2 DIP 1

Attachments

None

Members

Success
The owner does not allow comments in this project now

Comments (0)

goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.