HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
Components and supplies
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 4 | |||
![]() |
| × | 10 |
Apps and online services
![]() |
|
About this project
This app uses LeapMotion and Arduino Uno to create a home automation system which controls the intensity of lighting of rooms. A home floor plan is mapped to the LeapMotion coordinates to determine a particular room. While palm position controls the lighting of a targeting room, raising or lowering the palm controls the intensity of lighting of the room.
InstructionInstall node.js
Install Leap Motion SDK
Install Cylon.js for Arduino and Leap Motion (Refer to useful links below)
or use the package.json to install all the required node modules
How to Runrun: node homebright-console.js (Refer to code section)
Useful Linkshttps://developer.leapmotion.com/
http://cylonjs.com/documentation/platforms/arduino/
http://cylonjs.com/documentation/platforms/leapmotion/
http://cylonjs.com/documentation/drivers/led/



Code
- homebright-console.js
- package.json
homebright-console.jsJavaScript
cylon robot which controls the LED lightingsnode homebright-console.js
"use strict";
var cylon = require("cylon");
cylon.robot({
connections: {
leapmotion: { adaptor: "leapmotion" },
arduino: { adaptor: "firmata", port: "COM7" }
},
devices: {
leapmotion: { driver: 'leapmotion' },
livingroom: { driver: "led", pin: 6, connection: "arduino" },
dininghall: { driver: "led", pin: 9, connection: "arduino" },
bedroom: { driver: "led", pin: 10, connection: "arduino" },
studyroom: { driver: "led", pin: 11, connection: "arduino" }
},
work: function(my) {
my.leapmotion.on("hand", function(hand) {
var on = hand.grabStrength > 0.5 ? false : true;
var x = hand.palmPosition[0];
var z = hand.palmPosition[2];
var value = 0;
if (on) {
value = hand.palmPosition[1];
}
console.log(value);
if(x > 0 && z > 0) { // living room
my.livingroom.brightness(value);
//my.livingroom.turnOn();
} else if (x > 0 && z < 0) { // dining hall
my.dininghall.brightness(value);
} else if (x < 0 && z > 0) { // study room
my.studyroom.brightness(value);
} else { // bedroom
my.bedroom.brightness(value);
}
});
}
}).start();
package.jsonJavaScript
node package config filenpm install
{
"name": "homebright-console",
"version": "1.0.0",
"dependencies": {
"cylon": "1.2.0",
"cylon-gpio": "0.27.0",
"cylon-i2c": "0.23.0",
"cylon-leapmotion": "0.20.0",
"serialport": "1.7.4",
"firmata": "0.5.5",
"cylon-firmata": "0.23.0"
}
}
Schematics


Manufacturing process
- Build a Bluetooth‑controlled Arduino Spybot
- FlickMote: Gesture‑Controlled IR Remote for Smart Home
- DIY Arduino TV B-Gone: Universal Remote for All TVs
- Build a Custom LED Master Clock with Alarm – Viewable from 12 Meters
- Find Me: Smart Item Locator with Arduino and Bluetooth
- Optimized Power Solutions for Arduino Projects
- Arduino Tic Tac Toe with MAX7219 LED Matrix and Cardboard Enclosure
- Build a Smart Arduino Quadruped Robot: Step‑by‑Step Guide
- Build a Custom Arduino Joystick Steering Wheel for Gaming
- Build a Fully Functional CNC Machine with Arduino Nano R3




