DhrBaksteen / ArduinoOPL2

Arduino library for use with the OPL2 board (YM3812) and OPL3Duo (YMF262)
MIT License
195 stars 39 forks source link

A lot of noise in headphones. #85

Closed VectorFever closed 2 years ago

VectorFever commented 3 years ago

Hi! I made OPL2 using your schematic and it seems to be working perfect. But when headphones connected there is interference. I hear shhhhhhhh always and 50 hz buzz when my hands near the board. Also i can hear pc processes like scratching sound when move cursor. When using speakers there is no such problem. Is something with the power? Maybe ams 1117 in my Chinese Arduino is not enough for such current and it causes voltage drops followed by interference IMG_20210624_195823 ?

VectorFever commented 3 years ago

Maybe it's caused by 0.1μF capacitor between lm386 negative and ground. On every lm386 schematic(lm386 headphone preamp schematics too) it's connected straight to ground. So when there is no AC coming to capacitor it acts like air and like mini antenna.

prosper00 commented 3 years ago

LM386 is notorious for noise, especially when point-to-point wired like you have there unless you're VERY careful with your layour and grounds; there are lots of various guides and tips online for cleaning up its output. It also sounds like you're running it from USB power from your PC. USB provides really noisy power. Try running it from its own power source. Ideally, 6V or so, to give your AMS1117 enough headroom to regulate it down to 5V and clean out some of the noise.

Also, maybe try taking low level audio from pin 1/2 of the LM358, and run that to a pair of computer speakers or something. I'd bet that the noise you're getting is 100% related to the LM386.

Also, it's hard to tell from your pics, but, running digital signals in close proximity to analog signals will contribute to hiss, too. I didn't include an amplifier in mine, but the way i laid it out, i kept the digital (white) and analog (blue) sides as seperate as i could. I have no hiss or hum

20210707_130959 20210707_130403

VectorFever commented 3 years ago

Here is interesting part... I have that noise only in headphones. In speakers there is crystal audio.

VectorFever commented 3 years ago

I have chosen that board factor because i made it as USB AdLib sound card to use with DosBox. USB Type-C on input, 3.5mm jack on output. Small USB AdLib :)

prosper00 commented 3 years ago

Could still be a ground problem: headphones are touching you, and therefore you are capacitvely coupled into the circuit. Speakers arent in contact with you. If your grounds arent carefully considered, this can certainly cause mains hum