Pages: [1]   Go Down
Author Topic: A Microcontroller Amplifer (theory)  (Read 427 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 20
Posts: 2115
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ...
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 20
Posts: 2115
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You might also look at Class-D amplifier
http://en.wikipedia.org/wiki/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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Edison Member
*
Karma: 23
Posts: 1171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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 clipping (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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: