zanemountcastle / bluetooth-motor

📱 Bluetooth LE motor peripheral and central application suite -- A 'Bluetooth LE' class project at NYU's graduate Interactive Telecommunications Program (ITP)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bluetooth Motor

This project is a Bluetooth Low Energy controlled motor built using an Arduino 101. The purpose of this project is to control a fan using Bluetooth, but it can obviously be easily generalized to any motor-powered device. The circuitry is based on this tutorial by Adafruit.

Bluetooth LE Service Definition

The Bluetooth LE service is defined as motorService (UUID: 0xFFF1) with a on/off switch characteristic and a motor speed characteristic. More specifically, below is the service and characteristics definitions:

Characteristic UUID Properties Comment
Switch 0xFFF2 BLERead, BLEWrite 0x00 or 0xFF
Speed 0xFFF3 BLERead, BLEWrite 0x00 to 0xFF

Components

  • Arduino 101
  • Half-size Breadboard
  • 6V DC Motor
  • PN2222 Transistor
  • 1N4001 Diode

Fritzing Diagram and Photos of Hardware

PhoneGap Application

PhoneGap allows for a more user friendly way to control the Bluetooth Motor peripheral. The application allows the user to turn the motor on and off and control the speed. To run the Phonegap application, in terminal enter the following,

$ cd phonegap-application
$ phonegap serve

Next, in the PhoneGap application, enter the IP address displayed in the terminal. Be sure to have PhoneGap and NodeJS version 6.9.x installed.

Here is a video demonstrating the application live with a (very) makeshift fan. :)

Noble Central NodeJS Application

Noble allows us to control a Bluetooth Motor peripheral using the terminal. To control the application, use keys 0-9 to control relative speed from fully off to fully on or w to turn on and s to turn off.

To run the NodeJS application,

$ cd noble-central
$ npm install
$ node motor.js

Here is a video of the NodeJS application interacting with the Bluetooth Motor peripheral.

Bleno Peripheral NodeJS Application

Bleno allows the computer itself to act as a Bluetooth Motor peripheral. To run the NodeJS applicaiton,

$ cd bleno-peripheral
$ npm install
$ node motor.js

Here is a video of the PhoneGap application interacting with the computer as it acts as a Bluetooth Motor peripheral.

Electron Central

The Electron application is a desktop-based platform for controlling the motor.

screen shot 2017-03-02 at 2 26 21 pm

screen shot 2017-03-02 at 2 26 34 pm

To run the application,

$ cd electron-central
$ npm install  # Using Node version 6.9.5
$ npm run electron-rebuild
$ npm start

Here is a video of the Electron application working.

Web Bluetooth

Using Google Chrome, this application allows the user to control the Bluetooth motor from an internet browser.

screen shot 2017-03-02 at 2 36 04 pm

screen shot 2017-03-02 at 2 35 48 pm

To run the application,

$ cd web-bluetooth-central
$ python -m SimpleHTTPServer
# Navigate to localhost:8000 in Google Chrome

Here is a video of the Web Bluetooth application working.

About

📱 Bluetooth LE motor peripheral and central application suite -- A 'Bluetooth LE' class project at NYU's graduate Interactive Telecommunications Program (ITP)

License:MIT License


Languages

Language:JavaScript 77.2%Language:CSS 9.9%Language:HTML 4.9%Language:Java 4.5%Language:Batchfile 2.2%Language:Arduino 1.4%