BLE Rainbow LAMP

by yanc in Circuits > Arduino

4166 Views, 35 Favorites, 0 Comments

BLE Rainbow LAMP

Rainbow Lamp 1
Rainbow Lamp 2

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

Materials

blepad_1.jpg
ws2812_ring_8x.JPG
night-light.jpg

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

Connecting the Wires Together

IMG_6738.JPG
IMG_6739.JPG
IMG_6740.JPG

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

IMG_6744.PNG
IMG_6745.PNG
IMG_6746.PNG
IMG_6747.PNG

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

Making the Rainbow LAMP

IMG_6741.JPG
IMG_6743.JPG
IMG_6748.JPG
IMG_6749.JPG
IMG_6750.JPG

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!