Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Science project idea

TV remote code decoder with a TSOP1738 receiver and Arduino

Infrared remotes talk to TVs and fans by sending pulses of 38 kHz light. An Arduino with a TSOP1738 receiver can decode the pulse train of each button, which teaches the idea of a protocol, and can then switch low-voltage loads from any old remote.

What it shows

Infrared remotes talk to TVs and fans by sending pulses of 38 kHz light. An Arduino with a TSOP1738 receiver can decode the pulse train of each button, which teaches the idea of a protocol, and can then switch low-voltage loads from any old remote.

The science

The remote sends a burst of infrared light switched at 38 kHz, and the receiver filters that frequency and outputs a clean digital signal. In the NEC protocol, a start burst of 9 ms is followed by 32 bits where a long gap means 1 and a short gap means 0. The IRremote library measures these times and reports the code as a hexadecimal number, which is the same each time a button is pressed.

Materials

Cost: under Rs 500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.

  • An Arduino Uno or Nano
  • A TSOP1738 IR receiver module
  • An old TV, AC or set-top remote
  • Three LEDs with 330 Ω resistors
  • The IRremote library from the Arduino library manager
  • A breadboard and wires
  • A 5 V relay module and a 5 V small fan (optional)

Safety

For this project: Use USB power only. If you add the relay, switch only a 5 V fan or an LED strip. An adult must supervise any wiring beyond the receiver.

Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.

All the safety rules

Step by step

10 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.

  1. Connect the receiver pins: OUT to digital pin 11, VCC to 5 V and GND to GND, checking the pin order on the datasheet.

  2. Install the IRremote library and open the receive-dump example.

  3. Upload it and open the serial monitor at 9600 baud.

  4. Press each button on the remote and write the hexadecimal code and the protocol that the library reports.

  5. Build a table of at least ten buttons with their codes and test that the same button always gives the same code.

  6. Test the range: find the farthest distance at which a button press is reliably read, and the angle off-axis at which it fails.

  7. Write a sketch that turns LED 1, 2 and 3 on or off when buttons 1, 2 and 3 are pressed.

  8. Add the relay and fan as a fourth output controlled by the power button.

  9. Use a phone camera to look at the remote LED while a button is pressed, and note the flicker you can see.

  10. Write the report on protocol timing, the code table, range tests and what limits the range.

What you should see

The serial monitor shows a stable hexadecimal code for every button, and the LEDs switch from the remote at 5 to 8 metres in a dim room. Range drops outdoors in sunlight, which is useful evidence for the report.

Viva questions

A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.

1Why 38 kHz?

It lets the receiver ignore steady sunlight and lamp light by looking only at that carrier frequency.

2Why can a phone camera see the remote LED?

Phone sensors respond to near infrared, which our eyes cannot see.

3What does the repeat code mean?

When you hold a button, the NEC remote sends a short repeat burst instead of the whole code again.

4Why does direct sunlight reduce the range?

Sunlight contains infrared that raises the noise at the receiver.

Free ebook: Viva Questions for Science Projects

Take it further

Use the Arduino as a learning remote that stores codes in EEPROM and sends them back using an IR LED.

Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.

Free ebooks for this project

Find out more about electronics and robotics

Free, well-known places to explore the subject further. Ask a grown-up before you sign up for anything or type your name anywhere.

WhatsApp us