Introduction: BLE Rainbow LAMP

This Instructable shows how to build a simple rainbow lamp with BLE controled using BLEPad and WS2812B ring.

Step 1: Materials

Picture of Materials

The BLEPad is an Arduino compatible microcontroller development board based on the ATmega32U4 with Bluetooth 4.0 built in.

  • 1 x WS2812 ring 8x 5050 LED
  • 1 x Crystal Night Light
  • Some wires for connect BLEPad and WS2812 ring

Step 2: Connecting the Wires Together

Picture of Connecting the Wires Together

Solder the following connections

  • WS2812 ring DIN -> BLEPad D6
  • WS2812 ring VCC -> BLEPad 3V3
  • WS2812 ring GND -> BLEPad GND

Don't plug your battery into the JST port. We need upload sketch first.

Step 3: Arduino Setup and Upload Sketch

Install NeoPixel library from adafruit
  • Open Arduino IDE
  • From the “Sketch” menu, select Include Library → Manage Libraries. Enter “NeoPixel” in the filter box to quickly find the Adafruit library, then install it.

Install BLEPad_UART library from AprilBrother

  • Download the BLEPad_UART library
  • Open Arduino IDE
  • From the “Sketch” menu, select Include Library → Add .ZIP Library
  • Choose the zip file you downloaded, then install it.

Upload sketch
  • Connect the BLEPad micro usb to your PC
  • Open Arduino IDE and choose board type - LilyPad Arduino USB, choose right com port
  • Upload the sketch rainbowLamp to test

Step 4: Controlling the Lamp

Picture of Controlling the Lamp

There're three mode for the lamp. We can control the mode with BLE remotely.

  1. Normal rainbow mode
  2. Theatre-style crawling lights with rainbow effect
  3. White over rainbow

You need install app LightBlue for iOS first

  • Open app LightBlue
  • Find the BLE device named "BLEPad" and connect it
  • Tap the Service UUID 0xFFF0
  • Tap the Characteristic UUID 0xFFF2
  • Write hex control code. If the code is 3, the lamp will change to "white over rainbow" mode

Step 5: Making the Rainbow LAMP

Picture of Making the Rainbow LAMP

We're making the rainbow LAMP after simple testing.

  • Remove the original board from crystal night light
  • Put the BLEPad and WS2812 ring together
  • Plug the battery to JST port and mount the board to night light
  • Have fun!

Comments

PRO DR MR BOB (author)2017-04-03

is there a app for android?

About This Instructable

2,797views

34favorites

License:

More by yanc:Siri HomeKit Controlled ESP8266 LockBLE Rainbow LAMPArduino BLE Temperature/Humidity logger with DHT11 and iOS display
Add instructable to: