Control RGB LEDs With the Wave of Your Hand.

Introduction: Control RGB LEDs With the Wave of Your Hand.

About: TangibleTec helps you bring your ideas to life. Draw on our experience in Mechanical, Electrical, and Software Engineering to provide you with the concept, design, or product you need to make your idea a reali…


We were invited to help out at our local elementary school's STEM night, and needed a cool demonstration, with little time to prepare.

So, we looked through the tech we had laying around, and came up with the idea of using the LeapMotion hand tracking sensor, to control the color and intensity of RGB lights.

There is no better way to get kids excited about science, technology, engineering, and math, than having a fun and interactive hands on example.

Note: The following lists are parts closest to what we used for our setup.

Bill of materials (BOM)

LeapMotion + RGB LEDs List

  1. Leapmotion - $50 (,
  2. Arduino Uno or similar - $25 (,
  3. Darlington Driver ULN2803 - $2 (,
  4. Arduino Proto Shield or similar - $5 (
  5. RGB LED light strip - $15 (,
  6. 12V DC Adapter - $5 (,
  7. A computer of some sort that can run the Leapmotion SDK and Python.
    We used a Windows 10 Pipo mini computer.


  1. LeapMotion SDK
  2. Python
  3. Arduino Software

Let's get started!

Step 1: Installing Software

On your computer of choice, install the following:
(Our setup was on a Windows 10 home 32-bit PC)

  1. Python -
    • Download and follow the install instructions
    • Then open command and install pyserial (pip install pyserial)
  2. Arduino Software -
  3. LeapMotion Software-
    1. Extract the zip file
    2. Install the Leap_Motion_Installer_.exe
    3. Copy or move the LeapSDK folder to the C:\ drive
      • This is referenced by the python script.

Without the lights connected download and run ""
(Double click to run)

This is to be sure everything is installed correctly.

If everything configured without a hitch, then your script should look like the screenshot above.

If you should have any errors, take a look at the Troubleshooting step for some helpful tips.

Now we just need to add the lights.

Step 2: Building the LED Controller

To control a 12V RGB LED strip with an Arduino, we will need to build a simple circuit.

Lucky for us, this can be accomplished with a single chip, the ULN2803. (datasheet)
We don't need to add any resistors, since our RGB LED strip already has them built in.

We'll need to supply 12V to pins 9 and 10.

  • Pin 9 - GND, 12V negative side
  • Pin 10 - 12V positive side

Also, be sure to tie the ULN2803 chip's and the Arduino's grounds together.

Then pins 1-8 can be used as PWM inputs from an arduino, and pins 11-18 can be used as the common sink for your 12V - 30V device.

OPTION 1: Using a Breadboard

Most RGB LED light strips have a header that can be directly plugged into a breadboard.

Follow the wiring diagram above.

Tools Needed

  • Breadboard
  • Jumper wires

OPTION 2: Building an arduino shield

A protoboard can be used to create a robust, and permanent arduino shield.
This is what we did, except we used a scrap xbee shield we picked up from Sparkfun.
The wiring diagram above shows how this can be done.

Tools Needed

  • Soldering Iron + Solder
  • Wire
  • Wire Strippers


You may have noticed that we are only using 3 pins out of the 8 available.
To make more use of the chip, you could drive two RGB LED strips at once.
Or, If you need to drive a device with a little more current, then you can double up pins (run in parallel).

For additional help on using the ULN2803 chip, check out RU4Realz Instructable:

Step 3: Putting It All Together

Make sure the LeapMotion sensor and the Arduino are plugged into your computer.

Also make sure the RGB LED light strip is plugged into the control circuit, and that the 12V power is connected.

Finally, we can start the script and have some fun!

Step 4: Troubleshooting

This step is intended to help users solve common problems that they might encounter.

Right now, we aren't sure what to put here, but we are sure it will be needed in the future.

So feel free to reach out to us with any problems that you might have, and we will add to this step as needed.

Sensors Contest 2016

Participated in the
Sensors Contest 2016

1 Person Made This Project!


  • Battery Powered Contest

    Battery Powered Contest
  • Plywood Challenge

    Plywood Challenge
  • Plastic Contest

    Plastic Contest

3 Discussions


9 months ago on Step 1

Hello i downloaded python but when i double click to open the python file it just opens the windows and closes it immediately.What do i do about that? I really wanna try this out with 4 projectors and change their light depending on the hand position.

DIY Hacks and How Tos

Cool motion sensor. I wonder if you could use this kind of sensor to make a kind of theremin.