BLE Rainbow LAMP
This Instructable shows how to build a simple rainbow lamp with BLE controled using BLEPad and WS2812B ring.
Materials
The BLEPad is an Arduino compatible microcontroller development board based on the ATmega32U4 with Bluetooth 4.0 built in.
- 1 x BLEPad
- 1 x Lipoly battery
- 1 x WS2812 ring 8x 5050 LED
- 1 x Crystal Night Light
- Some wires for connect BLEPad and WS2812 ring
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.
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
Controlling the Lamp
There're three mode for the lamp. We can control the mode with BLE remotely.
- Normal rainbow mode
- Theatre-style crawling lights with rainbow effect
- 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
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!