Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO

Components and supplies

HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
Arduino UNO
×1
HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
Leap Motion Controller
×1
HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
LED (generic)
×4
HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
Jumper wires (generic)
×10

Apps and online services

HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
Arduino IDE

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. 

Instruction

Install 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 Run

run:  node homebright-console.js (Refer to code section)

https://developer.leapmotion.com/

http://cylonjs.com/documentation/platforms/arduino/

http://cylonjs.com/documentation/platforms/leapmotion/

http://cylonjs.com/documentation/drivers/led/

HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO
HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO

Code

  • homebright-console.js
  • package.json
homebright-console.jsJavaScript
cylon robot which controls the LED lightings
node 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 file
npm 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

HomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNOHomeBright: Smart Home Lighting Control with Leap Motion & Arduino UNO

Manufacturing process

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