Arduino Nano firmware for managing addressable LED strip via bluetooth (HC-06).
Intent: Backlight for room with remote control from smartphone;
Used components:
- Adressable led strip (ws2812b);
- Arduino Nano;
- Bluetooth module HC-06.
Main functions:
- power control (on, off, off by timer);
- color control (hue, saturation, brightness);
- different color modes.
Each message consists of 3 bytes.
- command code byte;
- command argument byte;
- command argument operation byte.
Table of all possible commands and their byte codes:
Command | Argument | Operation | Description |
---|---|---|---|
Power | |||
0x00 | 0x00 | Ignored | turn off |
0x00 | 0x01 | Ignored | turn on |
Hue | |||
0x01 | 0xXX | 0x00 | set hue to XX |
0x01 | 0xXX | 0x01 | decrease hue by XX |
0x01 | 0xXX | 0x02 | increase hue by XX |
Saturation | |||
0x02 | 0xXX | 0x00 | set saturation to XX |
0x02 | 0xXX | 0x01 | decrease saturation by XX |
0x02 | 0xXX | 0x02 | increase saturation by XX |
Brightness | |||
0x03 | 0xXX | 0x00 | set brightness to XX |
0x03 | 0xXX | 0x01 | decrease brightness by XX |
0x03 | 0xXX | 0x02 | increase brightness by XX |
Speed | |||
0x04 | 0xXX | 0x00 | set speed to XX |
0x04 | 0xXX | 0x01 | decrease speed by XX |
0x04 | 0xXX | 0x02 | increase speed by XX |
Mode | |||
0x05 | 0xXX | Ignored | switch mode to XX |
Timer | |||
0x06 | 0xXX | 0x00 | set turn off timer to XX minutes |
0x06 | 0xXX | 0x02 | increase turn off timer by XX minutes |
0x06 | Ignored | 0x03 | clear turn off timer |
- regular (backlight);
- breathing;
- morphing rainbow;
- running rainbow;
- fire.
Actual list of implemented modes is placed in source code here in AnimationModes
enumeration.
Project is based on PlatformIO. I use it as VS Code extension.
- FastLED for easy control led strip.
As sender app, I recommend Serial Bluetooth Terminal by Kai Morich. There you can nicely customize interface so it will look like usual remote.
Use this configuration file to get your app keyboard looks like on picture below.
May be in the future custom mobile app will be implemented...
If you have ESP8266, I recommend to see this project which is much more functional.