I have built a full duplex wireless audio communication system where the wireless part is taken care by esp12 and using an Arduino as the ADC and DAC (Pin 9 fast PWM based DAC) for audio receiving (using ADC) and production (using PWM DAC). So far I was doing POC and using Arduino UNO, now I want to package the whole thing for use, and for that purpose I replaced the whole UNO board with Arduino Pro mini (5v 16 mhz) because of its size.
Now the problem is I am getting enough noise primarily high frequency hiss like radio static. The mic preamp is fairly quiet and has a good s/n ratio. With the uno the noise was bearable but while changed to pro mini the noise level went to unacceptable state. How should I cure this?
- Mic preamp gives a 2.5 v offset output that goes directly to A0 pin.
- Using a audio amp pam 8403 for the output, and pwm dac on pin 9.
- Using timer 2 to synchronize all read writes. the ISR has a serial read and a serial write to send and receive data within same ISR invocation. Serial read data is sent to D9, and ADCH is output via Serial write.
- This serial wires are connected to esp8266 rx/tx pins. esp processes the data and send over wirelessly to other end (android).
- Even if i touch the A0 pin/wire it picks up increased hum/noise along with those high frequency noise components. That means even if i do not connect A0 with mic amp output the noise id still very persistent. This problem was much less in case of Arduino UNO board.
The entire system is running with a single power supply which is powering up the audio amp, mic preamp, arduino, and the esp. Its highly likely that much noise is produced by the audio amp, and as all the devices are on same rail the noise is flowing from one end to another.
I read on ADC, and the doc/forum posts say that I must do something to AVcc, AREF and AGND. So far I have not done anything with these pins and they are left untouched on the pro mini. I think they require some sort of biasing that might prevent this excessive noise.
AVcc should be externally connected to Vcc,
AGND is already connected to GND as its a Arduino, or some LC filter (Vcc-Avcc 10uh, Avcc to ground 100 nf)
AREF-0.1uf to GND ?
Mic output to A0 pin - Should I put some RC LP filter to remove some HF noises? What are the values?
Can anyone suggest some definitive solution to this problem?
Appreciate you help!
mic preamp.pdf (77.5 KB)
ArduinoAudioTransceiverV4.ino (4.28 KB)