70 watt amp uses an ATtiny

If you’re looking for a DIY amplifier project made with a minimum of parts, this is the build for you. [Rouslan] created a 70 watt class D amplifier using an ATtiny45 and just a few dollars worth of additional components.

A class D amplifier simply switches transistors of MOSFETs on and off very rapidly. By passing the signal produced by these MOSFETs through a low pass filter and connecting a speaker, a class D amp is able to amplify a signal very efficiently. Usually, these sort of amp builds use somewhat esoteric components, but [Rouslan] figured out how to use a simple ATtiny microcontroller to drive a set of MOSFETs.

In [Rouslan]‘s circuit, the audio signal is passed into the analog input of an ATtiny45. Inside this microcontroller, these analog values are sent to the MOSFETs through a PWM output. [Rouslan] threw in a few software tricks (explained in revision 2 of his build) to improve the sound quality, but the circuit remains incredibly simple.

[Rouslan] posted a video going over the function of his ATtiny amp, and from the audio demo (available after the break), we’re thinking it sounds pretty good. Amazingly good, even, if you consider how minimalistic this 70 watt amp actually is.

Thanks [Alec] for sending this one in.

Comments

  1. messmaker says:

    I’ve been wanting to build a class d amplifier for my wife to use… well, I would like one as well. This is a cool project, thanks for showing it here!

  2. bemis says:

    Very cool

  3. bend it like buckem says:

    Interesting.. How well does the input match the output?

    • Bill Stewart says:

      A 10-bit A/D converter on the input isn’t going to make the audiophiles very happy, but it’s certainly a good demonstration that you can build a working Class D amp with simple parts. There may be a microcomputer simpler than an ARM Cortex that has a better A/D converter, or you could go with an external A/D converter chip (unfortunately, most of them seem to be surface-mount instead of DIP formats.)

      • Pete McNeil says:

        … for fidelity sake you could use the class D amp to drive the rails of a class A amp. The class A would have very low power dissipation while removing the distortion in the class D signal. Very small BJTs and a high quality op amp would do the trick.

        When I was a kid I used to do something similar with a pair of 741s by using one as a PWM and the other as an error correction amplifier for the PA section.

  4. GeriBoss says:

    Great, I recently thought about building a better amp for home use, I’ll definitely check out this design.

  5. 3d-Guy says:

    How is the sound quality on such a thing?

  6. egasimus says:

    Pretty nice, could be good enough for a DIY guitar amp. The site just fell over, though – the Hackaday effect, maybe?

  7. jameswilddev says:

    I can’t see schematics or anything as the site is down but from how he describes it and the lack of any massive inductors this is how I assume it works:

    Input->ADC->ATMega->PWM->LC low pass->MOSFETs

    As the efficiency from a class D comes from keeping the transistors either on or off, isn’t this basically a class B(? mentions a H-bridge so push-pull?) amp with an ATMega as an input buffer?

    • orihara says:

      You’re a bit off… the video has a data flow diagram. Input->LC lowpass->ADC->ATTiny->PWM->MOSFETs->LC lowpass->speaker .

    • Bob says:

      The LC lowpass is connected between the mosfets and the speakers, not between the PWM output and the mosfets.

      The high efficiency comes from the inductor storing the energy when the mosfet is turned on and dumping it back into the speaker and the power supply rail when the mosfet is turned off.

    • Harvie.CZ says:

      1.) Having LC low-pass before mosfets would convert PWM signal to analogue signal which would revert entire effort with attiny and also such amp would no longer be class D (MOSFETs will start producing heat).

      2.) inductor is not big enough to store any energy. It’s there only to filter high PWM frequency from audio passed to speakers. efficiency is achieved by switching rather than limiting current (which produces heat).

      Eg.: when you switch off bulb your switch does not produce any heat, but if you will try to just reduce light intensity using resistor it will surely get hot. That’s why transistors in class D are driven to act like switch (only ON or OFF) rather than like resistor (any resistance other than 0 or infinity).

      You can also imagine that you are holding rope with something heavy on it’s end. While you are holding it still it’s relatively comfortable. If you drop it completely, it’s still comfortable. But if you will try to let rope slowly slip trough your hand you will probably get hurt (without proper heatsink :-)

  8. Guest #42 says:

    Very nice. Site looks very tumbled. Two ideas came to mind rather quickly.

    – If another mcu is used can you monitor input/output and match them so distortion can be minimized ( feedback like the philips mfb ).

    – Other idea that comes to mind. play sound files ( from sd-card) directly to amp.

    • Harvie.CZ says:

      And what about digital input? Like attiny V-USB soundcard with PWM output or at least SPDIF input to attiny = no need for ADC.

      • Coda says:

        V-USB is low speed only. Though it supports bulk endpoints it’s against USB 1.0 specification and that causes problems with some OS’s, and also I don’t think there is enough bandwidth or cpu cycles to do both jobs with even a 20mhz part. (USB interrupts cause headache if they are not serviced). Bandwidth of SPDIF is enormous. Maybe it’s possible using 2 AVRs, one for the V-USB and that linked via SPI (10mhz maximum unless you overclock the parts) to the second AVR to convert the data to PWM?

  9. brsxhyrds says:

    site is still down, but you have a peek with the google preview, or the cached but it lack pictures.

  10. Chris C. says:

    From the video alone, it appears it has 10 bit ADC input, dithered 9 bit PWM output. No feedback loop. 12V into a single, standard 8 ohm speaker (rather than what appears to be a parallel array of them) is only 18W. Don’t expect high fidelity at high volume from this.

    It is a great demo of a class D amp though. Would make a satisfying weekend project, or starting point for something better. A better MCU would allow 12 bit sampling, feedback, and stereo. Hope this site comes back up soon, I’d like to see the schematic and the details of revision #2.

    • Harvie.CZ says:

      BTW what is this dithering for? It prevents audio quality loss in sample conversion from 10bit to 9bit?

    • Harvie.CZ says:

      Can’t we just use 555 or TL494 for PWM modulation instead of attiny?

      • Chris C. says:

        Sure. There was a 555 class D amp on here a while back, and I’m sure the TL494 could be used as well.

        Then you don’t have to worry about how many bits resolution you have. Instead, you’ll have to worry about non-linearity, duty cycle limitations, and other stuff.

        Choose your poison. I’ve designed a class D amp in SPICE as an exercise, using nothing but cheap comparators and op-amps. It works very well in simulation. But if I was to build one for real, I’d probably use an MCU or a chip explicitly made for class D amps, since I’m far more comfortable in the digital domain.

  11. JFig says:

    There is a mirrored article complete with source and pics on simple-devices.ru (in Russian.) Here is the google translate link.

    http://translate.google.com/translate?sl=auto&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=www.simple-devices.ru

  12. Rouslan says:

    Hey guys, my website is now up – new host ;)

    You can check out the schematics and the source code. Just click on the links in the article.

    Rouslan

  13. jzatopa says:

    Great simple build. If you want to make this a hifi project you just need to find a microcontroler with 16bit more more preferably 24bit ADC.

    If you are looking for more on class D amps check out http://www.diyaudio.com/forums/class-d/

  14. Henk says:

    Luckily I happen to have downloaded the schematics before the site went down: http://i.imgur.com/VjHdj.png
    I’m certainly going to try this nifty little amplifier !

  15. Harvie.CZ says:

    BTW have somebody tried this?

  16. john_chia says:

    Cool project! Nice choice of the attiny45… One downside I haven’t seen mentioned yet is the 10-bit resolution of the ADC. Not exactly CD quality. :)

  17. Mike bradley says:

    How does it do 70 watts? A 4 ohm load at 12v is 36 watts? U less runnin more than one speaker in parallel?

    Anyways, I love it, inspired me to play with it

  18. Very amazing stuff ;)

  19. William says:

    How much did it cost to make this thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,486 other followers