Introduction: Send Text to Arduino With IR Remote Control

In this instructable I am going to show you how you can use an IR remote control to send text data to an Arduino and display it on a LCD display. By using the number keypad on the remote control in the same way that you would a phone keypad to map digits to letters, you can write words on the LCD display. The display is updated whenever you press a button on the remote control. Special buttons can be assigned for moving the cursor forward and backward on the display and for clearing a character. The project is easily adapted to work with almost any remote control.

You can use this technique in your own projects if you want an easy and cost-efficient way to wirelessly send short text commands to an Arduino, e.g., for configuration purposes.

Step 1: Connect the Components

Picture of Connect the Components

Component List

  • Arduino Uno
  • Breadboard
  • Jumper Cables
  • TSOP31238 IR Receiver Module
  • LCD Display (compatible with the Hitachi HD44780 driver)
  • 1x Resistor 220Ω
  • 1x Potentiometer 10kΩ
  • IR Remote Control

Instead of the TSOP31238 IR receiver, you can also use a different type of receiver module. In my own build I used the 1838b module. The only thing to watch out for is that the module uses a carrier frequency of 38kHz. This is the carrier frequency that most IR remote controls use.

Connect the components as shown in the Fritzing sketch.

Step 2: Code

Install Libraries
For this project I am using the following two Arduino libraries:

  • The IRRemote library by shirriff
  • The LiquidCrystal library by Arduino, Adafruit

Use the Library Manager in your Arduino IDE to install the libraries.

Map Codes to Buttons
Whenever you push a button on a remote control, it sends out some data, a few bytes, encoded as a sequence of rapid flashes of the IR emitter in the remote control (periods during which the IR emitter is on and periods during which it is off). Different remote controls send out different data when you push a button - this ensures that, for example, your TV remote doesn't turn on or off your DVD player. If you would like to learn more about how IR remote controls work and how they transmit data, I recommend that you read this tutorial from Sparkfun.

Since different remote controls send out different codes, the Arduino sketch I used in my project will at first probably not work with your remote control, because it contains the codes that my remote control is sending, which will most likely be different from the ones your remote is sending. But that's easy to fix! We can run the Arduino sketch in capture mode to capture the codes your remote is sending when you push the different buttons and then just insert the captured codes in the sketch, so it uses them when we switch back from capture mode to regular mode.

Follow these steps:

  1. Download the attached Arduino sketch
  2. Open the Serial Monitor in your Arudino IDE
  3. Upload the sketch to your Arduino
  4. The serial monitor should now ask you to press button "BUTTON_2" on your remote control
  5. When you press the button on your remote control, the serial monitor should tell you the code your remote control has sent
  6. Proceed in the same way until the serial monitor tells you that the capturing is done
  7. Find the section in the Arduino sketch where it says "REPLACE CODES HERE"
  8. Replace the codes in the sketch with the codes you just obtained for the corresponding buttons
  9. Comment out the line "#define CAPTURE_MODE"
  10. Upload the modified sketch to your Arduino

You can now use your remote control to send text to the Arduino!

Comments

328107 (author)2017-10-12

this is amazing

bhaskarjoshi (author)2017-04-13

I can use television remote for


  • TSOP31238 IR Receiver Module
DIY Hacks and How Tos (author)2017-01-08

Nice. IR remote controlled Arduinos are probably the best way to make to remotely control electronics. I use it to control the lamp across the room from my desk.

About This Instructable

1,366views

18favorites

License:

More by david-mccann:LightBox Music VisualizerSend Text to Arduino with IR Remote Control
Add instructable to: