Home > Projects > Sensor – Transducer – Detector Projects > Gesture Controlled Interactive Desk Light

Gesture Controlled Interactive Desk Light

Summary of Gesture Controlled Interactive Desk Light


This article details the creation of a Gesture Controlled RGB Desk Light, an interactive project using an Arduino Uno and an IR sensor array. The system detects hand swipes to change LED colors, making it an educational tool for students. The build involves connecting eight IR sensors and a WS2812b LED strip to the microcontroller, followed by coding logic that processes sensor inputs to trigger color effects via the FastLED library.

Parts used in the Gesture Controlled RGB Desk Light:

  • Arduino Uno board
  • IR sensor Array (8 sensors)
  • WS2812b Addressable RGB LED
  • 5V, 2A power adapter

We all have seen different kinds of mood lamps & RGB light, most of them have some buttons or a remote to interact with them, but we thought of making a Gesture Controlled RGB Desk Lights which can change its colour only using a simple swipe gesture as a trigger. This is an interactive art project made using the Arduino uno board & IR array sensor. It’s a fun and easy project which can be taught to students & kids.

Let’s dive to the making portal.

Follow us on Instagram: Random stuff We Make! for more cool projects.

Step 1: Arrange the Material

All the material mentioned here is easily available in your local market as well as online stores.

  1. Arduino Uno
  2. IR sensor Array (8 sensors)
  3. WS2812b Addressable RGB LED
  4. 5V, 2A power adapter

Step 2: Introduction

This sensor is a simple array of multiple IR sensors (Proximity sensor). This array consists of 8 sensors which can give 8 different analog & digital outputs. In this project, we will use this sensor to identify the direction of motion of our hand & hence change the colours of LEDs in accordance with gestures. The Arduino board will take input from the sensor and change the colours of LEDs.

Attached here is an image of IR sensor array and the gestures associated with the code. The two simple gestures will be :

  1. Left Swipe
  2. Right Swipe

Check out the working of these gestures here :

Step 3: Making the Connections

There are few connections only, viz; (Refer to the connections from the circuit image)

IR Sensor Connections :

  1. Connect GND of IR line follower sensor to GND of Arduino.
  2. Connect VCC of IR line follower sensor to 5v of Arduino.
  3. Connect Digital Output of sensor A to Digital pin 4 of Arduino.
  4. Connect Digital Output of sensor B to Digital pin 5 of Arduino.
  5. Connect Digital Output of sensor C to Digital pin 6 of Arduino.
  6. Connect Digital Output of sensor D to Digital pin 7 of Arduino.
  7. Connect Digital Output of sensor E to Digital pin 8 of Arduino.
  8. Connect Digital Output of sensor F to Digital pin 9 of Arduino.
  9. Connect Digital Output of sensor G to Digital pin 10 of Arduino.
  10. Connect Digital Output of sensor H to Digital pin 11 of Arduino.

LED strip Connections :

  1. Connect GND of LED strip to GND Arduino.
  2. Connect 5V of LED strip to Vin of Arduino.
  3. Connect Data In of LED strip to Digital pin 3 of Arduino.

That’s all folks!

Step 4: Let’s Code It

The code attached here is complete.

Explanation :

The Code is simple, We are using one library named FAST LED to control the LED and giving it effects. Then 8 variables are declared using alphabets to store the data coming from sensors. The Number of LEDs in pixel strip is defined as 90(you can change this according to your setup) & data pin is defined as pin 3 of Arduino.

The void loop consists of 2 nested if loops which will check which of the sensors are turned on & hence glowing up/changing the colours of LEDs.

One Void Fadeall function is made to provide the Hue(Color) Changing effect.

Download the code from here & enjoy.

Follow us on Instagram: Random stuff We Make! for more cool projects.

Step 5: Some Pictures

This is how it looks.

Source: Gesture Controlled Interactive Desk Light

Quick Solutions to Questions related to Gesture Controlled RGB Desk Light:

  • What is the main purpose of this project?
    To create a mood lamp that changes color using simple swipe gestures as a trigger instead of buttons or remotes.
  • Which components are required to build this light?
    The project requires an Arduino Uno, an IR sensor array with 8 sensors, a WS2812b addressable RGB LED, and a 5V 2A power adapter.
  • How does the IR sensor array function in this setup?
    The array consists of 8 proximity sensors that provide analog and digital outputs to identify the direction of hand motion.
  • What specific gestures control the light colors?
    The two simple gestures used are a Left Swipe and a Right Swipe.
  • Which Arduino pins connect to the IR sensor outputs?
    Sensors A through H connect to Digital pins 4, 5, 6, 7, 8, 9, 10, and 11 respectively.
  • How is the LED strip connected to the Arduino?
    The GND connects to Arduino GND, the 5V connects to Vin, and the Data In connects to Digital pin 3.
  • What software library is used to control the LEDs?
    The code uses the FAST LED library to control the LEDs and apply various effects.
  • Can the number of LEDs be adjusted in the code?
    Yes, the number of LEDs defined in the code can be changed according to your specific setup.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top