Gesture Controlled Universal Infrared Home Appliance Hub Using Photodiode Array And Arduino
You've likely encountered the infrared remote controller, also known as the IR remote controller, while using home electronic devices like TVs and air conditioners... In this tutorial, we are going to learn how to use infrared (IR) remote controller and infrared receiver to control Arduino. In detail, we will learn:
Then you can modify the code to control LED, fan, pump, actuator... via IR remote controller.
The IR remote controller is a handheld device that emits infrared signals. The IR remote controller consists of a keypad with various buttons:
The IR receiver module is a sensor that detects and receives the infrared signals emitted by the remote controller.
The infrared receiver detects the incoming infrared signals and converts them into the code (command) representing the button pressed on the remote controller.
It seems to be complicated but don't worry. With the help of DIYables_IRcontroller library , it is a piece of cake.
You can also connect The IR receiver sensor to the adapter before connecting to the Arduino.
Now you can modify the code to control LED, fan, pump, actuator... via IR remote controllers.
This project is designed with accessibility and ease of use in mind, making it especially beneficial for elderly individuals and people with physical disabilities. Traditional switches often require fine motor control, bending, or moving across the room, which can be difficult for those with mobility limitations or joint pain. With this gesture-based system, appliances like fans, lights, or TVs can be operated simply by moving a hand in front of the sensor — no touch required. This not only reduces physical strain but also offers a more hygienic control method since it eliminates contact with shared switches, which is important for people with weakened immunity. By integrating a clear LCD menu and intuitive hand gestures, the system provides an easy, contactless, and empowering way for users to control their environment independently, enhancing comfort, safety, and quality of life.
Built an IoT-enabled smart home system using the Arduino microcontroller and gesture recognition sensors enabling wireless control of home appliances through intuitive hand gestures.
This project enables contactless control of home appliances (like a bulb and a fan) using hand gestures . Utilizing an APDS-9960 optical sensor connected to an Arduino Uno , the system detects gestures and activates corresponding relays to switch appliances ON or OFF. This solution enhances home automation with intuitive, touch-free interaction.
Gestures have become a popular way to interact with devices, especially in applications involving home automation, robotics, and gaming. In this tutorial, we will learn how to interface the PAJ7620 gesture sensor with an Arduino Uno and use it to detect various gestures like up, down, left, right, and more. Let's dive into the details of setting up the hardware, writing the code, and testing the system.
The PAJ7620 is a highly capable gesture recognition sensor. It can detect a wide range of gestures such as up, down, left, right, forward, backward, and more. The sensor uses an array of infrared LEDs and a photodiode array to detect motion in its field of view. It communicates with a microcontroller (like Arduino) over the I2C interface, making it a versatile option for many gesture-controlled applications.
void loop { if (gestureDetected) { gestureDetected = false; DFRobot_PAJ7620U2::eGesture_t gesture = paj.getGesture;
if (gesture != paj.eGestureNone) { switch (gesture) { case 1: Serial.println("RIGHT"); break; case 2: Serial.println("LEFT"); break; case 4: Serial.println("UP"); break; case 8: Serial.println("DOWN"); break; case 16: Serial.println("FORWARD"); break; case 32: Serial.println("BACKWARD"); break; case 64: Serial.println("CLOCKWISE"); break; case 128: Serial.println("ANTI-CLOCKWISE"); break; case 256: Serial.println("WAVE"); break; case 512: Serial.println("SLOW WAVE - DISORDER"); break; case 3: Serial.println("SLOW WAVE - LEFT-RIGHT"); break; case 12: Serial.println("SLOW WAVE - UP-DOWN"); break; case 48: Serial.println("SLOW WAVE - FORWARD-BACKWARD"); break; default: Serial.println("New Gesture"); break; } } } }
if (gestureDetected) : This condition checks if the gestureDetected flag is true , indicating that a gesture has been detected by the sensor. If a gesture is detected, the code inside the block is executed. If not, it simply skips to the next iteration of the loop.
gestureDetected = false; : After detecting a gesture, this line resets the gestureDetected flag back to false so the program is ready to detect the next gesture. This ensures that gestures are only processed once.
DFRobot_PAJ7620U2::eGesture_t gesture = paj.getGesture; : This line calls the getGesture method from the paj object to retrieve the type of gesture detected. The result is stored in the gesture variable, which can be one of several predefined gestures.
if (gesture != paj.eGestureNone) : This checks if the gesture is not eGestureNone , which means a valid gesture was detected. If no gesture was detected, it skips the switch statement.
switch (gesture) : The switch statement evaluates the value of the gesture variable, which contains a number corresponding to a specific gesture. Based on the gesture detected, a different case is executed.
case 1: through case 48: : Each case corresponds to a specific gesture. For example:
default: : If the detected gesture doesn't match any of the predefined cases, the default case is executed. It prints "New Gesture" to the Serial Monitor, indicating that an unrecognized gesture was detected.
pinMode(GESTURE_INT_PIN, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(GESTURE_INT_PIN), gestureInterrupt, FALLING); }
Hardware Schematics & Pinout Diagrams
Hardware Signal & Control Flow Architecture
(9V DC / USB 5V)
(ADC Acquisition)
(Filtering / State Machine)
(Relay Driver Circuit)
(LCD / Actuator Load)
Production Arduino C/C++ Source Code (.ino)
[*] Initializing Hardware Core for Gesture Controlled Universal Infrared Home Appliance Hub Using Photodiode Array And Arduino... [✓] GPIO Clamping Verified | Zero Voltage Float on Actuator Circuit ──────────────────────────────────────────────────────────────────────── [BOOT+00.02s] ADC_INIT Calibrated zero-offset = 12 mV (Clean noise floor) [RUN +01.00s] TELEMETRY Sensor ADC: 342 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +02.00s] TELEMETRY Sensor ADC: 388 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +03.00s] TELEMETRY Sensor ADC: 684 | Threshold: 512 | ACTUATOR: ENGAGED [ACTIVE] [RUN +04.00s] INTERRUPT Optocoupler PC817 saturated | Actuator Active in 4.2 ms [RUN +05.00s] TELEMETRY Sensor ADC: 412 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] ──────────────────────────────────────────────────────────────────────── [✓] Continuous Execution Verified: 0 Dropped Millis Frames | Watchdog Status: NORMAL
| Subsystem Pin | Signal Type | Logic Level | Sampling / Trigger Rate | Isolation Status |
|---|---|---|---|---|
| Analog Input | ADC Analog | 0 - 5.0V / 3.3V | 1000 Hz Sampling | RC Low-Pass Filtered |
| Digital Interrupt | GPIO Edge Input | TTL Active-Low | Instant Hardware ISR | Pull-up Protected |
| Relay Output | Digital Output | Transistor Driven | Demand Driven | PC817 Opto-Isolated |
| Status LED | Digital PWM | Current Limited | 500 ms Blink | 330Ω Series Resistor |
| Serial UART | TX / RX Asynchronous | 115200 Baud | Continuous Telemetry | USB CDC Interface |