Automated Light Control Using IR Sensor & ESP32

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 08 | Aug 2025 www.irjet.net p-ISSN: 2395-0072

Automated Light Control Using IR Sensor & ESP32

Tanmay Khaladkar

Tanmay Khaladkar , Department of Mechatronics Engineering, Symbiosis Skills & Professional University, Pune, Maharashtra, India

Abstract - TThis project employs an ESP32 microcontroller, a 5V relay module and an IR (infrared) sensor to develop a simple and inexpensive automated light control system. The system detects human motion through an infrared sensor, and the lightbulb automatically executes an ON command. If no motion is deeded it will turn off after a short period of time. In a sustainable manner, the automated control will limit human intervention and energy waste. Through testing and successful implementation, the prototype demonstrated reliable switching with negligible latency.

Key Words: IR Sensor, ESP32, Relay Module, Motion Detection,HomeAutomation,EnergySaving

1.INTRODUCTION

Energy conservation is now a major facet of today's automation solutions. There is a growing desire to use electricitysustainablyandefficiently.Peoplewastealotof energy every day because they forget to turn lights off after they are finished using them. Powering lights when they are not needed is a waste of energy and a lot of unnecessary cost. In looking to help solve this wastefulness, the project proposed in this paper aims to create an automated lighting control system powered by anESP32microcontrollerandinfrared(IR)sensor.TheIR sensor is programmed to detect human presence, or motion,insidethesensingarea,andanESP32willusethe data from the IR sensor to automate the switching of the lightbulb.Whilethereismotion,thelightwillbeswitched on. If there is no motion, or no presence, for a certain amount of time, the light will be shut off. This control solutionautomatestheworkhumansneedtodotocontrol thelightingandmanageenergy,anditmakesaperfectand appropriatesolutionforsmarthomesandworkplaces

1.1

Motivation and Objective

The principal aim of this project is to develop a lighting control system that is easy to install in home and work situations and that is dependable, inexpensive and effective. The lighting control system is made to work automatically without human interaction. This is made possible through the use of motion detection technology. The improvement in convenience due to lights turning on onlywhileusersoccupycertainspaces,andoffwhenusers remove occupy them not only enhances user convenience,

it helps to secure major reductions in wasteful energy use andpromotesbothreducedcostsandenergysavings.

1.2 Overview of Components

The recommended system's three main components are: an ESP32 microcontroller, a 5V relay module, and an infrared (IR) sensor. The input to the system will be an infrared sensor which constantly monitors its environment for motion. Upon receiving data from the infrared sensor, the ESP32 microcontroller determines quicklyhowtocontrolthelightingoperation.The5Vrelay module is essential for safety by acting as a link from the low voltage control circuit to the high voltage alternating current (AC) power source supplying the light bulbs. The componentsoutlined in this project wereselectedasthey are inexpensive, reliable, common and they make the systemaffordableandpractical.

2. SYSTEM COMPONENTS AND CONNECTIONS

Alright, here's the story: you have an ESP32 microcontroller, a 5V relay, an AC light bulb, and an IR detector, and these elements are all working together in a techiecombination!Basically,theIRsensorisonlookout when it detects movement, it contacts the ESP32. The ESP32 responds "ok", and activates the relay. The relay is the gatekeeper between the low voltage control elements and the infamous AC side, so that nothing gets toasted. When it is activated, it passes the power through and the bulblights.Afteratimeofinactivity,theESP32willdecide itisunnecessarytokeeptherelayactive,andtellstherelay todisconnect,andthelightgoesout.Therefore,youdonot have to keep flipping the switch by hand. Less work and moreelectricitysavings;forlazyhumans,andourplanet,it isawin!

The IR(Infra-red Sensor) Sensor:

The infrared (IR) sensor uses an infrared light-emitting diode, photodiode, and other signal conditioning circuitry todetectmotion,orthepresenceofobjects.TheIRsensing system works by first emitting infrared light and then assessing when an object in close proximity elements reflectedinfraredlightback atthesensor.Thephotodiode senses the reflected infrared beam and produces an electrical signal when anobject passes within thesensor's detection range. The signal is sent for processing, the output is understood by a microcontroller as an analogue

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 08 | Aug 2025 www.irjet.net p-ISSN: 2395-0072

or digital signal and the signal executed, followed by additional action. IR sensors are typically used for motion detection, obstacle detection, and proximity detection. IR sensors can be easily interfaced with controllers within 3.3V to 5V supply voltage that most IR sensors operate within for these types of projects using components such asArduinoorESP32.Onboardsensorcomponents,suchas insomemodules,youcanuseavariableresistortochange thesensitivityanddistanceofobjectsthataredetected.

The ESP 32:

The ESP32 microcontroller is perfect for automation and Internet of Things (IoT) projects because of its advanced features. Good wireless connectivity is provided by its dual-coreTensilica processoranddiagnosedbuilt-inWi-Fi andBluetooth.TheESP32hasgoodperformanceasasmall and cheap platform which can be used to develop smart systems. Its battery powered systems can sustain good batterylifeandandutilizeitsdeepsleepmodes.Therange of enclosures for ports and interfaces is broad, which can supporttoarangeofsensorsandactuators.Someofthese includeGPIO,ADC,DAC,UART,SPIandI²C.FortheESP32 microcontroller, there is a wide range of programming options, such as the standard Arduino IDE and MicroPython,alongwithESP-IDFenvironments.

Hardware Connections:

IR Sensor: VCC → 3.3V, GND → GND, OUT → GPIO 27

Relay Module: VCC → 5V, GND → GND, IN → GPIO 26

AC Light Bulb: Live wire → COM, NO → Bulb live terminal, Neutral wire → Bulb neutral terminal

3. SOFTWARE IMPLEMENTATION

The ESP32 microcontroller is programmed with the Arduino IDE based on its extensive board support and fairlyintuitiveinterface.Inthisprojectwewillbeusingthe ESP32 Heltec WiFi LoRa, with this setup the ESP32 will read a digital input from the infrared sensor, which could be either a motion or a object. Base on the output of the infrared sensor to toggle on/off the 5V relay module by ESP32.TherelayturnsONtheAClightbulbwhenmotionis detectedandOFFifisnotdetected.

4. RESULTS AND ANALYSIS

All of the indoor prototype testing was performed using several diverse light sources and environmental conditions. The light came on reliably upon motion detection with an average delay of less than 1 second. After a preset delay, when no further movement was detected, the light turned off automatically and did not consume unnecessary standby power. Many motion events were simulated in order to thoroughly test the systemthroughrepetition,anditperformedrobustlywith no flicker or false triggering observed. In the parameters oftesting,theinfraredsensorperformedasdesignedasit reliably detected movement at varying distances and speeds of motion. The prototype has demonstrated adequate qualities for real-time home and office applications, and was capable of being demonstrably functional and reliable and exhibit all of the desired qualities for motion sensitivity and smooth control of the ACconnectedlightbulb

figure -1:IRSensor
Fig -2:ESP-32
Fig -3: ConnectionDiagram

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 12 Issue: 08 | Aug 2025 www.irjet.net p-ISSN: 2395-0072

5. CONCLUSION

This paper shows how to use an ESP32 and an infrared sensortocreateastraightforwardandefficientautomated lighting system. The design can be further expanded for IoT-based remote monitoring and control, and it is dependable and reasonably priced. This work demonstrates how energy conservation issues can be addressedwithembeddedsystems.

REFERENCES

[1]EspressifSystems,“ESP32Datasheet,”2021

[2]Arduino–https://www.arduino.cc/en/software

[3]IRSensorModuleDatasheet

[4] Home AutomationUsing Microcontrollers – IEEE Paper,2020

Fig -4: Result

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Automated Light Control Using IR Sensor & ESP32 by IRJET Journal - Issuu