Control Two LEDs Using an IR Remote and ESP8266 NodeMCU

ESP8266 06-10-25
5 0

Tutorial plan

1- Objective of the tutorial

2- The necessary components

3- Assembly of the electronic system

4- Program ESP8266 NodeMCU with MicroPython

 

Objective of the tutorial

The main objective of this tutorial is to learn how to control two LEDs remotely using an infrared (IR) remote control and an ESP8266 NodeMCU board.
This project demonstrates how to use an IR receiver sensor to capture the signals transmitted by the remote control and how to program the ESP8266 to interpret these signals and control LEDs accordingly.

Through this tutorial, you will:

- understand how infrared communication works between a remote control and an electronic device.

- learn how to connect and interface an IR receiver with the ESP8266 NodeMCU.

- discover how to decode IR signals sent by different buttons on the remote control.

- write a MicroPython program that reads the IR codes and performs actions such as turning LEDs ON or OFF based on the button pressed.

Gain experience in building a simple remote-controlled lighting system, which can later be expanded to control other devices such as motors, relays, or home automation systems.

At the end of this tutorial, you will have a functional system where:

- pressing specific buttons on the remote allows you to turn both LEDs on or off,

- or control each LED individually, showing how an IR remote can easily manage multiple outputs on the ESP8266 board.

 

The necessary components

ESP8266 NodeMCU Board

The main microcontroller that receives signals from the IR sensor and controls the LEDs.

IR Receiver Module (KY-032)

KY-032 infrared sensor module

Captures infrared signals from the remote control and sends them to the ESP8266 as digital codes.

IR Remote Control

Télécommande infrarouge

Sends infrared signals. Each button emits a unique code that the ESP8266 can interpret to control LEDs.

Two LEDs (e.g., red and blue)

These LEDs will be controlled individually or together by the remote control.

Two 220 Ω Resistors

deux résistances

Limit the current flowing through the LEDs to prevent damage.

Breadboard

plaque d'essai

For easy connections of all components without soldering.

Jumper Wires

Fils de connexion

Used to connect the ESP8266, LEDs, and IR receiver on the breadboard.

 

Assembly of the electronic system

The system consists of an ESP8266 NodeMCU, an IR receiver, an IR remote control, and two LEDs (red and blue). The components are connected on a breadboard using jumper wires.

1. Connecting the IR Receiver

VCC → 3.3V of ESP8266

GND → GND of ESP8266

OUT → D2 (GPIO4) for signal input

2. Connecting the LEDs

Each LED is connected to a digital pin of the ESP8266 through a 220 Ω resistor:

LED 1 (Red):

Anode (+) → D0(GPIO16) via 220 Ω resistor

Cathode (–) → GND

LED 2 (Blue):

Anode (+) → D1 (GPIO5) via 220 Ω resistor

Cathode (–) → GND

 

Program ESP8266 NodeMCU with MicroPython

 

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info