I'm reading Make: AVR Programming. The next project wants me to try to drive an 8 ohm speaker with a pin from the microcontroller.

I'm no EE, but I do know that 8 ohms is not a lot of resistance, and it seems like we're going to run into problems running too much current through the microcontroller pin.

The book's solution is to use a "blocking capacitor". For some reason, I'm still a bit skeptical this is safe for my microcontroller. There are no resistors anywhere in sight. Here is the page from the book:

Blocking capacitor diagram

Question: if I don't care about sound quality, is this circuit safe for my microcontroller? The maximum current is supposed to be 40mA per pin.

  • \$\begingroup\$ i would put a 500ohms in series with the avr (OR replace the cap with a smaller 20-30nF cap). Either option will limit the current. \$\endgroup\$
    – hassan789
    Mar 19, 2015 at 4:01

1 Answer 1


Whoever wrote that page is criminally wrong. The blocking capacitor is only an open to DC. The AC current will still be much higher than the AVR's absolute maximum. As a minimum, put a push pull buffer between the micro and speaker. I would rather see a low side switch.

  • 1
    \$\begingroup\$ @Jakerc You might want to throw that book away. \$\endgroup\$
    – Austin
    Mar 19, 2015 at 9:29
  • 1
    \$\begingroup\$ Looked into it further, the author has a Ph.D in Economics, was a career statistician, and considers himself an electronics hacker, explains everything. \$\endgroup\$
    – Matt Young
    Mar 19, 2015 at 12:18
  • \$\begingroup\$ Thanks, guys. @Austin, it's a book from the library, so I don't think that's my best option, but I'm glad to hear my skepticism was well-founded. \$\endgroup\$
    – Jakerc
    Mar 19, 2015 at 13:48

Your Answer

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

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