A Microcontroller Amplifer (theory)

Is it as simple as feed in a signal and amplify the analog signal based on your analog value?... a bjt should be fine? A fet?

Well, the arduino in particular only puts out digital signals - you can amplify that to a higher voltage swing, or for more current drive. You can do either with a single transistor, NPN or N-channel, say to drive a speaker, or a motor, or a string of LEDs sourced from 12V, or ...

Attiny85 amplifier...

The plan to read the voltage level and then amplify the waveform via a transistor (so only 1 input, and probably a pwm pin to bias the transistor)

No sampling, all basic stuff...

You might also look at Class-D amplifier

http://www.miniinthebox.com/3w-2-mini-digital-audio-amplifier-board-dc5v-usb-power-supply_p364595.html?currency=USD&litb_from=paid_adwords_shopping&pla_adwid=9286587055_138822303_9138320463_60166828743&gclid=CIm6zKPDu7sCFbB9OgodVmkAsg

If you are reading the voltage level, that IS sampling.
PWM, you will need a low-pass filter to smooth the PWM into a DC-ish signal before running into a transistor as you propose.

well i might be wronk, couse im new to this, but arduino reads the signal in 8 bits, and that quality sounds (if you want to make audio amp). not to mention that the signal will be less than 5 volts, because then there would be no point in amplifying it, which means that from the 8 bits you will be using about half (depending on input signal lvl)... that means 4 bit signal (also depending on input signal lvl)... am i right?

No, the ADC is 10 bits.
Standard PWM out is 8 bits, but 16 bit PWM is supported by the hardware.
He didn't say what kind of amplification - voltage or current.
Aref can be adjusted - if incoming signal is 0-1V, then Aref at 1.1V will allow full 10-bit resoution. If Aref was at 5V, then a smaller range would result as you suggest.

well i might be wronk, couse im new to this, but arduino reads the signal in 8 bits, and that quality sounds (if you want to make audio amp). not to mention that the signal will be less than 5 volts, because then there would be no point in amplifying it, which means that from the 8 bits you will be using about half (depending on input signal lvl)... that means 4 bit signal (also depending on input signal lvl)... am i right?

The Arduino ADC is actually 10-bits.

But, what????

Are you talking about digital or analog amplification? The Arduino doesn't have a true analog output (there is no digital-to- analog converter built-in).

If you have a full-scale digital signal, of course it takes more bits to digitally amplify. In digital audio, maximum* level is usually defined as 0dBFS. The "numbers" in a 0dB, 24-bit, digital audio file are bigger than the numbers in a full-scale 8-bit file. But when you play the file, the analog-to-digital converter (actually the driver or software) scales the data, so that a 0dB file has the same loudness no matter what the bit-depth.

Most commercial CDs are normalized (maximized for 0dB peaks). So, if you rip the CD, open the file in a digital audio editor, and increase the volume, you'll get [u]clipping[/u] (distorted flat-topped waves). If the file isn't normalized/maximized you can digitally boost it 'till the peaks hit 0dB (or higher if you are willing to accept distortion), or you can boost parts of the file that are not already maximized.

There are some standards for the relationship between the digital dB scale and the audio line-level analog dB scale (or voltage). But, the Arduino is not strictly an audio device, and it does not comply. And, if there is an analog volume control or analog gain somewhere in the chain (such as a preamplifier) the relationship is undefined. Consumer audio equipment loosely follows the standards, so that 0dB out of a DAC is around 1 Volt. So, if you were to connect a DAC to the Arduino, and pass a signal through it, you'd get a reduction in signal/voltage level (assuming no digital amplification).

  • This applies to integer formats (such as CDs or 16-bit WAV files), and to your ADC & DAC, which are integer-based. Floating point formats have essentially no upper limit.

CrossRoads:
No, the ADC is 10 bits.
Standard PWM out is 8 bits, but 16 bit PWM is supported by the hardware.
He didn't say what kind of amplification - voltage or current.
Aref can be adjusted - if incoming signal is 0-1V, then Aref at 1.1V will allow full 10-bit resoution. If Aref was at 5V, then a smaller range would result as you suggest.

but can you adjust the Aref for arduino?

Yes, I wouldn't have brought it up if you couldn't.
See Section 24 of the datasheet for full details.