Ambient Lights - RGB LED controller with Bluetooth and Android client application
- Usage via twist-and-push-button
- Usage via Android client application
- Serial communication protocol
The Ambient Lights project is a RGB LED controller based on Arduino with optional Bluetooth connection and an Android client software.
Colors can be changed by using the single twist-and-push-controller or by sending commands to the controller's serial interface. It also holds connection pins for directly plugging in the Bluetooth module BTM-112.
In order to update the controller's firmware, it can be connected to a compatible Arduino board.
The Android client software lets you control the Ambient Lights from your Android device via Bluetooth.
See some pictures of the controller followed by some spec and further details:
|General Usage Specifications:|
|Supported RGB LED Strips:||12V common VCC, separate GND|
|Max. output power:||500mA per color, i.e. 18W max. total RGB power
|Color adjustment via:||
|Microcontroller:||ATMEGA 168 @ 16MHz with Arduino bootloader|
|DC/DC converter:||ST LD1117V33
|twist-and-push-button:||Encoder PANASONIC EVEQDBRL416B|
Usage via twist-and-push-button
Attached to the Ambient Lights controller is a button which can be turned left or right and pressed. With these movements, the user can set any color available in the HSV color space.
The controller's firmware implements some kind of "HSV menu". Pressing the button switches between H-, S- and V-mode where you can adjust the values for Hue, Saturation and Brightness (=Value). Turning the button adjusts the currently selected value - turning right increases it, turning left decreases it. Holding the button down while turning it makes the value increase or decrease faster.
When switching between H-, S- and V-mode by pressing the button, a short color flash indicates the mode you're in:
|red color flash:||H-mode||[adjust Hue]|
|green color flash:||S-mode||[adjust Saturation]|
|blue color flash:||V-mode||[adjust Brightness (Value)]|
Long-pressing the button toggles the auto-mode. In auto-mode the current S- and V-values will stay the same but the color will change by steadily moving to the right on the color-wheel (Hue will be increased). Just long-press the button again to switch back to manual mode.
Usage via Android client application
The video shows the Ambient Lights being controlled by the Android client application running on a HTC Desire. The app requires Android 2.1+ and uses the device's Bluetooth connection. With the current version it is possible to select the wanted color using a color wheel for Hue and Saturation and a color bar for brightness. When a color is selected, the command is directly sent to the Ambient Lights controller. It is also possible to send raw commands using the edit field.
Serial communication protocol
The Android client application just implements the serial communication protocol supported by the Ambient Lights controller. The following table shows the commands available. Commands are sent without any line breaks etc. Serial speed is 19200bauds.
Sets color using RGB-values.
RRR: red value as 3-digit integer, 0..255
GGG: green value as 3-digit integer, 0..255
BBB: blue value as 3-digit integer, 0..255
|dHHHSSSVVV||Sets color using HSV-values.
HHH: Hue value as 3-digit integer, 0..360
SSS: Saturation value as 3-digit integer, 0..255
VVV: Brightness value as 3-digit integer, 0..255
Activates auto-mode with automatic Hue-alteration.
Sets speed for auto-mode.
Makes the controller send the current controller state.
STATE: controller's current state id*
All values are sent as string-formatted integer values.
* state id definitions:
#define STATE_MANUAL_HUE 0
Activates or deactivates verbose mode.
In verbose mode informations about controller's state and
The file "Ambient_Lights_schematic_firmware_and_test_client.zip" contains the content described above. It's the first revision of the hard- and software and works just as described in the article above.
I now added a new revision of it all. The file "Ambient_Lights_schematic_and_firmware_rev2.zip" contains schematics and firmware source code (Arduino) for this revision 2. Since I changed the serial protocol, the python client from rev1 will not work. I'll add the documentation for it soon. In the meantime, please use the APK which is also provided now. The Android App is not the best piece of software you may have had on your Droid - but it kind of works ;-). The AmbientLights.apk only works with the rev2 firmware!