Bluetooth RGB Shelf Lighting
by FamousMods in Circuits > Arduino
24627 Views, 386 Favorites, 0 Comments
Bluetooth RGB Shelf Lighting
Being the giant fan of LED's that I am i'm always trying to come up with new ways I can put them throughout my house. Today i'm going to show you how to create a simple, yet extremely eye catching, RGB Bluetooth controlled Shelf lighting system. The beauty of integrating Bluetooth into the system is that you can control your lights using almost any device, your computer, smart phone, even your tablet.
Materials
- Arduino Uno R3
- Arduino Proto Sheild
- 30mm WS2801 LED's
- 12v Power Supply
- JY-MCU HC-06 V1.06 Bluetooth Transeiver
- 2.1mm power jack
- 2k resistor
- 1k resistor
- DB9 Connector
You can find most of these from just about anywhere, you don't necessarily have use the links above, they are just a suggestion. You also don't need the DB9 Connector I use it for an easy disconnect from the LED's.
The Circuit
Connect the HC-06 to the 5v power source on the Arduino and the WS2801's to the 12v power source. Be sure that the Tx on the HC-06 goes to the Rx pin on the Arduino and the Rx pin on the HC-06 to the Tx pin on the Arduino. You can connect as many LED's in a row as you would like, in this particular scenario I'm using 11.
Connecting Bluetooth
The default password for these Bluetooth transceivers is "1234" without quotes. Below are all of the defaults:
-- Default COM setting: 9600, N, 8,1
-- Default Password/pairing code: 1234.
-- Supports the AT command to modify the baud rate, device name, passkey, master/slave, etc.
-- Supports baud rates 2400 -1382400.
-- Based on the CSR Bluetooth chip BC417143
-- Bluetooth specification v2.0 + EDR
-- Power supply: +3.3VDC 50mA
-- Frequency: 2.4GHz ISM band
-- Modulation: GFSK(Gaussian Frequency Shift Keying)
-- Emission power: ≤4dBm, Class 2
-- Sensitivity: ≤-84dBm at 0.1% BER
-- Speed: Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps
-- Security: Authentication and encryption
-- Size: 26.9mm x 13mm x 2.2 mm.
-- Working temperature: -20 ~ +75 Centigrade
-- Dimension: 26.9mm x 13mm x 2.2 mm
If you wish to change any of the defaults there is a great tutorial on Instructables that I used, the tutorial is for the HC-05 but it works for the HC-06 as well.
Modify The HC-05 Bluetooth Module Defaults Using AT Commands
Arduino Software
Below I've included a link to an example of the code i'm using on the Arduino. This code simply accepts 1 - 6 in order to change the different patterns, as you can see the addition of the Bluetooth Transceiver doesn't require any extra code on the Arduino side. There is also a link to the WS2801 Library, be sure you have this library before you try to compile or it will fail.
Before you Compile your code be sure to change this line:
Adafruit_WS2801 strip = Adafruit_WS2801(11, dataPin, clockPin, WS2801_GRB);
Where the "11" is change this to the number of LED's you have in your system.
- LiquorLights (Attached Below) code for Arduino
- WS2801 Library
Downloads
Android Software
The software attache below simply opens the Bluetooth connection and sends either 1-6 depending on what button is clicked, for debug i included the top enter text bar where you can send any information you wish. Before you try and use this app be sure that you connect to your Bluetooth device with your phone using the "1234" password. One thing, before you compile the code be sure to change:
"HC-06" to whatever the name of your Bluetooth device is, you can find it in the section below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set pairedDevices = mBluetoothAdapter.getBondedDevices();
if(pairedDevices.size() > 0) {
for(BluetoothDevice device : pairedDevices) {
if(device.getName().equals("HC-06")) { <~~~~ Change This Line
mmDevice = device;
break;
}
}
}
myLabel.setText("Bluetooth Device Found");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you would like a more detailed explanation of line by line what this code does I used this great tutorial:
Downloads
Finished!
Compile all your code, open the connection, and begin to send Data to the LED's and they should spring to life!
Here are a few videos of what mine looks like in action! Hope you enjoy!