Audio Sensor Output Intermittently Oscillating When Controlling LEDs

Hi,
I have a project controlling about 500 programmable LEDS using and Arduino Mega. I am using an ALITOVE 5V 60A 300W to power the LEDS directly, I am also feeding off this same power supply to power the Arduino. I'm using a SparkFun Sound Detector plugged into and powered from the Arduino to turn the LEDS on and off based on a sound threshhold I can adjust using a knob on my setup. It generally works pretty well, but at lower values (under 30? not sure what units the audio output values are in) often times the audio sensor gets stuck into some loop where it oscillates repeatedly between a low (<10) and high value (20s-30s) even with no sound and the lights are going on and off.

I am not that electrically inclined by my theory is it has something to do with the power to the audio sensor, maybe the quick on/off of the LEDs is causing fluctuation in the power supplied to the audio sensor causing to get into this glitch mode, it gets easier to duplicate when the brightness is higher.

I've tried a different audio sensor with same result, I also tried powering the microphone direct from the power supply instead of through the arduino with same result.

One idea I have is to power the Arduino/microphone totally separate from the power supply and see if that resolves the issue. I would rather have everything powered off the same supply so wondering if there is a way to use a capacitor/resistor to filter the power to the microphone and see if it goes away but not familiar with how to do this.
Any thoughts?
Thanks!

Have you missed the possibility that your wiring is causing the problem? All the signal wiring must be kept as far away from your power wiring as possible. The use of shielded wire for the sensor wiring may be necessary, with ONE end only of the shield connected to ground.
A big help if you want advice will be both a schematic of your system and a picture showing the wiring and positioning of each device.
Paul

Hi Paul, thanks for the response. I don't have a schematic, I took a picture of the enclosure with some descriptions, of the wires coming in and out, not sure if it is much help. I took a picture of the insides but it is basically a rats nest of wires. I did try disconnecting the Arduino from the main LED power supply (Except for the ground) and used just a 9 volt to power the arduino it and couldn't reproduce the glitch. It is not really a big problem as long as I keep the audio trigger threshold up higher it doesn't happen so much but is just bugging me why it happens.

I often wonder about people who say this. I have been at this electronics game for over 50 years and I can’t wire up a circuit without a schematic. Yet absolutely beginners think they can! So they must be better than me.

Here’s news for you. If you don’t have a schematic how do you know you have the wiring right? But more importantly, as you are asking for help, how do we know you have the right circuit in the first place, let alone have wired it right?

... and withheld it from us? Do you want help?

Sorry, I ran out of time to add notes to that photo which is why didn't include it earlier. Here it is now, not sure if it will provide much insight, but I am using a shield where the 5V and GND of the Arduino underneath the shield connect to 2 rows going down the middle of the shield which is where the DC power supply is soldered onto on the left. The knob, LCD and microphone get their power from that center row. I will work on a better wiring diagram or schematic.

[quote="aarg, post:5, topic:929038, full:true"]

I built it up one component at a time so never really sat down and wrote it up, but probably a good exercise that I should have done before posting here. I've never made a schematic, I've used Fritzing a little bit, would a diagram from Fritzing be good enough? I don't have one available but I will create one.

Then the problem seems closely related to the power and the power wiring.
Paul

IF you intend to spend much time in electronics, learning the universal language is important!
Paul

Hi,
Firstly, I would reverse engineer your project to draw a circuit diagram.
Pen(cil) and paper is fine and post a picture of it.

Can you also post a picture of your power sup[ply and how you have connected LEDs and Arduino to it?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

No. Please don’t do that.

We want a circuit schematic, not a wiring diagram. circuit diagrams are abstract and follow conventions in layout that allow rapid and accurate comprehension - as mentioned above its the universal language of electronics.

Ok, thanks all for the feedback. I will keep playing around with this on my own for now but if I post another question at some point I will be more prepared with schematics.

I have a better idea. Make schematics for your own use. It will probably help you fix the issue.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.