DOI : 10.5281/zenodo.23256514
- Open Access
- Authors : Harshal Suresh Chaudhari
- Paper ID : IJERTV15IS100192
- Volume & Issue : Volume 15, Issue 10 , October – 2026
- Published (First Online): 09-10-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Universal Flexi Switch: A Dual-Mode IR and RF- Based Home Automation System
Harshal Suresh Chaudhari
Department of Electronics Engineering, Dhule Maharashtra, India
Abstract – Home automation has become an important part of modern living by providing convenient, reliable, and efficient control of electrical appliances. Conventional switching systems often require manual operation, rely heavily on cloud infrastructure, or lack flexibility. To overcome these limitations, this paper presents the design and development of the Universal Flexi Switch. This smart embedded system controls multiple appliances using both Infrared (IR) and 433 MHz Radio Frequency (RF) remote controls entirely offline. Built around the ATmega328P microcontroller, the system features a user-friendly "Learning Mode" that lets users assign any compatible IR remote button to any relay channel without modifying the firmware. All learned codes are securely stored in the internal EEPROM, preserving configurations across power failures. The hardware incorporates a custom-designed relay driver circuit, RF repeat-filtering algorithms, and a dedicated Printed Circuit Board (PCB). Experimental results confirm robust dual-band control, low latency, and highly reliable non-volatile memory retention.
KeywordsHome Automation, ATmega328P, Radio Frequency (RF), Infrared (IR), EEPROM, Relay Control.
-
INTRODUCTION
The rapid development of embedded systems and wireless communication technologies has increased the demand for reliable, economical, and user-friendly home automation systems. Conventional automation solutions often depend on Wi-Fi, Internet connectivity, cloud services, or mobile applications, which may reduce reliability during network failures and increase system complexity and cost. This paper presents the design and implementation of the Universal Flexi Switch, a standalone embedded home automation system developed for controlling four independent electrical appliances using both 433 MHz Radio Frequency (RF) and Infrared (IR) remote-control technologies.
The proposed system is based on the ATmega328P microcontroller, which manages wireless signal processing, relay control, IR learning, EEPROM storage, and status indication. The RF section uses predefined command codes to control the four relay outputs. The IR section incorporates a Learning Mode, allowing users to assign compatible IR remote buttons to the desired relay outputs without modifying the firmware.
-
LITERATURE REVIEW
-
Home Automation and Communication Protocols: Home automation utilises embedded microcontrollers and wireless communication protocols to manage domestic electrical loads. Existing deployments primarily adopt communication media such as Infrared (IR), Radio Frequency (RF), Bluetooth, Wi-Fi, ZigBee, and GSM. However, modern network-dependent systems often present operational limitations, including continuous Internet reliance, vulnerability to latency, elevated implementation costs, and rigid remote-control mapping architectures.
-
Infrared (IR) Communication: Infrared transmission remains a widely adopted, cost-effective standard for short-range line-of-sight consumer electronics. IR systems utilise dedicated demodulating
receivers, such as the TSOP1738, tuned to specific carrier frequencies (typically 38 kHz) to filter ambient optical noise. The primary limitation is its strict requirement for an unobstructed optical path.
-
Sub-1 GHz Radio Frequency (RF) Control: Radio Frequency communication in the sub-1 GHz Industrial, Scientific, and Medical (ISM) bandsparticularly 433.92 MHzovercomes line-of-sight constraints, facilitating non-line-of-sight indoor propagation through structural obstacles. Low-cost ASK/OOK RF implementations typically rely on static payload structures and are prone to unhandled frame repetition without software-level filtering.
-
Proposed Architecture: Conventional low-cost switching modules typically enforce rigid single-protocol constraints (exclusively IR or exclusively RF) with fixed factory bindings. A completely offline, low-latency, dual-medium switching architecture is still needed that pairs fixed RF long-range control with dynamically learned, user- configurable IR command mapping backed by permanent non- volatile storage.
-
-
HARDWARE DESIGN AND CIRCUIT
ANALYSIS
The hardware design forms the core of the Universal Flexi Switch. It integrates an ATmega328P microcontroller, a TSOP1738 IR receiver, a 433 MHz RF module, an LM7805 voltage regulator, and electromagnetic relays on a custom Printed Circuit Board (PCB) designed using KiCad. The hardware is divided into several functional blocks:
-
Power Supply Circuit: The system accepts a 12 V DC input through a barrel connector, which is regulated to a stable 5 V DC using an LM7805 linear voltage regulator to safely power the logic components. Input and output filtering capacitors are utilised to suppress switching noise and voltage ripples, while an LED indicates power status.
-
Microcontroller and Clock Circuit: The central processing unit is the ATmega328P microcontroller, operating at 16 MHz. This is driven by an external crystal oscillator coupled with two 22 pF stabilising capacitors connected to ground. A 10 k pull-up resistor is connected to the RESET pin to ensure stable operation. The microcontroller processes interrupt-driven IR and RF signals, manages EEPROM read/write cycles, and executes relay control logic.
-
Wireless Receiver Modules: Infrared Receiver: A TSOP1738 module detects 38 kHz modulated signals from standard IR remotes. Its internal demodulator removes the carrier frequency and sends clean digital pulses directly to the microcontroller's interrupt pin. Radio Frequency Receiver: A 433 MHz ASK/OOK receiver module captures non-line-of-sight RF commands. The digital output is connected to a dedicated interrupt pin, enabling long-range and wall- penetrating control.
-
Relay Driver and Flyback Protection: Because the ATmega328P GPIO pins cannot supply sufficient current to directly energise electromechanical relay coils, BC547 NPN transistors are used as
drivers. When the microcontroller outputs a HIGH signal, the transistor enters saturation, energising the relay to switch the AC load. To protect the microcontroller and transistors from the high- voltage inductive spikes generated when the relay coil de-energises, a 1N4007 flyback diode is connected in reverse-bias across each relay coil.
-
-
SOFTWARE DESIGN AND
IMPLEMENTATION
-
Firmware Architecture: The embedded firmware was developed in Embedded C using the Arduino IDE and flashed to the ATmega328P using a USBasp programmer. The software architecture is modular, utilising the IRremote library for IR protocol decoding, the RCSwitch library for RF signal processing, and the standard AVR EEPROM library for non-volatile storage.
-
IR Learning and Signal Filtering: The software includes a custom RF debounce and filtering algorithm to ignore redundant signal transmissions, preventing rapid, unintended relay toggling. The system's Learning Mode is triggered via a physical push-button. Once activated, the firmware captures the next valid IR code received and permanently writs it to a designated EEPROM address. This ensures the user's remote configuration persists across power failures without requiring hard-coded source modifications or reprogramming.
-
-
RESULTS AND DISCUSSION
-
Prototype Development and Testing: The proposed Universal Flexi Switch was successfully implemented using the ATmega328P microcontroller and a custom PCB designed in KiCad. The assembled prototype includes the ATmega328P, TSOP1738 IR receiver, 433 MHz RF receiver, four relay driver circuits, LM7805 voltage regulator, crystal oscillator, LEDs, push button, and supporting passive components. Following assembly, visual inspection and continuity testing verified component placement and electrical connections.
-
Power Supply and Controller Testing: The power supply was tested using a 12 V DC input. The LM7805 regulator successfully provided a stable 5 V regulated output for the ATmega328P and low- voltage logic components. The ATmega328P successfully initialised after power-up, with the 16 MHz crystal oscillator providing the required system clock.
-
Communication and Learning Mode: Both wireless communication sections were tested independently. The TSOP1738 successfully detected transmitted 38 kHz signals, and the 433 MHz module captured RF commands reliably. The IR Learning Mode was validated by assigning arbitrary IR remote buttons to the four relay outputs. When the Learning button was pressed, the controller entered learning mode, and the status LED provided visual feedback.
-
Memory Retention and Actuation: To verify non-volatile memory reliability, the system's power was completely disconnected. Upon restoring power, the EEPROM successfully retained the learned IR configurations, confirming that users do not need to repeat the learning process after a power outage. Finally, the transistor-based relay driver circuits accurately switched high-power AC loads without causing controller resets, validating the effectiveness of the 1N4007 flyback protection diodes.
Fig. 1. Fully assembled hardware prototype of the Universal Flexi Switch, showcasing the custom PCB, ATmega328P microcontroller, four-channel relay outputs, and dual-band (IR/RF) wireless receiver modules.
-
-
CONCLUSION
The Universal Flexi Switch was successfully implemented and validated as a low-cost, standalone home automation platform for four-channel appliance control. Powered by an ATmega328P microcontroller on a custom PCB, the system integrates dual-band 433 MHz RF and 38 kHz Infrared (IR) decoding alongside transistor- driven relay outputs and regulated power distribution. Key features include predefined, non-line-of-sight RF switching paired with an on- board IR Learning Mode to map arbitrary IR remote buttons without firmware modification. The system stores learned IR profiles in internal EEPROM, preserving configuration states across power interruptions, while firmware-level debounce algorithms suppress false triggers from repeated frame transmissions. Ultimately, the system operates completely offline without reliance on Wi-Fi or cloud infrastructure, delivering a compact, noise-immune, and cost- effective local switching solution.
-
REFERENCES
-
Microchip Technology Inc., "ATmega328P: 8-bit AVR Microcontroller with 32K Bytes In-System Programmable Flash Datasheet," Microchip Technology Inc., Chandler, AZ, USA, Doc. DS40002061B, 2018.
-
Arduino, "Arduino IDE 2.0 Documentation and Reference," Arduino Docs, 2024. [Online]. Available: https://docs.arduino.cc/software/ide-v2.
-
Arduino, "EEPROM Library for AVR-based Microcontrollers," Arduino Reference, 2023.
-
Arduino-IRremote Team, "IRremote: Infrared Remote Library for Arduino," GitHub Repository, 2023.
-
sui77, "rc-switch: Arduino Library to Operate 315/433 MHz Devices," GitHub Repository, 2023.
-
Vishay Semiconductors, "TSOP17.. Series: Photo Modules for PCM Remote Control Systems," Vishay Intertechnology, Inc., Malvern, PA, USA, Doc. No. 82030, Rev. 6, 2004.
-
Texas Instruments, "LM78xx Series Positive Voltage Regulators Datasheet," Texas Instruments Inc., Dallas, TX, USA, Doc. SLVS056N, 2020.
-
Nexperia, "BC547 / BC548 / BC549 NPN General Purpose Transistors," Nexperia B.V., Nijmegen, Netherlands, Product Data Sheet, Rev. 7, 2021.
-
STMicroelectronics, "1N4001 to 1N4007 General Purpose Rectifier Diodes," STMicroelectronics, Geneva, Switzerland, DocID 5885, Rev. 3, 2012.
-
KiCad EDA Development Team, "KiCad: A Cross-Platform Open Source Electronics Design Automation Suite," KiCad Documentation, 2024.
-
M. Banzi and M. Shiloh, Getting Started with Arduino: The Open Source Electronics Prototyping Platform, 4th ed., Sebastopol, CA, USA: Maker Media, 2022.
-
M. Barr and A. Massa, Programming Embedded Systems: With C and GNU Development Tools, 2nd ed., Sebastopol, CA, USA: O'Reilly Media, 2006.
-
Microchip Technology Inc., "AVR042: AVR Microcontroller Hardware Design Considerations," Application Note, Microchip Technology Inc., Doc. DS00002519A, 2017.
-
Atmel Corporation, "AVR101: High Endurance EEPROM Storage," Application Note, Atmel Corp., San Jose, CA, USA, Doc. 2526A-AVR- 04/02, 2008.
-
Arduino, "Arduino Uno Rev3 Technical Reference and Pinout Manual," Arduino Hardware Documentation, 2023.
-
S. Chaudhari, "Technical Guidance and Practical Inputs on Embedded Hardware, Relay Driver and RF/IR Interface Design," BM Electronics, Nashik, India, personal communication, Jan. 2026.
-
S. M. Rajput, "Technical Guidance and Academic Support for Universal Flexi Switch Project," Department of Electronics Engineering, personal communication, Feb. 2026.
-
Arduino, "Installing Additional Libraries in Arduino IDE," Arduino Help Centre, 2023.
-
sui77, "rc-switch Documentation, Protocol Analysis and Timing Specifications," GitHub Wiki, 2022.
-
Arduino-IRremote Team, "Supported Protocols, Encoding Formats and Timing Tolerances for IR Remote Decoding," GitHub Documentation, 2023.
