RGB Led Strip Bluetooth Controller + Music Sync

669

24

7

Posted

Introduction: RGB Led Strip Bluetooth Controller + Music Sync

This project use arduino to control a RGB led strip with your phone via bluetooth, you can change the color of it, make it fade out and in ( or make any animation you want in the code ) and even make it sync with music beat.

Step 1: Components

For this project you are going to need the following components:

  • Arduino pro micro,i chose this because it's really cheap and small but you can tweak the code to work with your microcontroller:

https://www.banggood.com/Pro-Micro-5V-16M-Mini-Leo...

  • Sound sensor (or mic + opamp ic):

https://eu.banggood.com/Wholesale-Warehouse-Sound-...

  • bluetooth module:

https://www.banggood.com/HC-05-Wireless-Bluetooth-...

  • 3x N-channel MOSFET's,

be sure to buy some which fit the led's power requeirement :

https://www.banggood.com/10Pcs-IRFZ44N-Transistor-...

  • 5v voltage regulator:

https://www.amazon.com/7805-5V-Voltage-Regulator-T...

  • RGB led strip:

https://www.banggood.com/5M-RGB-Non-Waterproof-300...

  • Power supply,

buy one that fits your led's power requirement. those led strip i linked are 60W/5m, i want to connect 10m of them so i go for a 180w power supply just to be sure:

https://www.banggood.com/Wholesale-DC-12V-15A-180W...

  • Perf board:

https://www.banggood.com/40pcs-FR-4-Double-Side-Pr...

  • Headers

https://www.banggood.com/10pcs-40Pin-2_54mm-Female...

  • Pins

https://www.banggood.com/10pcs-1x40P-40Pin-2_54mm-...

Optional: screw terminal, led.

Step 2: Breadboard

make a breadboard prototype according to this scheme in order to test the circuit.

Step 3: Code

Download and unzip all files, then upload "ledStripControl.ino" to the board. ( in the board menu in arduino IDE select "arduino/genuino micro").

You can select Arduino MICRO or UNO with a constant (default is MICRO), the pinout is the same, if you want to use a different board select UNO and change the pinout int "variables.h" tab.

You can also enable Debug trough the serial port if you are using Arduino UNO.

What this code basically does is receiving inputs from bt module as decimal ascii and convert them in actions and values for R G B channels.

There are three way you can control your led strip:

1. Color mode

is the default mode and it basically receives the RGB values from your smartphone and sends them to the led strip.

2. Fade mode

make the led strip fade in and out with the color and the duration you specified from you smartphone app.

3. Music mode

make the led strip turn off according to high peeks of sound coming from the mic. you need to adjust the potentiometer on the mic board to a point where you see a good result with music sync.

Step 4: Android App

You have to download this app: https://play.google.com/store/apps/details?id=com....

and import the .kwl file that you find here.

If you want to create your own app that work with my code you need to have the following things:

a slider for RED value that sends:" r+value between 0 and 255+x" (es: "r130x")

a slider for GREEN value that sends:"g+value between 0 and 255+x"

a slider for BLUE value that sends:"b+value between 0 and 255+x"

a pushbutton that sends "m" for music mode

a pushbutton that sends "f" for fade mode

a pushbutton that sends "c" for color mode

a slider for duration of the fade animation that sends: "d+value between 1 and 150+x"

Step 5: Perf Board Circuit

When you have the full working circuit on a breadboard you can move it to a piece of perf board according to the circuit diagram.

Step 6: You Finished

Connect led strips and power supply to your circuit and you are done.

That's it, at this point you should have a working THING.

Please let me know if you have issues or suggestions in the comment section.

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Gluten Free Challenge

    Gluten Free Challenge
user

We have a be nice policy.
Please be positive and constructive.

Tips

1 Questions

0

Hai,
Seems to be a good project! But while running the code, I am getting the following error message.
"exit status 1
'Serial1' was not declared in this scope."
Please provide a solution.

please let me know if you have any other issue, and i will be glad if you would send me a picture of the finished project :).

0

Thanks a lot for the reply. Surely I will get back to in case of any other issues and will update with a picture of the final product.

Hi! "Serial1" is the serial port of Arduino Pro Micro, which is the microcontroller the code is written for. If you want to use another kind of MC such as arduino UNO you must swap every occurency of "Serial1" with "Serial" to use Hardware Serial or use SoftwareSerial library instead (https://www.arduino.cc/en/Reference/SoftwareSerial) , and of course you also need to change the pinout of the mosfets to some PWM outputs.
If you can't manage out the solution by yourself don't worry, soon i'm going to update the guide with videos and a code for arduino UNO as well.

2 Comments

Sounds fun! Do you have a video of it in action?

sure, i'm going to embed it from YouTube