Beginner needs help with music organ/spectrum.

I used your tip for 14 FET's, do you have idea how i could implement these missing 4 Red inputs of LED strips?

Missing 4? You have still not got it. There are a missing 8 PWM signals.

There are only 6 pins on the Arduino capable of PWM, to get more you have to use this library:-
http://forum.arduino.cc/index.php?topic=19451.0

Also i updated my circuit https://123d.circuits.io/circuits/1542618-car-rgb-color-organ-project

Those LED strips are wrong. You have drawn then as common cathode RGB LEDs, where as in fact your strips should be common anode strips. They should also be strips not individual LEDs. I know what you are going to say, that the program doesn't have that part, so you will have to make your own part and if that is not permitted abandon that package and draw with pen and paper. That is the MAJOR trouble with schematic software package, if you do not use the correct symbol then people can't follow what you have done.

You have to decide what strips to connect to what drivers, you only have 14 different signals of data so you can not drive each strip you have independently because there is no data to drive it with, so....
You have to decide how to distribute the 14 data channels over your 18 strips / colours. That means 4 of these have to be common with one or more of the 14 you already used. You have to make that decision as to which.

Each FET needs a 150R to 330R resistor in series between the gate and the Arduino PWM pin, and also a 10K from the gate to ground. Let's get the design right first before you worry about powering it in a moving car.

Grumpy_Mike:
Missing 4? You have still not got it. There are a missing 8 PWM signals.

There are only 6 pins on the Arduino capable of PWM, to get more you have to use this library:-
SoftPWM Library - Interfacing - Arduino Forum

Yes i allready found that. Also i found this one GitHub - elcojacobs/ShiftPWM: Arduino Library for software PWM with shift registers Whats the difference between these two ?

Grumpy_Mike:
Each FET needs a 150R to 330R resistor in series between the gate and the Arduino PWM pin, and also a 10K from the gate to ground. Let's get the design right first before you worry about powering it in a moving car.

https://123d.circuits.io/circuits/1547536-car-rgb-color-organ-project/ Is it looking better now ?

How can i thank you with all this help ? I just rep+ every post ! :slight_smile:

Also i found this one GitHub - elcojacobs/ShiftPWM: Arduino Library for software PWM with shift registers Whats the difference between these two ?

That is for using shift registers, you need to have a chain of shift registers and this will generate PWM on the outputs. This is way more CPU intensive and requires more hardware in your case 3 shift registers.

Is it looking better now

No you have the resistors wrong. The 10K should go from the gate to ground. These should not be two resistors in the gate, there should be only one, whose value is between 150R to 330R. That R means ohms not K ohms, the 4 red LEDs are still not connected up.

You have all the gate resistors going to the same place, each one should be connected to a separate PWM pin.

Schematic is starting to look a bit messy, try and separate the wires more so they are easier to trace and not over one another.

Grumpy_Mike:
Schematic is starting to look a bit messy, try and separate the wires more so they are easier to trace and not over one another.

Yes i noticed. This webpage is annoying with wires. But im not at home and i dont have right equipment to draw these things. But i did my best is it looking better now ?

If there is a change that you have account tho this website i can give you permission to edit.

But here: https://123d.circuits.io/circuits/1547536-car-rgb-color-organ-project

It seems that this site is not very good with larger project's. It starts lagging like hell.

EDIT: These wires went again on tom of each other.

But i did my best is it looking better now ?

Yes you seem to have got the FETs and resistors right now.

It seems that this site is not very good with larger project's.

You mean "projects" no apostrophe required for a plural ( sorry my wife is an English teacher )

I would agree, I have only come across it once before and I find it very difficult to navigate on my Mac. It seems that the touch pad gestures are all wrong compared to how all other applications work.

I just use a generic 2D drawing package ad group component symbols so I don't have to redraw them from scratch each time. Using a ground symbol and a supply symbol will make the circuit look a lot neater. Also a good tip is to have the ground down and the power up on the page, that improves readability.

Thanks for you help all ! I have ordered all components now. I start the code but i hade one more idea.

Is it somehow possible to calculate two outputs avarge into one without arduino.

MSGEQ7 gives me 7 outputs but if i would get 9 out by calculating
1 and 2 output avarge and 6 and 7 output.

Like he does: BADDASS Display Rocks! - YouTube
http://www.embedded.com/electronics-blogs/max-unleashed-and-unfettered/4439541/BADASS-Display-Coding-Competition

without arduino.

What do you mean by this?
Yes you can do that with the arduino but why without.
You could also interpolate, that is put in an extra channel which is the average between two adjacent channels.

My girlfriends teacher suggested us to switch to ULN2003 so we did.

It looks now like this:

Grumpy_Mike:
What do you mean by this?
Yes you can do that with the arduino but why without.
You could also interpolate, that is put in an extra channel which is the average between two adjacent channels.

Now i didn't understand. But i try to explain my self better.
So as you can from picture i'f like to get O6 & O7 and calculate their avarge into LED 1 R.
Also for O1 & O2 into Led 3 R. And the same with other chip.
I can't use arduino becose no ports left.

My girlfriends teacher suggested us to switch to ULN2003 so we did.

Your girlfriends teacher is an idiot and does not know much about electronics. That chip can only switch about 600mA at any one time.
See:-
http://www.thebox.myzen.co.uk/Tutorial/Power.html

and

http://www.thebox.myzen.co.uk/Tutorial/Power_Examples.html

Grumpy_Mike:
That chip can only switch about 600mA at any one time.

So its 600mA for one output or in total ? We are using two chips so its 1.4A for one chip. We have only 4m of leds. This is going into car so not very much. The actuall reason we switched was that school doesent had any mofset if im not wrong.

So its 600mA for one output or in total ?

In total for one chip.
The limit for one output is 500mA but no more than a total of 600mA being sunk at any time.
Did you not read those links? That is what they said.

We are using two chips so its 1.4A for one chip.

So that is way too much.

The actuall reason we switched was that school doesent had any mofset

Well you should have said that before, it is well known that the laws of physics can be suspended by a school if only they fill in form "Physics Laws exception form number GzeroD"

Hello, it's been a long time.

Now we have all components and time to start building this thing.

Except we got 220K ohm resistors when we need 200K ohm resistors.

R1L & R1R

So my question is can we still use 220K ohm resistors ? Or do we NEED 200K ohm resistors ?

EDIT or maybe its better to use 270K ohm ?

Yes you can use 220K. It might just shift the peak of the filter frequencies by a few tens of Hz but it will not be noticeable.

Thanks for your answer, we will get the right ones just to make sure but we will start building with 220K.

Except now we have two more problems.

  1. I think one of my MSGEQ7 is broken. I switched them around and everything but still one chip shows only 0 0 0 0 0 0 0.

  2. The numbers i get don't make any sense for me. Whole row is same (almost) and its like volume. When i turn music louder the numbers get bigger.

My serial output: Pastebin | Laravel.io

My code that i use is this: Pastebin | Laravel.io

Credit goes to: http://www.eetimes.com/author.asp?doc_id=1323030&page_number=3

I switched them around and everything but still one chip shows only 0 0 0 0 0 0 0.

Does the 0s follow the chip or does it stay on the same side.
It is likely you have wired things wrong.

No, if i swap the chips the 0's change side. Or if i change A4 & A5 but that one makes sense.

Ok so that points to one faulty chip. It could be the other is faulty as well or as I said is not wired correctly. This includes things like the bread board not making connections correctly.
The software too is a bit simplistic on the reading in side. Look at the data sheet and you will see that the software you are using doesn't make the waveform that the data sheet says it needs in order to get the samples out correctly.
You also might have swapped the reset and strobe lines lines.

It has been a long time but the project is not dead.

We have been tweaked it somehow and allready included an android app.
But now we have faced couple problems.

  1. First we got a idea to start uploading code from bluetooth.

We couldnt get it anyhow to work. Windows connects to it and gets right COM's.
We got a lot of different errors but we got ' Not in sync: resp=0x** ' the most.
Now we are using a arduino board to upload a data.

  1. Then we started to move on and we tryed to get the code working with usb serial.
    Our problem is that we cant get and save data variable from serial as an string.
    I would use this string to run different profiles. Also we would like to adjust brightness.

I have tryed different compinations from google.

I have still however figuret out what is right way to control data variable and brightness variable differently.

Also i would like to do some saving there and here but im not sure how this would work out.

Here is code: GitHub - alanaasmaa/RGB-Color-Organ

I got the Serial to work. Now i can get strings, but now when i include this

if (data == "OFF")
{
for (int i = 0; i < 7; i++)
{
Palatis::SoftPWM.set(pwmLEDsLeft*, 1);*
_ Palatis::SoftPWM.set(pwmLEDsRight*, 1);_
_
}_
_
}[/quote]_
my code crashes. And arduino does not do anything it works like one sec and then stops working.
Full code is here:
> #define SOFTPWM_OUTPUT_DELAY*

> #include <SoftPWM.h> // Include Palatis SoftPWM libary GitHub - Palatis/arduino-softpwm: Software PWM library for Arduino
> SOFTPWM_DEFINE_CHANNEL(3, DDRD, PORTD, PORTD3); // Arduino pin 3
> SOFTPWM_DEFINE_CHANNEL(5, DDRD, PORTD, PORTD5); // Arduino pin 5
> SOFTPWM_DEFINE_CHANNEL(6, DDRD, PORTD, PORTD6); // Arduino pin 6
> SOFTPWM_DEFINE_CHANNEL(7, DDRD, PORTD, PORTD7); // Arduino pin 7
> SOFTPWM_DEFINE_CHANNEL(8, DDRB, PORTB, PORTB0); // Arduino pin 8
> SOFTPWM_DEFINE_CHANNEL(9, DDRB, PORTB, PORTB1); // Arduino pin 9
> SOFTPWM_DEFINE_CHANNEL(10, DDRB, PORTB, PORTB2); // Arduino pin 10
> SOFTPWM_DEFINE_CHANNEL(11, DDRB, PORTB, PORTB3); // Arduino pin 11
> SOFTPWM_DEFINE_CHANNEL(12, DDRB, PORTB, PORTB4); // Arduino pin 12
> SOFTPWM_DEFINE_CHANNEL(13, DDRB, PORTB, PORTB5); // Arduino pin 13
> SOFTPWM_DEFINE_CHANNEL(14, DDRC, PORTC, PORTC0); // Arduino pin A0
> SOFTPWM_DEFINE_CHANNEL(15, DDRC, PORTC, PORTC1); // Arduino pin A1
> SOFTPWM_DEFINE_CHANNEL(16, DDRC, PORTC, PORTC2); // Arduino pin A2
> SOFTPWM_DEFINE_CHANNEL(17, DDRC, PORTC, PORTC3); // Arduino pin A3
> SOFTPWM_DEFINE_OBJECT_WITH_PWM_LEVELS(14, 102); // Define how many pwm channels project uses and how many steps it has
> // MSGEQ7 bands = 63Hz, 160Hz, 400Hz, 1,000Hz, 2,500Hz, 6,250Hz, 16,000Hz
> static volatile uint8_t v = 0;
> int ctrlReset = 2; // Digital pin 2 = signal to reset MSGEQ7s
> int ctrlStrobe = 4; // Digital pin 4 = signal to strobe (read data from) MSGEQ7s
> int channelLeft = A5; // Analog pin A5 = spectrum data from left channel
> int channelRight = A4; // Analog pin A4 = spectrum data from right channel
> int spectrumLeft[7]; // Array to store 7 bands of spectrum data from left channel
> int spectrumRight[7]; // Array to store 7 bands of spectrum data from right channel
> int pwmLEDsLeft[] = {3, 5, 6, 7, 8, 9, 10}; // Array to store data where leds are connected.
> int pwmLEDsRight[] = {11, 12, 13, 14, 15, 16, 17}; // Array to store data where leds are connected.
> int brightness = 50;
> String data = "ON"; // Mode ON = Music, 2 = Still, Anything else = off
> String bluetooth;
>
> void setup()
> {
> Serial.begin(9600);
> pinMode(ctrlReset, OUTPUT); // Define reset as output
> pinMode(ctrlStrobe, OUTPUT); // Define strobe as output
> digitalWrite(ctrlReset, LOW); // Pull the reset signal low
> digitalWrite(ctrlStrobe, HIGH); // Drive the strobe signal high
> Palatis::SoftPWM.begin(60); // Begin with 60hz pwm frequency
> //Palatis::SoftPWM.printInterruptLoad(); // Print interrupt load for diagnostic purposes
> }
>
>
> void loop()
> {
> while (Serial.available())
> {
> delay(10);
> char c = Serial.read();
> if (c == ':')
> {
> break;
*> } *
> bluetooth += c;
> }
> if (bluetooth.length() > 0) {
> data = bluetooth;
> bluetooth="";
> }
> if (data == "ON")
> {
> readMSGEQ7();
> writeLEDs();
> }
> if (data == "OFF")
> {
> for (int i = 0; i < 7; i++)
> {
> Palatis::SoftPWM.set(pwmLEDsLeft*, 1);*
> _ Palatis::SoftPWM.set(pwmLEDsRight*, 1);_
> _ }_
> _ }_
> _ Serial.print(data);_
> _ Serial.print("\n");_
> _}_
> void readMSGEQ7()
> _{ // Read the seven spectrum bands from the MSGEQ7 chips*
> * digitalWrite(ctrlReset, HIGH); // Pulse the reset signal, which causes*
> * digitalWrite(ctrlReset, LOW); // the MSGEQ7s to latch the spectrum values*
> * delayMicroseconds(72); // Delay to meet minimum reset-to-strobe time*
> * int nF = 50; // Noise filter level.*
> * for (int i = 0; i < 7; i++) // Cycle through the 7 spectrum bands*
> * {*
> * digitalWrite(ctrlStrobe, LOW); // Read current band (then increment to next band)*
> * delayMicroseconds(36); // Wait for outputs to settle*
> spectrumLeft = analogRead(channelLeft) / 10; // Store current values from left & right channels
> spectrumRight = analogRead(channelRight) / 10; // Divide 0-1023 by 10 to give about 0-100
> //if (spectrumLeft < nF) spectrumLeft = 0; // Noise filter left
> //if (spectrumRight < nF) spectrumRight = 0; // Noise filter right
> * digitalWrite(ctrlStrobe, HIGH);
> delayMicroseconds(36); // Delay to meet minimum strobe-to-strobe time*

> * }
> }
> void writeLEDs()
> {
> for (int i = 0; i < 7; i++) {
> Palatis::SoftPWM.set(pwmLEDsLeft, spectrumLeft);
> Palatis::SoftPWM.set(pwmLEDsRight, spectrumRight);
> Serial.print(spectrumLeft);
> if (spectrumLeft < 10) Serial.print(" ");
> Serial.print(" ");
> Serial.print(spectrumRight);
> if (spectrumRight < 10) Serial.print(" ");
> Serial.print(" | ");
> }
> Serial.print("\n");
> }
> [/quote]*_