Audio To Multiple LED Strip Light Show System Advice Please!

Those last few posts were fantastic! The diagrams were extremely clear and with your help, I see the project coming together.

You can ignore the power and ground pins, they are shared by any/all shields you care to stack onto the Arduino. Look at the schematic and you can see the shield uses the A0, A1, D4 and D5 pins. Alas D5 is one of the 6 available hardware PWM pins.

Since D5(one of the PWMs) is taken up, you’re suggesting using software to create the same effect on a digital pin? If that’s correct, I’ll more into the coding required.

Also notice that while not used, the additional pins are brought over to the prototyping area and called JP2 and JP3.

I had no idea that they were there. I’ll do some research on them, because I have no idea what they are useful for.

With your second-to-last post.

And here’s was my thinking, keeping the strips all independent.

If I was to go with this, I would need the Mega right? OR use software to make the digital pins act as PWMs. Because all the wires are seperate, I’ll need the 12 PWMs like we talked about in previous posts.

And lastly, if you had the pairing as you described above but on adjacent walls, then you’d have less wiring by paralleling the LM pairs and HM pairs.

You have me convinced. I like it and I’m going to go with the the strips being adjacent. This is my favorite design.

Finally, your block diagram. I love it, and would like to use it for my more technical design(I’ll just be adding the pins of where everything goes). Before I go about it, Is it missing anything from the entire system? Also, can you tell me where the external power supply will plug into and how? I haven’t found that out yet…My goal with the technical design is that I can literally look at it and plug in wires, splice, ect. with my materials and have a working system in a few hours.

I just read your post from yesturday around 9:32.

I also note that you’ve not doubled up on the ULN outputs. Each IC has 8 outputs. If you’re going to use 1 per strip, you should use 2 outputs per R, G and B channel. This will also reduce the voltage drop below the 1v mentioned before, though not by much. Three ICs (24 outputs) used that way could drive 12 channels and that’s four 3 channel (RGB) strips.

I now plan to double up the wires for the ULN outputs. I should only need 1 ULN now. In the last few posts we discussed how the set up will look, Pair A & Pair B, and topics of concern with the ULN.

So, since the ULN can hold 8, and my plan is to have a total of 8 wires; I could only need one. However…you mentioned that the ULN has a maximum current rating of 2.5A. If I had my entire system running on one ULN, I would be coming close to that rating right? Even if I only used 2 ULN, I wouldn’t suffer from that much voltage drop. For long term use and safety, I could be learning toward using 2 ULN because we don’t know the power rating, but it’s up in the air.

RE: software PWM …

http://playground.arduino.cc/Main/PWMallPins

Also, can you tell me where the external power supply will plug into and how?

Huh ? I assume you'll have some enclosure. If so your power supply would plug into a mating connector on that. Inside the enclosure you might have a barrier/terminal strip that would be used to neatly wire and distribute the +12v and ground from that mating connector to the Arduino and LED strips. One 12v/GND pair would go to the Arduino barrel jack input (SFE sells a mating connector I think). I'd wire wire a separate GND wire to whatever board you mount the ULNs on. I wouldn't depend on just the Arduino ground path to return the current from the LEDs. The barrier strip would also be used to send 12v to the LED strips.

You’ll have to decide on whether to use connectors on the enclosure for each set of wires going to the LED strips.

http://rsk.imageg.net/graphics/product_ … 09w345.jpg

http://www.radioshack.com/product/index … Id=2103982

https://www.sparkfun.com/products/11706

Thanks for the link to the software. I plan on having an enclosure, but haven’t spent any time thinking about it. The enclosure is just a place to house it and keep it protected. I don’t want any wires hooked up to the enclosure or anything. I’ll have the ULNs hooked up the a breadboard; something you can find at radioshack. http://www.radioshack.com/p … Id=2734155

Well all I can say is think about what wires you’ll use and how they will be mechanically connected together. A solderless breadboard will accept solid wires up to ??22?? gauge. These are not the wires you want to use to +12v and the switched grounds for R,G,B for any long distance across a room. How are you going to transition from one to the other ? Or … lets say … you use a bundle of 24 ga solid wire to connect the ULN breadboard to the LED strips. That bundle might be the ubiquitous CAT5 cable. How do you keep the wire(s) firmly plugged into the breadboard when tugged on in the room ? Or just loosening up over time ? IMO you just don’t trust solderless breadboards for long term connections.

@Mee_n_Mac, I apologize for not responding for a while. I’ve been in Germany for the last month and will now continue on the project. I’ll be working on it daily again.

I understand why you are suggesting not to use a breadboard. However, what can I use instead to hold the ULN’s if it’s not a breadboard? Why do you insist on adding a GND source to the board I connect the ULN’s on? My guess of an answer to my question, is that current will continue to the Uno after it passes the ULNs, but just in-case the UNO’s GND can’t sink enough power, the ULN’s board would sink the rest?

There are a variety of through hole solder-type protoboards available.

http://www.radioshack.com/family/index. … =CT2032230

Thanks to all your help, I’ve gone through our entire conversation multiple times and wrote everything on my massive chalkboard. I believe I have the entire system ready…because I just bought all the materials. Summing to roughly $240. As I wait for the supplies to come in, I will be looking for the code. I apologize for all the stupid questions I have asked. Looking back, they all seemed really dumb. And I can probably ask one of the dumber ones I’ve had…When connecting the led wires from the ULN to the Uno/shield, does it matter if I put them into the shield using female headers or directly into the Uno?

kdolf:
… does it matter if I put them into the shield using female headers or directly into the Uno?

If I've understood your question, it doesn't matter. Both points are electrically connected together.

That’s what I was thinking. Once again thank you for all your help, I clearly couldn’t have done it without you. I will continue to use this post for the coding and hopefully the construction of the system will go with ease. if not you’ll hear from me lol

So I’ve found a library off the arduino website for FFT. http://wiki.openmusiclabs.com/wiki/ArduinoFFT Downloaded and added the library to my computer. When I import it, it opens up a blank sketch with a new title, and I’m assuming that all normal. But now what else do I need? I know I need the software PWM that you gave me before. I believe I still need to create a threshold value for the strips to turn on and what colors. But I know there HAS to be much more left to do than that. Can you point me in the right direction or give me a list of other codes I’ll be needing?

Why are you using any FFT routine ? That’s what the Spectrum Shield is for. Start w/the example code on that page.

Also look at this thread …

https://forum.sparkfun.com/viewtopic.ph … um#p166611

I’ve seen this project before! I used it to create my vision of a project! I’m thrilled not only to know you made the code but also that I can make out a good portion of it and understand what it means! I would love to use the code. Perfect that he used mono too. We’ll need 6 data pins? I understand that we’ll have to delete the portion of the code that is related to the neopixel because these leds aren’t addressable. We need to increase the threshold of when to strobe the leds. Is the “gain” the threshold? How/where do we incorporate a software PWM into the code. The code in the previous post was meant for all digital pins to be PWM rather than only one which is required for our application…What else am I missing? I’m trying to do my best to understand the code.

I’ll have go back and re-read this and the other thread before I can answer much of anything re: the code. The concept, as far as I can recall, was to read in all 7 frequency band from both the L and R channels. Then process the L/R data depending on how a constant was set when the code was compiled. Then subtract off a ‘noise value’ before multiplying that result w/a gain term. The idea was to minimize any noise, if present, in the end display. Of course, if used, subtracting off a ‘noise value’ also removes any quiet passages of music from the display. So apply as you see (literally) fit. Finally the 7 freq bands were somehow combined in a lesser # of wider bands and the magnitude of a band then mapped into how many of the Neopixels were to be turned on and what color they were to be. That last part will be different for you as all your LEDs will be ‘on’ … just at varying brightness levels, from 0 (off) to 255 (full on). Not decided IIRC was how you were going to set the color of the LEDs. IOW if loudness of music maps into brightness, what (if anything) sets the color (= relative R, G, B brightnesses) ?

And as you’ve noticed, once you’ve got final RGB values for each pair of strips, how do those end up controlling the LEDs via the 6 output pins ? That’s also different from the Neopixels code. You might want to read this…

http://arduino.cc/en/Reference/AnalogWrite

Did you end up w/an Uno or a Mega or ???

Both of us are going back and forth hahahaha I wanted to share with you the design we built. I made it on my chalkboard because of the extra space. I can make a digital copy for you if you’d like. Mainly take a look at how the power is connected. I’ll respond to your last thread shortly! I ended up with an UNO.

I understood from the code that you added the magnitudes from the R/L then divided it by 2 to reach an average magnitude. This simulated the mono and gave you one magnitude which was then broken up into the 7 frequencies, right? If I’m completely wrong, ignore it and move on haha.

Tell me if this is possible and bear with me. It’s about to get complicated.

Here are my thoughts on how the final project was going to work.

We are cutting out a 7th bandwidth, the highest one. We have 6 bandwidths and each pin(red, green, blue wire) represents a bandwidth for each strip. We are still keeping Pair A(lows) and Pair B(highs) the same. They just won’t overlap. The mids will be infused into Pair B.

First. we will a threshold to prevent basic noise. If it less than say .2v(any value I don’t know what is an accurate guess), it will stay off no matter what. Then we will create a second threshold for the music. Each pin of the RGB strip represents a frequency and when a threshold is reached, the lights will turn on. The threshold of each frequency is determined by a value above the average magnitude of the frequencies from the mono audio input. A percentage for example! If the average was 50%, the threshold could be at 65%. The brightness of the lights is determined by how much the magnitude of the frequency is over the threshold. If a frequency hit 65.1%, the light will turn on, at 64.9% its off. This is so only the louder than average sounds are displayed. However, that percentage is low enough to allow multiple pins to be activated simultaneously. Because when multiple pins are activated at once, we will create different colors of light. In essence, we can create every color possible. My thoughts are that this “percentage” can come from smoothing the data out. http://arduino.cc/en/Tutorial/Smoothing. A sample of say 3 seconds will determine what amplitude the frequencies need to meet that threshold(65%) requirement to turn on. If the threshold is made, the lights will start at a value of 60 for example and so by the time they it hits 80%, it reached the 255 max value for that pin…Is this possible?

kdolf:
I understood from the code that you added the magnitudes from the R/L then divided it by 2 to reach an average magnitude. This simulated the mono and gave you one magnitude which was then broken up into the 7 frequencies, right?

Right.

kdolf:
We are cutting out a 7th bandwidth, the highest one. We have 6 bandwidths and each pin(red, green, blue wire) represents a bandwidth for each strip. We are still keeping Pair A(lows) and Pair B(highs) the same. They just won’t overlap. The mids will be infused into Pair B.

OK, seems simple enough. What freq band controls the R, low pair ? Same question but high pair ? And, you guessed, repeat for G and B, low and high ?

kdolf:
First. we will a threshold to prevent basic noise. If it less than say .2v(any value I don’t know what is an accurate guess), it will stay off no matter what. Then we will create a second threshold for the music. Each pin of the RGB strip represents a frequency and when a threshold is reached, the lights will turn on. The threshold of each frequency is determined by a value above the average magnitude of the frequencies from the mono audio input. A percentage for example! If the average was 50%, the threshold could be at 65%. The brightness of the lights is determined by how much the magnitude of the frequency is over the threshold. If a frequency hit 65.1%, the light will turn on, at 64.9% its off. This is so only the louder than average sounds are displayed. However, that percentage is low enough to allow multiple pins to be activated simultaneously. Because when multiple pins are activated at once, we will create different colors of light. In essence, we can create every color possible.

Sure, look at the *map()* function.

http://arduino.cc/en/Reference/Map

kdolf:
My thoughts are that this “percentage” can come from smoothing the data out. http://arduino.cc/en/Tutorial/Smoothing. A sample of say 3 seconds will determine what amplitude the frequencies need to meet that threshold(65%) requirement to turn on. If the threshold is made, the lights will start at a value of 60 for example and so by the time they it hits 80%, it reached the 255 max value for that pin…Is this possible?

Certainly possible but be careful ... you're implementing a form of ALC (or AGC) Automatic Level/Gain Control. That can lead to some odd results. I will say that 3 secs is a bit long, your strips are lighting to music up to 3 secs old. I think you want the video and audio to be more in-sync than that. But it's a good idea, make that 3 secs easily changeable when it's all coded up.

kdolf:
Mainly take a look at how the power is connected. I’ll respond to your last thread shortly! I ended up with an UNO.

Looks good though I couldn't tell which Uno pins were being used to drive the ULNs. It's always worth the time to document your final wiring scheme. IIRC an Uno means using some pins that aren't 'natively' connected to timers to do hardware PWM. That's fine as PWM can be done in software, albeit more slowly. Good thing is ... you don't need or want fast.