Animating a lamp with the Leap Motion


The Leap Motion is a very cool device, but so far we haven’t seen many applications of interacting with physical devices. [Xavier] wanted to control a cute servo animated desk lamp with his hands, and with the help of a Leap and an Arduino he was able to do just that.

The Leap Motion API has a handy feature that will output all its data over a websocket. It’s a very easy way to transfer hand positions with a minimum amount of overhead, and with just a little bit of Node.js, it’s only two lines of code to connect the Leap to a websocket server.

With the Leap data on a web server, the only thing left to do is pulling it down to an Arduino. Again, [Xavier] used Node.js, this time in the form of johnny five, a Javascript-based Arduino framework. After that, it was a simple matter of mapping the data from the Leap to servo movements in [Xavier]‘s Pixar-inspired lamp.

Video of the build below.


  1. I imagine this would be cool if you could tie it to OpenCV and get it to follow your pen tip around. Maybe it could be trained to follow an ir led on the top of the pen.

  2. AJ Jeromin says:

    This is beautiful work!
    You’ve just ruined my weekend (in a good way). I must try it!

  3. Pat says:

    Needed to do the pixar look up to the camera

  4. Snap your fingers to turn it on and then use your hand to move it where it needs to go. Cool hack.

    Could be useful if you hooked it up in your garage while working on the car.

  5. It’s like a Pixar JARVIS! I think this just sold me on the Leap Motion.

  6. Leap Motion をPCの操作にしか使わないなんてもったいない、と思わせる素敵な工作

  7. bty says:

    lol @ Node-isassemble Johnny-Five

  8. Carl Hage says:

    Gosh, Node.js lets you slap together javascript, web sockets, and piles of interface code libraries, so I guess this maximizes productivity if measured in code-MB/hour. Isn’t there a plain C API that might let you write a one page program to convert sensor readings to serial port IO (with no interpreters and special libraries)? I couldn’t find details on the Leap Motion API.

  9. dreamer says:

    > it’s only two lines of code to connect the Leap to a websocket server

    Eh, no.
    The Leap-software runs the websocket server and the Node.js code connects to it.

  10. parko says:

    would be cool if the lamp could point where your finger is pointing! That’s what I’d aim for

  11. Impulse405 says:

    would be fun to do if I had a leap motion. Oh wait, I dont because it got pushed back again

  12. Jimmy Spearman says:

    Hey, what IDE is he using?

  13. adam says:

    Pinokio’s sister.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 96,754 other followers