Arduino Bluetooth 4.0 LE Android controlled RGB lamp

For an event here in my home town (Eletrónica e Informática, pela AICB), I decided that I wanna do some Bluetooth project and while browsing through a Chinese store, I stumble into a wood phone booth – and it just hit my mind – another RGB lamp, controlled with Bluetooth and an Android app. I did the wiring and the programming, my lovely wife has taken care of the aesthetics .

Hardware needed

  • 1x Arduino Micro (any other could do – but beware of the pwm pins)
  • 1x Bluetooth 4.0 LE HM-10
  • 1x Adafruit Neopixel Ring 16 x 5050 (or anyone compatible with WS2812 5050)
  • 1x Power Supply 5V, 2A for Arduino Micro (the end mus be micro usb)

Bluetooth HM-10

The HM-10 bluetooth 4.0 LE module is a small chip ( made by Jinan Huamao) that uses a Texas Instruments BLE (Bluetooth Low Energy) chip. Has TX and RX Pins. Data passing through will be sent over bluetooth to a device and vice-versa. It uses serial communication.

Since this chip is 4.0 (LE) it can also take advantage of the new functionalities.

Here’s the pinout for the chip:

Image from http://www.hangar42.nl/hm10
Image from http://www.hangar42.nl/hm10

For this small project, we just need to use (and solder) the pins from the left side – TX, RX, 3.3v and GND. More information about the chip and other things you can solder into the chip, please visit HANGAR42.

BLESoldered

Wiring

Here’s a schematic for the RBG Lamp

 

BluetoothRGBNeopixelRing

IMG_20160319_123517 IMG_20160319_123741

Phone Booth

I put the NeoPixel ring in a wood phone booth that I bought for about 7€ in a Chinese Shop (there are a lot of them here in Portugal) and added some “makeup” to appear like a English Phone Booth.

Wood phone booth
The “raw” phone booth
IMG_20160319_222238
After the first coat of red paint
IMG_20160323_180434
After the paint dried and with a coat of clear varnish
IMG_20160323_180950
Putting the white vinyl letters
IMG_20160329_193743
Inserting the components – the Neopixel ring above the bottom plate and bellow, the arduino
IMG_20160329_213136
The bottom plate in place and the Arduino power already in place
IMG_20160405_185818
The Phone Booth ready and shinny !

Bluetooth

The Bluetooth APP (for Android) that I used to control the RGB light was taken from the excellent Instructable Control RGB lights from Android with Arduino & Bluetooth LE (BLE), by danasf.

You can head to his instructable and download the application from there. Since is not on Google Play, you have to enable “Install from Unknown Sources” in your device.  I’m starting to learn how to program Android and after I’m confortable with it, I will develop my own application and change the code to use it. 🙂

Code

I’ve changed my code (and used some of his) to match the incoming data from danasf application. I’ve added a small feature that, when the colors are 0, it performs a small loop with all the color on the NeoPixel ring. It is taken from the Adafruit examples for the NeoPixel RGB leds.

 

And the final work

IMG_20160329_221127 IMG_20160329_221118 Phonebooth

Hope you like it !

Some References

http://www.jnhuamao.cn/

http://www.hangar42.nl/hm10

Danasf instructable

 

Leave a Reply

Your email address will not be published. Required fields are marked *