Using the KY-032 infrared sensor and a remote control with ESP32 card

ESP32 30-07-23
316 0

Tutorial plan

1- Introducing the KY-032 Infrared Sensor

2- The relationship between the KY-032 infrared sensor and a remote control

3- How to receive the ESP32 card an infrared signal from the remote control using the KY-032 sensor?

4- The components needed to use the KY-032 infrared sensor with ESP32 card

5- Mounting ESP32 card with the KY-032 infrared sensor

 

Introducing the KY-032 Infrared Sensor

The KY-032 Infrared Sensor is a module that is commonly used in electronics and robotics projects for detecting the presence of infrared signals. It is also known as an infrared obstacle avoidance sensor module. The module consists of an infrared emitter (LED) and an infrared receiver (phototransistor) placed side by side.

Here are some key features and characteristics of the KY-032 Infrared Sensor:

1- Detection Method: The sensor module detects infrared light by emitting a modulated infrared signal and measuring the reflection. When an object is present in front of the module, the infrared light emitted by the LED bounces off the object and is detected by the phototransistor.

2- Operating Voltage: The KY-032 module typically operates at a voltage range of 3.3V to 5V, making it compatible with most microcontrollers and development boards.

3- Digital Output: The module provides a digital output that can be easily interfaced with microcontrollers or other digital circuits. It produces a HIGH (logic 1) output when no obstacle is detected and a LOW (logic 0) output when an obstacle is detected within its detection range.

4- Adjustable Detection Range: The detection range of the KY-032 sensor can be adjusted using a potentiometer on the module. This allows you to fine-tune the sensitivity of the sensor according to your specific requirements.

5- Applications: The KY-032 Infrared Sensor can be used in various applications, including obstacle detection and avoidance in robotics, line following robots, proximity sensing, object detection, and security systems.

When using the KY-032 Infrared Sensor, it's important to keep in mind that it primarily detects the presence of objects based on their reflective properties rather than their distance. The effectiveness of the sensor can be affected by factors such as ambient light and the reflective properties of the objects being detected.

How to receive ESP32 card an infrared signal from the remote control using the KY-032 sensor ?

To receive an infrared signal from a remote control using an ESP32 board and the KY-032 sensor in MicroPython, you can follow these steps:

1- Hardware Setup: Connect the KY-032 sensor to the ESP32 board. The KY-032 module usually has three pins: VCC, GND, and OUT. Connect them as follows:

  • VCC -> 3.3V (ESP32's 3V3 pin)
  • GND -> GND (ESP32's GND pin)
  • OUT -> GPIO 23 pin (any digital input pin on ESP32)

2- Install MicroPython: Make sure you have MicroPython installed on your ESP32 board. If you haven't done it yet, you can find the firmware and installation instructions on the official MicroPython website: https://micropython.org/download

3- Import ir_rx library

4- Write the MicroPython Code: Create a new Python file (e.g., infrared_receiver.py) and write the following code to initialize and read from the KY-032 sensor:

The components needed to use the KY-032 infrared sensor with ESP32 card

To use the KY-032 infrared sensor with the ESP32 card, you will need the following components:

1- ESP32 card:

ESP32 card

The ESP32 card is a popular microcontroller development board that features built-in Wi-Fi and Bluetooth connectivity. It is widely used for various Internet of Things (IoT) projects and prototyping.

2- KY-032 infrared sensor module:

KY-032 infrared sensor module

The KY-032 module itself, which consists of an infrared emitter (LED) and an infrared receiver (phototransistor) placed side by side. It can detect infrared signals and provide a digital output based on the presence or absence of obstacles.

3- Jumper wires:

Jumper wires

You will need jumper wires to establish connections between the Micro:bit board and the KY-032 sensor. These wires typically have male-to-male connectors at both ends.

4- Breadboard

Test plate

The breadboard is a common tool used in robotics and electronics to create circuit prototypes and temporary connections. It makes it easy to test and connect electronic components together without having to solder the connections.

These components are the basic requirements for using the KY-032 infrared sensor with the ESP32 board. Additionally, you may need a remote control that transmits infrared signals to test the functionality of the sensor.

Mounting ESP32 board with the KY-032 infrared sensor

Mounting the ESP32 board with the KY-032 infrared sensor is a straightforward process. Here are the steps to mount the components securely:

1- Prepare the Components: Ensure you have your ESP32 development board (e.g., ESP32 NodeMCU, ESP32 DevKit) and the KY-032 infrared sensor module.

2- Connect the KY-032 Sensor to the ESP32 Board: Connect the KY-032 sensor to the ESP32 board following the pin connections mentioned earlier:

  • VCC -> 3.3V (ESP32's 3V3 pin)
  • GND -> GND (ESP32's GND pin)
  • OUT -> GPIO 23 pin

Mounting ESP32 board with the KY-032 infrared sensorMounting ESP32 board with the KY-032 infrared sensor

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