Source: https://mokxi.com/teachers/plans/infrared-remotes
Updated: 2026-11-19

Lesson plan

# IR remotes and protocols lesson plan

How a remote control really works, on the Uno: a 38 kHz carrier that a tuned receiver picks out of a bright room, NEC read by hand and with IRremote, sending to a pretend TV, a learning remote, repeat codes, and a universal remote that translates between brands.

4 chapters, 7 lessons, about 6 hours, on the Arduino Uno R3. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- The carrier, the receiver that inverts, and a frame read by hand.
- IRremote reads the handset, then an Uno becomes the remote.
- Copy a code from any remote, and tell a press from a hold.
- A universal remote: NEC in, another brand out.

### Materials for the whole unit

- Arduino Uno R3 x 2
- Character LCD with I2C backpack
- Half breadboard
- Infrared LED, 940 nm
- Infrared receiver, VS1838B x 2
- Infrared remote, 21 buttons
- Logic analyzer, four channels
- Pushbutton x 2
- Resistor

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 50 min

## Light and the NEC protocol

The carrier, the receiver that inverts, and a frame read by hand.

Lesson | Time | What students do

Carriers and light An infrared LED aimed at a VS1838B, lit three ways: steady, at 38 kHz and at 56 kHz. Only one gets through, and the reason is the whole trick of every remote control. | 55 min

- Run the test bench
- A steady light does nothing
- The carrier gets through
- Watch OUT go low
- See it with a camera
- Find the band
- Why carriers

The NEC protocol No library: an Uno times every burst and gap from the handset, finds the 9 ms leader, reads thirty-two bits least significant first, checks the inverted bytes and names the key. | 55 min

- Run it
- Press 1: the leader
- See the frame
- Thirty-two bits, backward
- The check bytes
- Hold a key
- Break the split

### Materials

- Arduino Uno R3
- Half breadboard
- Infrared LED, 940 nm
- Infrared receiver, VS1838B
- Infrared remote, 21 buttons
- Logic analyzer, four channels
- Resistor

### Check for understanding

Each student finishes "The NEC protocol" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Break the split".

Chapter 2. About 1 h 50 min

## Decoding and sending

IRremote reads the handset, then an Uno becomes the remote.

Lesson | Time | What students do

Decoding with IRremote The IRremote library does in the background what the last lesson did by hand: a mission console where each number key flies to a planet and the LCD shows the light-minutes from the Sun. | 55 min

- Run the mission console
- Fly to Mars
- The screen follows
- Held keys repeat
- A key with no world
- Give key 9 a world
- What the library costs

Sending A second Uno joins as a pretend TV with an LCD for a screen. Two buttons and the infrared LED make a remote: IrSender builds NEC frames at 38 kHz, and the TV changes channel. | 55 min

- Meet the TV
- Change the channel
- The carrier on pin 3
- Turn it up
- The camera trick again
- Another brand
- Range and aim

### Materials

- Arduino Uno R3 x 2
- Character LCD with I2C backpack
- Half breadboard
- Infrared LED, 940 nm
- Infrared receiver, VS1838B
- Infrared remote, 21 buttons
- Pushbutton x 2
- Resistor

### Check for understanding

Each student finishes "Sending" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Range and aim".

Chapter 3. About 1 h 30 min

## Learning and repeats

Copy a code from any remote, and tell a press from a hold.

Lesson | Time | What students do

A learning remote Press LEARN, point the handset and press a key: the Uno keeps the frame, and PLAY sends it to the TV out of its own LED. Plus why a board must stop listening while it talks. | 45 min

- Run it
- Nothing to play yet
- Teach it a key
- Play it to the TV
- Learn a channel
- Stop listening while you talk

Repeat codes The TV side of holding a key: repeat frames every 110 ms ramp the volume, channels step once per press, a let-go is noticed when the repeats stop, and one prop shows what life is like without them. | 45 min

- Run the TV
- A quick tap
- Hold it
- Turn the repeats off
- Channels step once
- Let channels run

### Materials

- Arduino Uno R3 x 2
- Character LCD with I2C backpack
- Half breadboard
- Infrared LED, 940 nm
- Infrared receiver, VS1838B x 2
- Infrared remote, 21 buttons
- Pushbutton x 2
- Resistor

### Check for understanding

Each student finishes "Repeat codes" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Let channels run".

Chapter 4. About 55 min

## Boss project

A universal remote: NEC in, another brand out.

Lesson | Time | What students do

Boss: a universal remote A TV of another brand that speaks Samsung and ignores the kit handset. The Uno in between translates: a key table, Samsung repeats for held keys, a movie-night macro, and a key you map yourself. | 55 min

- Two remotes, one TV
- Translate a key
- Hold VOL+
- Movie night
- An unmapped key
- Map it to MUTE
- Make it yours

### Materials

- Arduino Uno R3 x 2
- Character LCD with I2C backpack
- Half breadboard
- Infrared LED, 940 nm
- Infrared receiver, VS1838B x 2
- Infrared remote, 21 buttons
- Pushbutton x 2
- Resistor

### Check for understanding

Each student finishes "Boss: a universal remote" on their own, without opening the hints. The simulator checks 7 of its 7 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
