Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Projects
  3. ›Motion, remote and gesture light

Relay & control projects

Motion-sensing night light with IR remote and hand-gesture control

The light turns on when someone walks in, and you can switch modes with any TV-style remote or a wave of your hand.

By Geekobot Learning Team

Beginner
Difficulty
2 hours
Build time
₹1,735
Parts cost
14
Parts
Arduino
Platform
Add all parts · ₹1,735Start building
  • Home automation
NANO
Tap a part to see what it does
OverviewPartsWiringBuildCodeTroubleshootFAQIdeas

What you'll build

This light combines three ways of control. A mini PIR sensor turns it on when it sees movement. An IR receiver lets a cheap remote choose always-on, auto or off. A PAJ7620 gesture sensor reads a hand wave up or down to change the brightness. The Nano drives a strip of LEDs through a relay module, or a 12 V LED strip if you use a MOSFET.

What you'll learn

  • How PIR motion sensors work
  • Decoding NEC IR remotes
  • Reading a gesture sensor over I2C
Safety

Use 12 V LED lighting while learning; mains wiring is for qualified electricians only.

  1. SensePIR, IR remote and hand gestures
  2. ThinkNano picks the mode
  3. ActRelay switches the light

Parts list

Tick anything you already have and the total updates.

PartQtyPrice
  • NANO
    Nano CH340 Development Board (Soldered)
    GB-SBCD-0339Guide

    Runs the modes

    × 1₹185₹185
  • HC-SR505 Mini PIR Motion Sensor Infrared Detector Module
    GB-SENS-1960Guide

    HC-SR505 mini PIR motion sensor

    × 1₹77₹77
  • Generic Infrared IR Receiver Module for Arduino – 38kHz TSOP1838 Sensor
    GB-SENS-1958

    38 kHz TSOP1838 IR receiver module

    × 1₹23₹23
  • Generic IR Remote Control (21-Button, CR2025)
    GB-IOWC-1634

    21-button NEC IR remote

    × 1₹46₹46
  • PAJ7620U2 Gesture Recognition Sensor Module – I2C Interface, 3.3V/5V
    GB-SENS-3275

    PAJ7620U2 gesture sensor, I2C

    × 1₹669₹669
  • RELAY
    5V Relay Module with Optocoupler
    GB-SWRL-0001Guide

    Relay module for the lamp

    × 1₹74₹74
  • GR BISS0001 Infrared Pyroelectric Human Body Sensing Sensor Controller SOP-16
    GB-SENS-0176

    BISS0001 PIR controller IC for building your own PIR board

    × 1₹26₹26
  • Senba D203B TO-5-3 Human Body Sensing Sensor ROHS
    GB-SENS-0171

    Bare pyroelectric element to pair with the BISS0001

    × 1₹49₹49
  • Senba D204B Active PIR Motion Sensor with EMI Pyroelectric Infrared Detector
    GB-SENS-1864Guide

    Larger PIR module with a longer range

    × 1₹51₹51
  • HS-S43A Touch Sensing Sensor Module – PH2.0 Terminal, Switch/Button Mode
    GB-SENS-0150

    Touch pad as a fourth way to switch the light

    × 1₹68₹68
  • 12V 3A Touch Sensor Switch with Dimmer for Mirror Light
    GB-SWRL-0083

    Ready-made 12 V touch dimmer switch for mirror lights

    × 1₹111₹111
  • 5V 1-Channel Relay Module w/ IR Remote Control
    GB-IOWC-1535

    All-in-one IR remote relay if you do not want to program anything

    × 1₹289₹289
  • Solderless Breadboard
    GB-PROT-0001Guide

    Holds the parts without soldering

    × 1₹18₹18
  • Dupont Jumper Wires (40 pcs)
    GB-WIRE-0001Guide

    Connects the parts

    × 1₹49₹49

Complete kit

14 of 14 parts in one tap

₹1,735

GST included

3% off these parts while the whole kit stays in your cart

Parts you still need

₹1,735

14 of 14 parts. Tick anything you already have.

About ₹52,050 before bulk pricing for 30 kits.

Request bulk quote

Learn the parts

  • ESP32 vs Arduino Uno
  • Mini PIR Motion Sensor Modules
  • 5V, 12V and 24V Relay Modules (1 to 16 Channel)
  • Pyroelectric PIR Sensor Elements
  • Arduino Uno

Calculators for this build

  • RL time constant calculator
  • Transistor base resistor calculator
  • GPIO pin current budget calculator

Wiring

Follow the colours: red is power, dark grey is ground, blue is a signal.

PartPinConnect toNote
PIROUT / + / −D2 / 5V / GNDHigh for a few seconds after motion
IR receiverS / + / −D11 / 5V / GND
PAJ7620SDA / SCL / VCC / GNDA4 / A5 / 5V or 3.3V (check the board) / GND
Relay moduleIN / VCC / GNDD7 / 5V / GND
  • PIROUT / + / − → D2 / 5V / GNDHigh for a few seconds after motion
  • IR receiverS / + / − → D11 / 5V / GND
  • PAJ7620SDA / SCL / VCC / GND → A4 / A5 / 5V or 3.3V (check the board) / GND
  • Relay moduleIN / VCC / GND → D7 / 5V / GND
Built it? Check your wiring before you power up.Pick the pin each wire went to and we'll point out swapped pins, power mistakes and pins that clash.

Step-by-step build

0 of 5 done

Code

motion_light.inoVerify & upload in Electrolark
#include <IRremote.hpp>
#include <RevEng_PAJ7620.h>
RevEng_PAJ7620 gesture;

const int PIR = 2, IR_PIN = 11, RELAY = 7;
const uint8_t CMD_ON = 0x45, CMD_AUTO = 0x46, CMD_OFF = 0x47;   // replace with your remote's codes
enum Mode { AUTO, ON, OFF } mode = AUTO;
unsigned long lastMotion = 0;
const unsigned long HOLD = 30000UL;

void setup() {
  Serial.begin(115200);
  pinMode(PIR, INPUT); pinMode(RELAY, OUTPUT);
  IrReceiver.begin(IR_PIN, ENABLE_LED_FEEDBACK);
  if (!gesture.begin()) Serial.println("Gesture sensor not found");
}

void loop() {
  if (IrReceiver.decode()) {
    uint8_t c = IrReceiver.decodedIRData.command;
    Serial.print("IR command 0x"); Serial.println(c, HEX);
    if (c == CMD_ON) mode = ON; else if (c == CMD_AUTO) mode = AUTO; else if (c == CMD_OFF) mode = OFF;
    IrReceiver.resume();
  }
  Gesture g = gesture.readGesture();
  if (g == GES_UP) mode = ON;
  if (g == GES_DOWN) mode = OFF;
  if (g == GES_CLOCKWISE) mode = AUTO;

  if (digitalRead(PIR) == HIGH) lastMotion = millis();
  bool on = mode == ON || (mode == AUTO && millis() - lastMotion < HOLD);
  digitalWrite(RELAY, on ? HIGH : LOW);
  delay(20);
}

Run it: what this code does

The sketch above runs here on a simulated Arduino Nano. Move the sliders for the sensors and buttons it reads, and watch the Serial monitor, display and outputs change.

Troubleshooting

Light turns on by itself+

PIRs react to warm air; move it away from heaters, fans and windows.

Remote does nothing+

Check the command numbers in the Serial Monitor; every remote is different.

Gesture sensor not found+

Check SDA/SCL and the supply voltage; the PAJ7620 address is 0x73.

FAQ

Can it switch a mains lamp?+

Only inside a closed, earthed enclosure installed by a qualified electrician. Use a 12 V LED lamp for learning.

Why does the PIR need a minute after power-up?+

PIR sensors settle for up to a minute before they detect reliably.

Can I use any TV remote?+

Most remotes work with IRremote; the codes just differ.

What parts do I need to build the motion-sensing night light with IR remote and hand-gesture control?+

14 parts: Nano CH340 Development Board (Soldered), HC-SR505 Mini PIR Motion Sensor Infrared Detector Module, Generic Infrared IR Receiver Module for Arduino – 38kHz TSOP1838 Sensor, Generic IR Remote Control (21-Button, CR2025), PAJ7620U2 Gesture Recognition Sensor Module – I2C Interface, 3.3V/5V, 5V Relay Module with Optocoupler, GR BISS0001 Infrared Pyroelectric Human Body Sensing Sensor Controller SOP-16, Senba D203B TO-5-3 Human Body Sensing Sensor ROHS, Senba D204B Active PIR Motion Sensor with EMI Pyroelectric Infrared Detector, HS-S43A Touch Sensing Sensor Module – PH2.0 Terminal, Switch/Button Mode, plus 4 more. On this page you can tick the parts you already have and add only the rest to your cart.

How hard is it and how long does it take?+

It is a beginner project and takes about 2 hours. The build on this page has 5 steps.

Do I need to write the code myself?+

No. This page has the complete, tested code (motion_light.ino).

Can I see what the code does before I build it?+

Yes. The Run it panel under the code runs this exact sketch on a simulated board. Move the sliders or press the buttons for the sensors it reads, and the Serial monitor, display and outputs react as they will on the real build. It is a simulation, so real readings depend on your parts and wiring.

How much does the motion-sensing night light with IR remote and hand-gesture control cost to build?+

About ₹1,735 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.

What will I learn from this project?+

How PIR motion sensors work; Decoding NEC IR remotes; Reading a gesture sensor over I2C.

What can I build next with these parts?+

Ideas that reuse this build: BLE beacon presence light. They are listed under Take it further on this page.

Take it further

  • BLE beacon presence light

Related projects

  • UNORELAYDC
    Relay & control
    Beginner· 45 minutes

    Automatic dusk-to-dawn light

    Lights switch on by themselves at dusk and off again in the morning.

    ₹626 · 7 partsArduino
  • UNORELAY23.5°C 61%STATUS OK
    Relay & control
    Intermediate· 2 hours

    Aquarium heater controller

    A precise thermostat that keeps tropical fish at a steady 25–26 °C.

    ₹588 · 8 partsArduino
  • UNORELAY23.5°C 61%STATUS OK
    Relay & control
    Intermediate· 3 hours

    Automatic water tank pump controller

    Starts the pump when the tank runs low and stops it when it is full.

    ₹754 · 7 partsArduino
  • NANORELAYDC
    Relay & control
    Beginner· 45 minutes

    Touch lamp switch

    Tap a hidden pad to switch a lamp on or off, even through a wooden desk.

    ₹544 · 6 partsArduino

Learning project. Check every circuit and the datasheet of each part before you power it up.

Run itChange the inputs and watch the output
Relay module IN / VCC / GND (D7) ON
Serial monitor115200 baud
 

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question Share your build