Arduino audio problem

hello, can someone please help?
im using SD card module with arduino mega to play audio using external speaker. everything is working fine, and im reading Temperature sensor and LDR, a fan and bulb are connected, if i try to digital write or analog write to the fan or the bulb, the audio becomes corrupted and just gives noise sound, any idea why?

im using pin6 for audio output, pin 23,2 for fan and bulb(connected to relay)

Could be a power supply problem: the fan and relay draw (relatively) large amounts of current, and this is causing your supply to "sag" or "brown out" - which messes with your audio module.

As a test for that, what happens if you just disconnect the fan and/or relay?

Please post your schematic, and some good clear photos of your setup.

yes bro, i think you are right, its about the current, how to fix that?

i tried to disconnect the relay as u said, and wrote digital high to the pin and the audio kept working properly, so yes it is as u mentioned.

how to fix that?

the schematic is simple brother, im using antec power supply to provide 5v,12volt to the system, and the arduino pins are connected to each module as mentioned above, could u help fixing this current "brown out" problem?

So please post it!

Text is really not an effective way to describe circuit connections.

And please post the photos.

What are the ratings of your power supplies?
Are you sure that they are adequate?

im using wire connections brother, didnt draw a schematic since its simple connection

ye the power is fine, it works properly with everything except this case, does decoupling capacitors help in that case?

Fatal mistake!

Anyhow, we can't see what you've done - so, if you want help, you need to draw that schematic to show us!

Did I forget to ask for photos?

there u go

The bit about "star" connection.

Did somebody mention photos?

The Arduino I/O pins can't directly power a relay or a regular 4 or 8-Ohm speaker.

The "absolute maximum" rated current is 40mA and that works-out to a minimum resistance of 125 Ohms (Ohm's Law).

There are "relay boards" with a built-in driver circuit.

The Arduino CAN (reliably) directly drive a piezo speaker, or you can use an audio amplifier (or powered computer speakers).

yes bro i know, im using relay module and also using powered computer speakers, if i try everything alone, everything is working fine, but if i use them all together, the Fan, the relay , the audio, everything works fine but the audio becomes corrupted, seems like a current differences or something, i need a fix for that if u could help

You know, but there's no way that people here can tell!

It's important that you provide these details.

Hence the repeated request for photographs1



i uploaded the photos, i hardly doubt that u will get any benefit from that :smiley:

but u insisted xd

i think the problem is obvious bro, as u mentioned in the first answer, its that noise, i just need help remove that noise

There are too many unlabelled connections and "black boxes" (where you can't see the internal connections, components are generic, like "Relay".

If you want help, you have to step up and provide details. The photos are a start, but it would be a significant job to understand what the connections are, just looking at those. A proper schematic (or system wiring) diagram does that, nothing else does.

1 Like

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