Introduction: Party Lights

Picture of Party Lights

This project is dedicated to creating a music visualizer that picks up sound using a microphone and converts it into the blinking of an individually addressable LED strip. The LED strip is controlled by Arduino Uno (or pro mini) that is controlled via Bluetooth from an Android app (doesn't work for iPhones), which also allows you to set the color of the LEDs or launch a color animation.

Step 1: Components

  1. LED Strip WS2812B. There are a variety of places that sell these strips, I’d recommend Ebay (here) as it will save you money, but if you want a higher quality product, you can check out adafruit.com of sparkfun.com. There is a variety of length and densities available, you can choose anything that suits you, but more LEDs need more memory to control them and at some point Arduino will run out of it. 128 LEDs is a safe bet, but you can go a little higher if you wish to do so.
  2. Arduino Uno. You can buy one from the official vendor or from Ebay (here) for much-much cheaper. I bought mine for ~$5.
  3. Electret microphone combined with an amplifier MAX4466. Again, they sell those on Ebay (here) as well.
  4. Bluetooth adapter HC-06. I bought mine on Ebay (here).
  5. 5V power adapter for Adruino (optional as you can use USB) and the LED strip (required, unless your strip is very short and can be powered directly from Uno). Make sure your power supply can provide enough power at 5V for the whole LED strip. My 5m strip consumes ~45 W (e.g. I ~ 9 A) at maximum brightness. Ebay has those as well.
  6. A bunch of wires to connect things.
  7. Breadboard to connect everything through (choose your favorite size and color). This is optional as you can connect things directly to Arduino, but it will look messy, so I’d recommend doing it only after you’ve made everything work using the breadboard.
  8. Soldering iron and solder. Some vendors send components detached from their connecting pins, in which case you’ll have to solder them yourself.

Step 2: Configuring Bluetooth Adapter

Picture of Configuring Bluetooth Adapter

Before you start building the music visualizer, you’ll need to put settings into the Bluetooth module so it uses the same baud rate as the final Arduino program. To do it, you will need to:

1. Download the archive and open test.ino in Ardiono IDE. Upload the code to Arduino (there as plenty of tutorials that will show you how). It will allow you to communicate with the Bluetooth module and see its responses in the serial monitor.

2. Connect HC-06 to Adruino according to this diagram.

3. Open Serial monitor in your Arduino IDE (Tools -> Serial Monitor)

4. Make sure the baud rate is set to 9600. To enter a command, just type it in the monitor input and press enter.

5. You can find the list of possible commands to send in the attached pdf.

6. I’d recommend changing the name of the device to something that makes more sence (like “LED strip”) and if you can also change the password if you fancy that sort of stuff.

7. Once you’ve finished, there is one final setting you need to change. Type in “BAUD8” (no quotation marks) and make sure you receive “OK115200” from the module. Once it’s done, you won’t be able to send any more commands unless you change the baud rate to 115200 in the Arduino code.

8. You’re done! Disconnect HC-06 from Arduino.

Step 3: Assembling Everything Together

Picture of Assembling Everything Together

Once the Bluetooth module is configured, you can proceed with the assembling of the final setup.

1. Make sure nothing is connected to the serial ports (digital pins 1 and 2) of your Arduino. Upload the attached code:

  • the folder LED_control contains the .ino file that you should open in Arduino IDE
  • the folder "FHT" inside "ArduinoFHT2" is the library you should attach to your Arduino project before compiling the code. This is a great library for doing the FHT transform (which is FFT for real numbers) I took from here, so you can also download it from their website. To install the library, go to Sketch -> Include Library -> Add .ZIP library, then navigate to the folder "FHT" and click open. This is counter-intuitive since you are adding a folder, not a .zip, but that's the right way to do it.
  • once the library is connected, you can upload the code.

2. Connect all the elements according to the schematic. The schematic uses one power supply for both arduino and the LED strip, but you can power them separately (for example, arduino can be powered via USB and the strip – through a power adapter). If you decide to do so, make sure to CONNECT ARDUINO GROUND AND THE LED GROUND. If you don’t do so, your strip won’t work.

3. Install this android app (the .apk file) on your phone.

4. Launch the app and connect to your Bluetooth module.

5. Set the number of LEDs you have connected to Arduino and press “SEND”.

5. Try to send some colors to the LED strip. If it works, you’re done!

6. P.S.: before you launch music visualization, it’s useful to record the noise level (there is a corresponding button in the app). If your lights blink when there is no sound, you can re-record the noise for a longer duration (for me 3 s works fine, but it really depends on your power supply quality and the surrounding electromagnetic noise)

Step 4: P.S.

Picture of P.S.

If you made everything work, it might be a good time to put everything in a nice box. It was easy for as I have access to a laser cutter so I just made one out of acrylic sheet.

Additionally, if you want to make this device much smaller, good news, you can! To do so, you should use Arduino pro mini (the 5V, 16MHz version), which you can buy on Ebay for ~$3. Assembling everything would require some soldering, as there are no pin connectors on the mini. Additionaly, you’ll need a serial-to-USB converter. Be careful when you buy those as not all of them have all the required channels to work with Arduino. The easiest way to make sure it will work is to buy both Arduino and the converter in a pack on Ebay. Or you can buy the official converter from the Arduino website if you’d like to spend more money. Finally, you will need a voltage regulator that can convert 5V to 3.3V as Arduino pro mini doesn’t have a 3.3V power supply you need for the microphone.

The assembly procedure is very similar. The only difference is that you’ll need to make a switch that allows you to disconnect the Bluetooth module from ports 1-2 and connect them to the ports 10-11 for programming. If you don’t do it, you won’t be able to upload any code to arduino or reprogram the Bluetooth adapter in the future.

Comments

ivybarend (author)2017-10-12

hey man, I hope you still read these comments. I have been trying to replace the mic with an aux plug, so i can connect it to my phone, and have the audio be a little more accurate and less delayed. the internet won't give me a simple answer, maybe because there is none - but my question: is it possible to replace the mic with an aux plug, and if yes, do I need to change your code for it, and how would I connect said plug? cheers!

SuperUserockx (author)2017-07-02

I have tried to install the library as per your instructions but on compiling i get the following error

Arduino: 1.8.2 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\SUPERU~1\AppData\Local\Temp\cc4yfVLM.ltrans1.ltrans.o: In function `fht_window() [clone .lto_priv.44]':

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:1248: undefined reference to `_window_func'

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:1248: undefined reference to `_window_func'

C:\Users\SUPERU~1\AppData\Local\Temp\cc4yfVLM.ltrans1.ltrans.o: In function `fht_mag_log() [clone .lto_priv.41]':

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:832: undefined reference to `fht_log_out'

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:832: undefined reference to `fht_log_out'

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:832: undefined reference to `_log_table'

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:832: undefined reference to `_log_table'

C:\Users\SUPERU~1\AppData\Local\Temp\cc4yfVLM.ltrans1.ltrans.o: In function `fht_reorder() [clone .lto_priv.43]':

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:681: undefined reference to `_reorder_table'

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:681: undefined reference to `_reorder_table'

C:\Users\SUPERU~1\AppData\Local\Temp\cc4yfVLM.ltrans1.ltrans.o: In function `fht_run() [clone .lto_priv.42]':

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:603: undefined reference to `_cas_constants'

C:\Users\SuperUserockx\Documents\Arduino\libraries\FHT/FHT.h:603: undefined reference to `_cas_constants'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino/Genuino Uno.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

KOTSOS5 (author)2017-05-08

While everything works fine, when I put the sound visualizer, the led strip lights at random times, no matter what the sound is, I guess the max4466 picks random noise but I can't overcome this, even if I change the record noise level, any suggestions?

MichaelK545 (author)2017-04-26

Question, how would I use an auxillary jack for my source of sound? I know that you can hook it up through the breadboard, and I also do not intend to make my Arduino into an enclosed system, I'm going to continue to use the breadboard. Another thing, how would I power the LED strips with the 5v if I can power the Arduino with the USB? If you don't mind could you email me and we can have a discussion about this? I am trying to make my LEDs react to bass, for a setup under a coffee table. If you can get back to me as soon as you can that would be very much appreciated :)

Noro13 (author)2017-02-05

How can I send the commands into the serial monitor. I connected the
arduino uploaded the code then opened the serial monitor and the ascii
table - character map list pop-up, but when i add a command nothing
happens.

Even when i type BAUD8 I dont receive any respond from the arduino.

IvanB147 (author)Noro132017-02-05

please see my reply to a similar question above and let me know if it helps.

Noro13 (author)IvanB1472017-02-06

My HC-06 is blinking red and blue, and I can pair it using my phone.

TXD connected to pin 10 and RXD to the 11pin. And all the rest are connected correctly (checked few times).

Also
tried to restart the monitor and re-plugging arduino to usb several
times, but nothing change, and still the module doesnt respond to any
commands.

And I cant see "Send AT commands" in the monitor the only thing I can see is the below (ASCII Table ~ Character Map) and this is it.

Noro13 (author)Noro132017-02-06

I can connect to HC06 with my phone using bluetooth terminal (then the lights on HC06 become solid).

Also when I input any command in the serial monitor and press enter an orange led on arduino blinks once but still no response.

IvanB147 (author)Noro132017-02-06

this is quite weird, I don't know what you did, but there shouldn't be any tables in the monitor. The only thing I can think of is that your arduino is not running the code it's supposed to. Try re-uploading the code in test.ino and make sure it goes through.

Noro13 (author)IvanB1472017-02-07

I have re-upload the code of test.ino many times and still nothing change. Aldo re-downloaded it from the site in case that you could change something but still no response. Also I spent all day searching on the web for similar problem but couldn't find any answer(s).

[About you diagram in step 2 - is says that RXD goes to Digi10 and TXD goes to Digi11, but how it is connected on the picture is the opposite, could you change it, because it is a bit confusing.]

IvanB147 (author)Noro132017-02-08

Huh, you're right, there is an error there. The connection diagram is correct, but the writing is wrong. I'll fix it momentarily

Noro13 (author)IvanB1472017-02-14

According to my problem, there is any tip/help that you could give me so I could fix my problem or it isnt and I can throw away the parts I bought?

IvanB147 (author)Noro132017-02-14

I just googled what you see in the monitor and it seems like your arduino is running an example code for printing ASCII table from this tutorial: https://www.arduino.cc/en/Tutorial/ASCIITable

So, the problem is that you still haven't uploaded the right code to your arduino. What does the IDE tell you when you hit "Upload"? It should say something like "upload complete".

Noro13 (author)IvanB1472017-02-16

Ok, know somehow it is working.I had few more issues with the serial monitor but I overcame them. Now stuck on step 3 because I am waiting for power supply, could I use my old 5V 1A PSU for 120light strip (2m) or the 5V 2A is essential??

tytower (author)Noro132017-04-03

I got some of these red and blue bluetooth modules too recently . On mine top left is a button. You are meant to hold down the button whilst you turn on the bluetooth module . That will drop it into the AT mode . I prefer these to all other modules I have had.

Noro13 (author)Noro132017-02-16

And also dont understand how I have to connect the LED strip to the arduino, according the diagram the LED goes to PSU and that to arduino but I am connecting directly to the PC so where should connect the LED wires ????

tytower (author)Noro132017-02-16

Just the arduino will run it successfully just for testing .Your 1 amp will do it while waiting , join all grounds and take arduino 5 volt to pos for a start

tytower (author)2017-04-03

Not many people posting here now . I took down my post expressing concern at using bluetooth requires you to switch on data capabilities on android devices, after you showed me a page requiring it to be done . Reading here ->https://www.sciencedaily.com/releases/2017/04/1704...

I am still concerned with this . My phone is an android 5 system and my testing with MITAppInventor has indicated without doubt turning on media services is not required at all. I notice you have not yet released your .ala code file for the app . I would still like to see it as I have a problem with your app running on my phone . It will not switch the LEDS on although all that should be happening in the serial terminal is happening . I have had it running by changing one of the random seeds but I have lost that again and am still looking to get it to run . All other neopixle apps run as they should and so do any bluetooth apps I play with so I am sure it is your code . Further I suspect it is to do with trying to turn media services on which i do not allow on my phone when running apps.

Noro13 (author)2017-02-21

After I attached the FHT folder into the code and pressed upload an error pop up:

"

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

In file included from C:\Users\PC\Desktop\LED DR PROJECT\FWJ1RK3IXLATIL2\LED control code\LED_control\LED_control.ino:17:0:

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:180:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r16, "STRINGIFY(FHT_N/8)" \n" // prep loop counter

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:381:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r16, hi8((fht_input + "STRINGIFY(FHT_N*2)")) \n" // prep end of dataspace register

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:576:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"cpi r28, lo8(fht_input + "STRINGIFY(FHT_N*2)") \n" // check if at end of dataspace

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:590:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"sbrc r8, "STRINGIFY(LOG_N - 2)" \n" // check if finished with all butteflies

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:646:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r20, "STRINGIFY((FHT_N/2) - _R_V)" \n" // set to first sample

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:720:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r30, lo8(fht_input + "STRINGIFY(FHT_N*2)") \n" // set to end of data space

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:721:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r31, hi8(fht_input + "STRINGIFY(FHT_N*2)") \n"

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:724:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r20, "STRINGIFY(FHT_N/2)" \n" // set loop counter

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:877:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r30, lo8(fht_input + "STRINGIFY(FHT_N*2)") \n" // set to end of data space

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:878:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r31, hi8(fht_input + "STRINGIFY(FHT_N*2)") \n"

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:881:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r20, "STRINGIFY(FHT_N/2)" \n" // set loop counter

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1058:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r30, lo8(fht_input + "STRINGIFY(FHT_N*2)") \n" // set to end of data space

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1059:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r31, hi8(fht_input + "STRINGIFY(FHT_N*2)") \n"

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1062:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r20, "STRINGIFY(FHT_N/2)" \n" // set loop counter

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1216:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r20, "STRINGIFY(((FHT_N)&(0xff)))" \n"

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1293:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r30, lo8(fht_input + "STRINGIFY(FHT_N*2)") \n" // set to end of data space

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1294:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"ldi r31, hi8(fht_input + "STRINGIFY(FHT_N*2)") \n"

^

C:\Users\PC\Documents\Arduino\libraries\FHT/FHT.h:1446:3: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

"sbrs r21, "STRINGIFY((LOG_N) - 1)" \n" // check if done

^

C:\Users\PC\Desktop\LED DR PROJECT\FWJ1RK3IXLATIL2\LED control code\LED_control\LED_control.ino: In function 'char* substring(const char*, int, int)':

C:\Users\PC\Desktop\LED DR PROJECT\FWJ1RK3IXLATIL2\LED control code\LED_control\LED_control.ino:576:15: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]

subarray[l] = NULL;

^

`_window_func' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_window_func' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`fht_log_out' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`fht_log_out' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_log_table' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_log_table' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_reorder_table' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_reorder_table' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_cas_constants' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

`_cas_constants' referenced in section `.text' of C:\Users\PC\AppData\Local\Temp\ccRUVXqa.ltrans1.ltrans.o: defined in discarded section `.text' of sketch\LED_control.ino.cpp.o (symbol from plugin)

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences."

and How do I connect the LED strip with the arduino????????

IvanB147 (author)Noro132017-02-22

Did you follow the steps I described in the tutorial to attach the FHT library? It seems like you've copied library files into the project, which is not the way it should be done.

As for the LED strip connection, all you need to make sure is that you provide 5V to the power input (directly from the power supply or from arduino's 5V pin), the ground you connect to the strip is also connected to arduino's GND pin (if you power it from arduino, just connect arduino's GND and strip's GND), and connect strip's digital input to the arduino's digital pin 8.

Noro13 (author)IvanB1472017-02-23

1. openned the ino file in the folder LED_control

2. added the fht library folder

3. pressed upload but an error pop up
so what i did wrong????

IvanB147 (author)Noro132017-02-23

The way you describe it sounds fine, but I've gotten similar errors when the library is either added incorrectly or when its files were copied inside the LED_control project's folder. I'd try removing the FHT library from everywhere and re-adding it again. When you remove it, make sure it's removed from arduino IDE's libraries folder and that it doesn't appear in the list of libraries in the arduino IDE's menu.

Also, sometimes when you attach a library, the IDE automatically inserts the #include statement into the sketch. If that happens, you'll need to remove that statement because it's already there. Other than that, I really don't see what else to recommend...

tytower (author)2017-02-09

For problems with Bluetooth AT commands see here for wiring it up.

https://core-electronics.com.au/tutorials/how-to-use-bluetooth-modules.html

tytower (author)tytower2017-02-15

I ended up setting my bluetooth to

AT+UART=115200,0,0 for a sucessful connection . Phone is master so module must be slave (can only connect to one master) I would like a few slaves myself to do my bidding . Female of course.

tytower (author)2017-02-10

Ivan I have been playing with this for a 300 chip strip.By putting my own function into your code at the start of the loop i can get the strip lighting up and the loop completing , but I think its passing through the rest without getting a serial input message from bluetooth . It could be that my bluetooth modules are stuffed and if so I will confirm that case shortly however they are connecting OK . I notice however that println() statements placed around to see where its hanging are not being printed at all and putting in "//Serial.println("Just before flush"); on line 274 completely crashes the program and nothing works thereafter except for the initiating line. So perhaps its still the bluetooth modules but would you try that line on yours and see what happens please . Adding more EEPROM is a bit of a challenge but it may be what is needed .

tytower (author)tytower2017-02-12

It was the bluetooth communication not happening.

IvanB147 (author)tytower2017-02-14

Just saw your messages. Were you able to solve the issues? I've never tried putting 300 LEDs in it as I don't even have that many. I suspect that at this amount of LEDs the program may be unstable due to memory overflows and adding System.println() consumes even more memory, which makes the problem worse. Using this syntax: System.println(F("string you want to print")) makes life a little easier as it allows to store strings in the flash memory rather than RAM.

tytower (author)IvanB1472017-02-15

Without changes your program lights about a third of a 500 strip. Changing it by the app to 150 or higher seems to light up at least half but I have not counted so its all going fine . memory can be increased by adding EEPROM (a bit heavy for me ) Using an SD card maybe , or keeping the array on another computer and reading it but I have not played with that bit yet. I'm running with just the mini pro power atm waiting for a better power supply . I have a lab supply so I'll try it on that soon .I have all the SD components needed so I'm doing that first. I remember there is a way of using the unused dynamic memory of the 328p for extra array space but I have forgoten how to do that atm . I only needed the println() to try to find where I was going wrong . I removed them when I found the bluetooth protocol fault. I'll give the System.println(F("string")) a try thanks.

tytower (author)2017-02-12

OK so I'm answering myself . Got this working finally. Bluetooth must be set up as a slave for the phone is Master.

Settings are for MY board 6 pin-Note its 2010

AT

OK

AT+ROLE?

+ROLE:0

AT+VERSION?

+VERSION:2.0-20100601

AT+UART?

+UART:115200,0,0

AT+BAUD?
ERROR:(0)

AT+NAME?

+NAME:TYSBT
OK

tytower (author)tytower2017-02-12

Another thing - The 300 LED stip will work straight off the arduino board power supply and set at 150 leds runs the visualisation OK. I have not played with that yet. I will add a separate power supply but it is not needed for testing and setup . My bluetooth module once set up properly ,runs fine without any resistors on any lines .

tytower (author)2017-02-11

If you have a BT module marked "vers 1.06" Google on it . It needs a pullup resistor on the tx line. Mine was a 4 pin model and I will never buy a 4 pin again. Hasn't fixed my problem but has eliminated a bad BT

tytower made it! (author)2017-02-06

Back again Ivan. Had to wait on a strip arriving .I used sparkfuns /Lady ada test to make sure the strip is OK

https://cdn.sparkfun.com/assets/0/4/a/f/8/51f1806c...

https://learn.sparkfun.com/tutorials/ws2812-breako...

Works beautifully and its a 5 meter strip and I'm running it straight out of the USB supply ,no extra power supply at this stage and its very bright.No capacitor and no resistor. Bluetooth connects fine but I might have to go back and re-read the setup of that

However when I load your arduino program onto my mini pro board which is a 328P processor too the strip does not respond in any way . Had a quick look at the code but the phone does not seem to be setting the number of chips on the strip and no colours given out at this stage . I'll keep chasing it but do you have any obvious clues?

calvinbrooks01 (author)tytower2017-02-07

Vaguely remember reading in the instructions on the last page of this tutorial that if your using no external power then 2 things have to be grounded together or the l.e.d's won't work..maybe that's the problem

Connect arduino ground to l.e.d ground on page 3 of tutorial

tytower (author)calvinbrooks012017-02-08

All noted there thanks . just got to play with it some .Its a 16M 5V pro and its running the test fine so thats not it .Tested bluetooth connection separately on my own app and its fine .Think its to do with the 300 leds on this strip as opposed to 128 on ivans,so I'll see.

IvanB147 (author)tytower2017-02-08

Yeah, 300 LEDs will definitely make arduino freeze due to the lack of memory if you try music visualization. The simple color controls should work though.

IvanB147 (author)IvanB1472017-02-08

this makes me think of another possible issue. Don't know if that's what happening with your setup, but it can definitely mess things up.

I store the number of LEDs in Arduino's memory (EEPROM) and it's preserved there even if you unplug it or re-upload the code. So, if you send too high number of LEDs, arduino will start crashing upon startup, when it's trying to initialize the array for LED colors and runs out of memory. Thus, you'd need to run the code that erases everything from the memory to make it work again (basically it's calling "EEPROM.write(i, 0)" in a loop for i from 0 to EEPROM.length()).

tytower made it! (author)tytower2017-02-08

In case you want to run my app and test bluetooth here it is

tytower (author)tytower2017-02-07

I have been revisiting this bluetooth thing and mine is connecting to the phone OK and I am getting the message "

LED strip init(). Num bytes taken: 384" on 115200 so I am assuming the bluetooth connection is fine?

IvanB147 (author)tytower2017-02-07

This message appears when the array that stores the colors for the LED strip is initialized. 384 bytes corresponding to 128 LEDs is the default size, so it will show up regardless of whether HC-06 works or not.When you send commands from the app you should be able to see them appearing in the serial monitor. If you don't that means the commands don't reach Arduino.

When I'd made this setup with pro mini I didn't really have any additional problems aside from my USB-to-serial converter not working half the time (I solved it by buying a better one), so I'm not sure what's happening. As long as it's a 16 MHz 5V mini (and not a 8 MHz or 3V one) it should behave pretty much identically to Uno.

harshal0007 (author)2017-02-05

Hi evan ,

even i am not able to configure HC 06 module , after uploading code when i send AT commands i receive no response

IvanB147 (author)harshal00072017-02-05

Well, it's hard for me to tell you what is wrong without any details. Here are some possible reasons:

1. HC-06 is broken. It should start blinking red light when connected to power and you should be able to discover it and pair with it using your phone

2. You've connected things incorrectly. Particularly, make sure TXD goes to the pin 10, RXD - to the pin 11.

3. Arduino code is not running correctly. This is probably not the case as I assume you see "Send AT commands" in the monitor, which is a pretty good indication of it working well.

4. Sometimes HC-06 or the serial monitor act weirdly. Try restarting the monitor and/or re-plugging arduino to USB.

harshal0007 (author)IvanB1472017-02-06

Hello ,

i checked above points, my hc-06 module is blinking and also it is discover-able from phone , i have connected some as instructed by you. but when i open serial monitor in Arduino ide - nothing appears except " AT Commands" , it doesn't respond to any AT commands.

last day i tried with default configuration of Hc06 i.e at 9600 Baud rate but all led's act weird, some glow red and some green.

Is there any other way to configure this module.?

and yes i do have hc 05 module will it work ?

Also make sure Hc-06 isn't connected to any Bluetooth in case you missed it in the instructions..change baud from 9600 to something else and back to 9600 while everything's connected

Calvin - Is your Hc06 responding back while giving At commands .

i think i have messed it up all things. even i tried changing uno but still facing problem to configure

I had a nightmare but only because my Hc-06 was broke and I didn't realise..when I bought a new one and followed instructions the only problem I had was the serial monitor not replying..I went to the little box at the bottom right of serial monitor 'baud rate' which was set to 9600,I then selected 115,...(can't remember the number) and then selected 9600 again..after that I tried commands and it replied..make sure you don't connect to your Bluetooth when you're doing this and it should work if you've followed all instructions Ivan set out..good luck:)

Yeahh all set , my hc 06 is responding and i have changed the baud rate to 115200 , one problem still i am observing is some leds glows in different way not as in video . do you know why is it so..? is it due to input supply. or something else .

thanks ivan & calvin

Yeah I had the same problem..it's because Ivan is a genius and understands what each setting will change in the app..I've found that when changing app settings you have to select 'lights off' in the app and then change a setting and then select 'start sound activation'..it takes a while to work out but just keep trying different settings until you find the same as what you see in the YouTube video..I keep both my sliders fully to the left mostly but it doesn't look like Ivan's did..I have found the setting to make it look like his but can't remember how I did it sorry..try doing what I did to change settings and you'll see the difference everytime you start sound activation after turning lights off and changing a setting:)

IvanB147 (author)calvinbrooks012017-02-07

Hahah, thanks for the "genius", but if you knew how many hours I spent working with it you wouldn't be surprised. As for the visualization settings you're sending to the strip (I love lists, obviously):

1. I don't see any way switching lights off would help with resetting sound visualization (unless there is some weird bug in the app I've never seen before, which is entirely possible). What may help is re-plugging arduino if it freezes (especially if you use more than 128 LEDs it may or may not run out of RAM) and restarting the app if it starts acting funny.

2. Make sure LEDs don't blink on their own without any sounds. If they do, re-record the noise level. Also, if you make any sounds during noise recording, your LEDs won't be as responsive.

3. Increasing music volume improves visualization quality as this system is more sensitive to low frequencies and will pick them up at lower volumes than the high frequencies. At higher volumes everything should be more or less fine as I normalize LED brightness for each frequency independently.

calvinbrooks01 (author)IvanB1472017-02-07

Haha don't be bashful Ivan I've checked YouTube and no one has created a visualizer that comes close to this,it is genius mate and well worth the effort you put in to it:-)...the strip I bought had 150 on it and I wasn't brave enough to start cutting it down so maybe that's why it freezes when I play too much with the settings..I've just built a studio for my son and this was part of the finishing touch to it..I've only used it twice,first to check it was working and last night in the studio and I only played for 10 minutes or so..now I know I'll switch off and switch back on if it plays up so thanks for the advice..is 150 LEDs a bit too much do you think?