# Reverse Engineering a Bluetooth Low Energy Light Bulb

## Overview

https://www.youtube.com/watch?v=lWzUlqv4XNE

This is a fun project that walks through how to reverse engineer a smart light bulb that uses Bluetooth Low Energy (BLE) to change its color. &nbsp;I stumbled on the [Smart Bulb Colorific!](http://www.amazon.com/Controlled-compatible-Bluetooth-Dimmable-Daylight/dp/B00KG1NE4M)&nbsp;bulb recently at a local store and was intrigued by its Bluetooth-based control and relatively low price (for a 'smart' gadget at least). &nbsp;Because the light bulb uses Bluetooth Low Energy (which is a subset of Bluetooth 4.0) it means any BLE&nbsp;device can in theory control the bulb. &nbsp;But to control the bulb the protocol for communicating with it must be understood, and this guide will show you how to use&nbsp;the Bluefruit LE sniffer and other tools to reverse engineer a Bluetooth Low Energy gadget.

If you'd like to follow along and control a bulb yourself you'll first need a few things:

A [Smart Bulb Colorific! light bulb](http://www.amazon.com/Colorific-Controlled-Dimmable-Android-Bluetooth/dp/B00KG1JYCI). &nbsp;It's possible other BLE light bulbs can be controlled in a similar manner as discovered here, but I recommend picking up one of these bulbs to be sure you can control it. &nbsp;The bulbs use the Colorific! app on the [Android](https://play.google.com/store/apps/details?id=com.colorificbulb.RGB&hl=en)&nbsp;or [iOS](https://itunes.apple.com/us/app/colorific-bulb/id826131369?mt=8)&nbsp;app store for control. &nbsp;You can see a picture of the bulb I used to the left.

![hacks_DSC02592.jpg](https://cdn-learn.adafruit.com/assets/assets/000/023/586/medium640/hacks_DSC02592.jpg?1425081686)

![hacks_IMG_20150223_221258649.jpg](https://cdn-learn.adafruit.com/assets/assets/000/023/587/medium640/hacks_IMG_20150223_221258649.jpg?1425081720)

- [Bluetooth 4.0 USB module](https://www.adafruit.com/product/1327). &nbsp; **Make sure the module supports Bluetooth Low Energy.** &nbsp;Older Bluetooth before version 4.0 does not support BLE!
- [Raspberry Pi](https://www.adafruit.com/product/2358)&nbsp;of any model (A, B, A+, B+, Pi 2, etc.). &nbsp;This guide shows how to use tools and code on the Pi to control the bulb. Another linux computer can be used but we've only tested it on the Pi
- [Bluefruit LE Sniffer](https://www.adafruit.com/product/2269). &nbsp;The Bluefruit LE sniffer is a special version of the [Bluefruit LE friend](https://www.adafruit.com/product/2267)&nbsp;but with a firmware that&nbsp;allows it to watch BLE packets being sent to and from a device.

You should also familiarize yourself with Bluetooth Low Energy by first [reading this introductory guide](../../../introduction-to-bluetooth-low-energy/introduction). &nbsp;This will help you understand terminology like GATT, service, and characteristic.

Continue on to learn where to start when exploring a Bluetooth Low Energy device.

- [Next Page](https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb/explore-gatt.md)

## Featured Products

### Bluefruit LE Sniffer - Bluetooth®Low Energy 4.0 - nRF5182

[Bluefruit LE Sniffer - Bluetooth®Low Energy 4.0 - nRF5182](https://www.adafruit.com/product/2269)
Interested in learning how Bluetooth® Low Energy works down to the packet level? Debugging your own Bluetooth® Low Energy hardware, and trying to spot where something is going wrong? Or maybe you're writing a custom application for your phone or tablet that needs to talk to...

In Stock
[Buy Now](https://www.adafruit.com/product/2269)
[Related Guides to the Product](https://learn.adafruit.com/products/2269/guides)
### Xinghuatian Tech Bluetooth® 4.0 USB Module

[Xinghuatian Tech Bluetooth® 4.0 USB Module](https://www.adafruit.com/product/1327)
Add Bluetooth® capability to your computer super fast with a Xinghuatian Tech Bluetooth® 4.0 USB Module. This adapter is backwards compatible with v2.1 and earlier, but also supports the latest v4.0/ Bluetooth® Low Energy. Inside lies a <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1327)
[Related Guides to the Product](https://learn.adafruit.com/products/1327/guides)
### Raspberry Pi 2 - Model B v1.2 - ARM Cortex-A53 with 1G RAM

[Raspberry Pi 2 - Model B v1.2 - ARM Cortex-A53 with 1G RAM](https://www.adafruit.com/product/2358)
Didn't think the Raspberry Pi could get any better? You're in for a big surprise! The Raspberry Pi 2 Model B is out and it's amazing! With an upgraded ARM Cortex-A53&nbsp;quad-core processor, Dual Core VideoCore IV Multimedia coprocessor, and a full Gigabyte of RAM, this...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2358)
[Related Guides to the Product](https://learn.adafruit.com/products/2358/guides)
### Raspberry Pi Model B+ 512MB RAM

[Raspberry Pi Model B+ 512MB RAM](https://www.adafruit.com/product/1914)
OMG OMG OMG, did you hear? There's a Raspberry Pi&nbsp;called the Model B+ and check it out...more USB ports, more GPIO, better power supply, four mounting holes, less sticky-out SD card! Yep, that's right, the fantastic engineers at Raspberry Pi HQ have blessed us with a new design....

In Stock
[Buy Now](https://www.adafruit.com/product/1914)
[Related Guides to the Product](https://learn.adafruit.com/products/1914/guides)
### Raspberry Pi Model A+ 512MB RAM

[Raspberry Pi Model A+ 512MB RAM](https://www.adafruit.com/product/2266)
 **Note:** As of August 10th, 2016 the Raspberry Pi A+ now includes 512 MB of RAM!

The Raspberry Pi Model A+ is the perfect board for the minimalist Pi fan. This low-cost Pi uses the same processor as the model B+, but does away with the Ethernet jack and three of the USB...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2266)
[Related Guides to the Product](https://learn.adafruit.com/products/2266/guides)
### Getting Started with Bluetooth Low Energy by KTOWN

[Getting Started with Bluetooth Low Energy by KTOWN](https://www.adafruit.com/product/1978)
You're interested in what all this BLE stuff is about, anyways? Let Adafruit's lead Engineer, Kevin "KTOWN" Townsend (a.k.a "50 Ohm") guide you in this detailed tome. KTOWN teamed up with Akiba (a.k.a "Wireless EL blinky guy") to throw down all their...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1978)
[Related Guides to the Product](https://learn.adafruit.com/products/1978/guides)
### Bluefruit LE Friend - Bluetooth® Low Energy 4.0 - nRF5182

[Bluefruit LE Friend - Bluetooth® Low Energy 4.0 - nRF5182](https://www.adafruit.com/product/2267)
The Bluefruit LE Friend is your new Bluetooth® Low Energy BFF! This USB-to-Bluetooth® Low Energy board makes it easy to get your computer talking to your&nbsp;Bluetooth® Low Energy-enabled phone or tablet using a standard serial/UART connection.

In its simplest form, it works...

In Stock
[Buy Now](https://www.adafruit.com/product/2267)
[Related Guides to the Product](https://learn.adafruit.com/products/2267/guides)
### SEGGER J-Link EDU - JTAG/SWD Debugger

[SEGGER J-Link EDU - JTAG/SWD Debugger](https://www.adafruit.com/product/1369)
[Discontinued - **you can grab&nbsp;** SEGGER J-Link EDU Mini - JTAG/SWD Debugger **instead!**](https://www.adafruit.com/product/3571)

The SEGGER J-Link EDU is identical to the more expensive [J-Link BASE](https://www.adafruit.com/products/2209) model except...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1369)
[Related Guides to the Product](https://learn.adafruit.com/products/1369/guides)

## Related Guides

- [Adafruit Metro M0 Express](https://learn.adafruit.com/adafruit-metro-m0-express.md)
- [Adafruit nRF52 Pro Feather with Mynewt](https://learn.adafruit.com/adafruit-nrf52-pro-feather.md)
- [Introducing the Adafruit Grand Central M4 Express](https://learn.adafruit.com/adafruit-grand-central.md)
- [Introducing the Adafruit Bluefruit LE Friend](https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend.md)
- [Programming Microcontrollers using OpenOCD on a Raspberry Pi](https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi.md)
- [Debug Header for the Feather [M0]](https://learn.adafruit.com/make-a-simple-debugging-featherwing-for-the-m0.md)
- [Introducing the Adafruit Bluefruit LE Sniffer](https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-sniffer.md)
- [Adafruit seesaw](https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout.md)
- [Adafruit Metro M4 Express featuring ATSAMD51](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51.md)
- [Programming an M0 using an Arduino](https://learn.adafruit.com/programming-an-m0-using-an-arduino.md)
- [Introducing the Adafruit nRF52840 Feather](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather.md)
- [Debugging CircuitPython On SAMD w/Atmel Studio 7](https://learn.adafruit.com/circuitpython-samd-debugging-w-atmel-studio-7.md)
- [Bluefruit LE Connect for iOS and Android](https://learn.adafruit.com/bluefruit-le-connect.md)
- [Adafruit Metro M4 Express AirLift (WiFi)](https://learn.adafruit.com/adafruit-metro-m4-express-airlift-wifi.md)
- [Debug Arduino Uno/ATmega328P with Adafruit CH552 QT Py and debugWire](https://learn.adafruit.com/debug-arduino-uno-atmega328p-with-adafruit-ch552-qt-py-and-debugwire.md)
