0
\$\begingroup\$

I am creating a project where I have a speaker that starts playing music as soon as movement is detected. When movement is detected a ledstrip also turns on to illuminate the room. The project consists of the following main parts:

  • 12 volt power supply The power supply powers the arduino led controller and the amp board with speaker

  • Arduino led controller Consists of a prototype board with an arduino nano that drives the ledstrip through mosfets. It also contains an IR sensor and radar sensor for detecting movement. The arduino has a serial connection (only transmitting currently done with voltage divider) with the rpi so it can send a message when movement is detected so the rpi can play or pause the music. The arduino and RPI are grounded.

  • Raspberry Pi Zero Volumio image is installed on the SD card. I switched gpio pin mapping so I have audio an arduino signal coming out of gpio pins. The pins are connected with a twisted wire to the amp. The rpi and amp are grounded to each other because both are connected with a ground wire to the prototype board.

  • Amp board with speaker The amp board is connected to the prototype board of the arduino led controller that is powered by the power supply.

Currently my setups works but I come across a couple of problems.

  • Problem 1: When led strip is turned on I hear some weird sine wave like noise (depends on the color) when no music is playing

My thought: I think the ledstrip is generating noise on the ground line. I have seen some component like a dc/dc isolator on other projects on youtube regarding amplifiers in combination with other components from the same power supply. Could this resolve the problem and where to place this in the circuit?

  • Problem 2: The rpi and the arduino should always be on, but I am not sure if I want that to be the case for the amplifier. I was thinking turning it on or off with a relay when the rpi receives signal to start playing or pausing audio. The problem is everytime I turn on the power to the circuit I hear a pop from the speaker. This would be annoying to hear the pop everytime when movement is detected and music starts playing. Is there a way to solve this issue or doesn't it matter that the amp and speaker are always powered?

  • Problem 3: When no music is playing I still have some quiet buzzing sound coming from the speaker. Currently there is only 2 twisted wires without ground going from the RPI to the amp as audio input. This was because I thought the RPI is already ground through the ground wire for the serial connection with the arduino, in which the arduino prototype board has a ground connection to the amp. Is it better to make 3 twister wires (with ground) from rpi to the arduino and will that reduce the noise further?

I don't have a overview circuit diagram for the wiring but if it helps I can create one. Improvements are always welcome!

Here are pictures: Overview with annotations

Serial connection

\$\endgroup\$
1
  • \$\begingroup\$ Ground loops is more than likely the problem. Use an audio transformer to isolate the ground loop between the thing at the top in your top picture and the mainly whitish thing that takes the audio input from the thing at the top. \$\endgroup\$
    – Andy aka
    May 13, 2020 at 14:07

1 Answer 1

0
\$\begingroup\$

If you are sincere about clean signals, then implement "local battery" for each module.

The "local battery" requires slightly modifying the common_VDD wiring.

You must modify VDD FOR EACH MODULE by installing 100 microHenry in series, followed by the module in parallel with 100 microfarad.

Of high importance in success with "local battery" is WHERE TO GROUND THE CAPACITOR ---- connect the capacitor Return lead/Ground Lead/(-) lead to the module GND pin. Do not casually connect the capacitor (-) lead to the Power Supply GND.

For example, if you have 5 "local batteries", then there will be 5 unique physical points where the 5 capacitors are connected to "Ground".

This is because the wiring has about 1 microHenry inductance per meter (approximately; does increase as log(length) ), and the Ground Upset is

V = L * dT/dT

where

1uH and 1 amp changing in 1 microsecond produces

V = 1e-6 * 1amp/1e-6 second = 1 volt of Ground spiking for 1 microsecond.

Learn to use the "local battery" with series inductor and shunt capacitor.

For critical circuits, I very happily use series 1 ohm or 3.3 ohm or 10 ohm resistors, with shunting capacitors of 10UF, for opamp circuits I want to be -80 dB trash floor. The resistor is crucial to reject Switching Regulator trash.

How big can "local batteries" become? For motors and their spikes (perhaps their VFD variable frequency Drive electronics), if you INSIST the system must share a VDD among all modules, I'd use 1uHenry in series and 10,000 uF across the motor electronics. This big cap will draw a large initial charging surge when you first power_up the system. The wiring resistance may be adequate to dampen the LC ringing. You need about Rdamped == sqrt( L / C ) for Q of 2, which is rather well dampened.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.