Go Down

Topic: Arduino library for PAM8803 audio amplifier module (Read 7 times) previous topic - next topic

robtillaart

Quote
Updated the library. Now, I will work in improve the volumeUp and Down speed without modify class protocol.


Link to the latest version?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

the-rebel-agent

Latest lib could be downloaded from the very first post once you are logged in. About the PAM8803 retrolefty found, the price is great but the size is huge. In my laser gun project size and room are quite important. The one I bought, even If the a few bucks expensive, only measures 2cm x 2xm and could be powered from 3.3 up to 6 v.

retrolefty

In the library code:

Code: [Select]

void Pam8803::setDigitalVolumeControl(int volumePin){
  digitalWrite(volumePin, LOW);
  delay(30*3.5);
  digitalWrite(volumePin, HIGH);
  delay(30);
};



What is the purpose of the 3.5 value in the delay statement? Would that cause the floating point math library to be pulled into the compiled code? Why not just a delay(105) statement?

Lefty

the-rebel-agent

That's why each volume transition requires VUP or VDOWN pin remais active low for 3.5 clock cycles. I did not floating point lib would be included. I will put 105 instead. Thanks for the suggestion.

creatrope

This library and module work nicely.

However, I'm using it for a clock like application for late night use, and even at the lowest setting

pam8803.setVolume(0);

it's still far too loud...

It's definitely adjusting by setVolume.  setVolume(100) is very loud, and setVolume(10) is modest, but even setVolume(0) is far louder than what a simple PWM out would be (which is what I was using before).  I had assumed that setVolume(0) would effectively be no volume.

I'm wondering if I'm using it correctly?

I'm using this one:
http://www.ebay.com/itm/2-2W-4O-PAM8803-Class-D-Audio-Amplifier-Board-Simple-/350604041652?pt=US_Home_Audio_Amplifiers_Preamps&hash=item51a1a11db4

--creatrope

Go Up