Gesture Controlled Interactive Desk Light
by Random Stuff We Make in Circuits > Arduino
5040 Views, 19 Favorites, 0 Comments
Gesture Controlled Interactive Desk Light
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.
Arrange the Material
All the material mentioned here is easily available in your local market as well as online stores.
- Arduino Uno
- IR sensor Array (8 sensors)
- WS2812b Addressable RGB LED
- 5V, 2A power adapter
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 :
- Left Swipe
- Right Swipe
Check out the working of these gestures here :
Making the Connections
There are few connections only, viz; (Refer to the connections from the circuit image)
IR Sensor Connections :
- Connect GND of IR line follower sensor to GND of Arduino.
- Connect VCC of IR line follower sensor to 5v of Arduino.
- Connect Digital Output of sensor A to Digital pin 4 of Arduino.
- Connect Digital Output of sensor B to Digital pin 5 of Arduino.
- Connect Digital Output of sensor C to Digital pin 6 of Arduino.
- Connect Digital Output of sensor D to Digital pin 7 of Arduino.
- Connect Digital Output of sensor E to Digital pin 8 of Arduino.
- Connect Digital Output of sensor F to Digital pin 9 of Arduino.
- Connect Digital Output of sensor G to Digital pin 10 of Arduino.
- Connect Digital Output of sensor H to Digital pin 11 of Arduino.
LED strip Connections :
- Connect GND of LED strip to GND Arduino.
- Connect 5V of LED strip to Vin of Arduino.
- Connect Data In of LED strip to Digital pin 3 of Arduino.
That's all folks!
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.
Some Pictures
This is how it looks.