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.
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.
Light and the NEC protocol
The carrier, the receiver that inverts, and a frame read by hand.
| Lesson | Time | What students do |
|---|---|---|
| Carriers and lightAn 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 |
|
| The NEC protocolNo 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 |
|
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".
Decoding and sending
IRremote reads the handset, then an Uno becomes the remote.
| Lesson | Time | What students do |
|---|---|---|
| Decoding with IRremoteThe 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 |
|
| SendingA 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 |
|
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".
Learning and repeats
Copy a code from any remote, and tell a press from a hold.
| Lesson | Time | What students do |
|---|---|---|
| A learning remotePress 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 |
|
| Repeat codesThe 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 |
|
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".
Boss project
A universal remote: NEC in, another brand out.
| Lesson | Time | What students do |
|---|---|---|
| Boss: a universal remoteA 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 |
|
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".
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.