element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum LM386N-4 Amplifier Noise with Raspberry Pi
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 8 replies
  • Subscribers 664 subscribers
  • Views 2040 views
  • Users 0 members are here
  • amplifier
  • lm386n-4
Related

LM386N-4 Amplifier Noise with Raspberry Pi

Sean_Miller
Sean_Miller over 4 years ago

I've been fighting a hum in my amplifier circuit on my Raspberry Pi -but only when my Pi and the amplifier are powered by the same battery.

 

If I plug a speakerbomb into the Pi which is powered by its own battery - it sounds great.

If I power my amplifier with anything other than the Raspberry Pi battery and plug the Pi's headphone jack to it - it sounds great

 

It only sounds bad when both the Pi's switching regulator and the amp circuit are powered by the same battery.  The amp is powered upstream of the switching regulator

 

I've tested many ranges of caps at the LM386-N4's power pin to no avail.  I tried different speakers.  I tried different LM386N-4LM386N-4 chips.  Same behavior.

 

I have a cap in the signal line from the headphone jack that helped a little, but not enough.

 

Any thoughts on what could remedy this behavior.

 

image

  • Sign in to reply
  • Cancel
  • shabaz
    shabaz over 4 years ago

    Hi Sean,

     

    Removing the capacitor on pin 7 (i.e. leave pin 7 disconnected) can help, often it turns the LM386 into a radio receiver when that's there : )

    Also, personally, I would try to connect pin 3 to ground via 2.2k resistor, and then change your 0.01uF input capacitor to something larger (try 1uF to 4.7 uF or so).

    If you disconnect the left side of that capacitor, you can insert in a ferrite bead inline with the capacitor, and also solder a (say) 10nF capacitor to ground from that left side of the capacitor too. That will act as a sort of RC filter, where the R is the ferrite bead. It will help reduce high-frequency noisy pickup from the audio input. Also, between the supply pins (4 and 6) solder a capacitor (maybe 100 uF) and also a 100nF capacitor in parallel. Change the two left side resistors (1k) to something lower, say 220 ohm.

    These are just some ideas, others may have better suggestions, but I think there's a chance it may improve things a bit.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • jc2048
    jc2048 over 4 years ago

    Perhaps try this and see if it helps

     

    image

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • jc2048
    jc2048 over 4 years ago in reply to jc2048

    Thinking about it a little more, this might be better than what I gave above

     

    image

     

    Your low value of coupling capacitor [10n], to give you a HPF, means that there's a considerable change in phase around the cut-off frequency [325Hz] (see plot below). If we keep the inverting path the same with a similar capacitor, the two effects will cancel, otherwise we're losing the benefit of the differential input lower down.

     

    imageimage

     

    BTW this 'solution' might actually make your situation worse rather than better, but at least it will be telling you things about what the noise is and how it's affecting the circuit. Any chance of some 'scope traces?

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • Sean_Miller
    Sean_Miller over 4 years ago in reply to jc2048

    I see where this one is going.  I'll try it out.

     

    I actually have a big ground plane that the ground of the 3.5mm port as well as the battery ground are connected to.  However, a ground loop is the problem here.

     

    Last night I cut the battery side relying on just the ground plane taking things to ground via the raspberry pi headphone jack.  Call me crazy, but it did get quieter.

     

    I'll get things going and should have something in a few hours.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • Sean_Miller
    Sean_Miller over 4 years ago in reply to jc2048

    This is the one (the first picture you sent) I went with and it eliminated the buzz.  I breadboarded it and was happy without that cap at pin 3.  After I soldered it on the perf board, I picked up a faint radio station.  So, in the morning, I'm going to add back in that cap to see if it kills that.  Somewhere along the way, I believe I found that would kill it.

     

    The data sheet simply shows pin 2, 4 and the incoming negative going to a common ground.  However, putting the negative from the pi's headphone jack directly to pin 2 definitely killed the hum.  I'm thinking "ground loops" was the issue.

     

    Thanks for the tip!

     

    See ya',

    Sean

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • Sean_Miller
    Sean_Miller over 4 years ago in reply to Sean_Miller

    After I hooked it back to the battery and got it back in my project - the amp worked great.  Didn't need to add the pin 3 cap.

     

    The datasheet is very misleading on this one, so I'll be sure to mark up my copy so I don't connect pins 4 and 2 together ever again.

     

    Thanks,

    Sean

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Cancel
  • geralds
    geralds over 4 years ago in reply to Sean_Miller

    Hi Sean_Miller ,

     

    You can read this datasheet as well. The original datasheet from national.

    Best Regards

    Gerald

    ---

    Attachments:
    imageLM386_nat.pdf
    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • Sean_Miller
    Sean_Miller over 4 years ago in reply to geralds

    Thanks for sending.

     

    What gets me on these datasheets is the #2 pin showing ground just as all the others. 

     

    I don't see where it distinguishes this ground to be separate from the other grounds.  I found that tying pin 2 to a common ground versus just the '-' of the headphone cord led to the ground loop noise.

     

    See ya',

    Sean

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube