# Using an Infrared Library on Arduino

## Overview

_NOTE: This tutorial has been updated to work with IRLib 2.x which is significantly different from previous versions._

Most consumer electronic devices such as TV, cable box, DVD players and other devices use infrared signals for remote control. Each manufacturer has its own protocols for encoding the data so that signals intended for one device do not interfere with another.&nbsp;[In an earlier tutorial by LadyAda](../../../ir-sensor "IR sensor tutorial")&nbsp;she describes the inner working of reading IR signals from a remote and creating your own IR signals using an IR LED. Her tutorial gives you a behind-the-scenes peek at how IR works but it's a bit difficult to wrestle with all those technical details in your project.

If you're like me, you have no idea how NeoPixels work, nor the inner workings of I2C or SPI communications but you don't need to because we have libraries for that. A good code library isolates you, the application programmer, from the hardware details and the inner workings of devices and provide you with an API that makes it easy to use the hardware without knowing or caring what's going on behind the scenes.

In this tutorial we will show you how to use IRLib for receiving, decoding, and sending IR signals in your Arduino based project. We will show you how to change colors on a NeoPixel, control a servo using IR remote and send signals to your TV or cable box from an Arduino. Future tutorials will include an IR control mouse, and Internet of things remote control and controlling a robot arm.

- [Next Page](https://learn.adafruit.com/using-an-infrared-library/about-ir-libraries.md)

## Featured Products

### IR (Infrared) Receiver Sensor

[IR (Infrared) Receiver Sensor](https://www.adafruit.com/product/157)
IR sensor tuned to 38KHz, perfect for receiving commands from a TV remote control. Runs at 3V to 5V so it's great for any microcontroller.  
  
To use, connect pin 3 (all the way to the right) to 5V power, pin 2 (middle) to ground and listen on pin 1. It doesn't do any decoding...

In Stock
[Buy Now](https://www.adafruit.com/product/157)
[Related Guides to the Product](https://learn.adafruit.com/products/157/guides)
### Mini Remote Control

[Mini Remote Control](https://www.adafruit.com/product/389)
This little remote control would be handy for controlling a robot or other project from across the room. It has 21 buttons and a layout we thought was handy: directional buttons and number entry buttons. The remote uses the NEC encoding type and sends data codes 0 thru 26 (it skips #3, #7,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/389)
[Related Guides to the Product](https://learn.adafruit.com/products/389/guides)
### Super-bright 5mm IR LED

[Super-bright 5mm IR LED](https://www.adafruit.com/product/387)
Infrared LEDs are used for remote controls (they're the little LED in the part you point at your TV) and 'night-vision' cameras, and these little blue guys are high powered ones! They are 940nm wavelength, which is what nearly all devices listen to. They're 20 degree beamwidth,...

In Stock
[Buy Now](https://www.adafruit.com/product/387)
[Related Guides to the Product](https://learn.adafruit.com/products/387/guides)
### NPN Bipolar Transistors (PN2222) - 10 pack

[NPN Bipolar Transistors (PN2222) - 10 pack](https://www.adafruit.com/product/756)
Transistors are powerful little electronic switches, and we really like these NPN transistors whenever we need to control medium-power electronics such as small motors, solenoids, or IR LEDs. We find them so handy, they come in a pack of 10!

Each transistor is a general-purpose...

In Stock
[Buy Now](https://www.adafruit.com/product/756)
[Related Guides to the Product](https://learn.adafruit.com/products/756/guides)
### Breadboard-friendly RGB Smart NeoPixel - Pack of 5

[Breadboard-friendly RGB Smart NeoPixel - Pack of 5](https://www.adafruit.com/product/1312)
This is the easiest way possible to add small, bright RGB pixels to your project. We took the same technology from our Flora NeoPixels and made them breadboard friendly, with two rows of 3 x 0.1" spaced header on each side for easy soldering, chaining and breadboarding. These ultra-bright...

In Stock
[Buy Now](https://www.adafruit.com/product/1312)
[Related Guides to the Product](https://learn.adafruit.com/products/1312/guides)

## Related Guides

- [Using NeoPixels with Netduino Plus 2](https://learn.adafruit.com/using-neopixels-with-netduino.md)
- [Guardian Shield+ Zelda Breath of the Wild](https://learn.adafruit.com/guardian-shield-zelda-breath-of-the-wild.md)
- [NeoPixels on Raspberry Pi](https://learn.adafruit.com/neopixels-on-raspberry-pi.md)
- [Trinket Sound-Reactive LED Color Organ](https://learn.adafruit.com/trinket-sound-reactive-led-color-organ.md)
- [Wireless LED Juggling Balls with ESP-NOW](https://learn.adafruit.com/wireless-juggling-balls-esp-now.md)
- [Using NeoPixels and Servos Together](https://learn.adafruit.com/neopixels-and-servos.md)
- [Zelda: Breath of the Wild – 3D Printed Bladesaw](https://learn.adafruit.com/bladesaw.md)
- [Create an Infrared Controlled Mouse with Arduino Micro, Leonardo, or Yun](https://learn.adafruit.com/create-an-infrared-controlled-mouse-with-pro-trinket-or-arduino-micro.md)
- [CheerLights](https://learn.adafruit.com/cheerlights.md)
- [Adafruit NeoPixel Überguide](https://learn.adafruit.com/adafruit-neopixel-uberguide.md)
- [TSL2561 Luminosity Sensor](https://learn.adafruit.com/tsl2561.md)
- [Mailbox Notification Service](https://learn.adafruit.com/mailbox-notification-service.md)
- [Adafruit AMG8833 8x8 Thermal Camera Sensor](https://learn.adafruit.com/adafruit-amg8833-8x8-thermal-camera-sensor.md)
- [A CircuitPython BLE Remote Control On/Off Switch](https://learn.adafruit.com/circuitpython-ble-remote-control-on-off.md)
- [Stained Glass Lamp](https://learn.adafruit.com/stained-glass-lamp.md)
