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!