As I want this thing to be as small as possible, I wanted to see if the analogue output of the Teensy (the A14/DAC pin) would drive a small 8ohm speaker (one of these: https://www.rapidonline.com/Catalogue/Product/51-7389) without an additional amplifier.
To find out, I wrote a short program to send a sawtooth wave at roughly 440Hz to the analogue out. Here is the program:
/**
* Sound Check
*
* Produce a sawtooth wave on
* the Teensy's analogue out.
*/
#include "Arduino.h"
void setup()
{
analogWriteResolution(8);
}
void loop()
{
int level;
for (level = 255; level >= 0; level--) {
analogWrite(A14, level);
delayMicroseconds(8);
}
}
Connecting a speaker produces a sound that is audible but fairly quiet. I think that this would work for a earphone but not for what I wanted to do.
I next tried it with an amplifier. This was an Adafruit break out board based around a MAX98306 chip (https://www.adafruit.com/product/987). This is probably not what I will end up using as it is stereo and I only need mono but is suitable for a test and has adjustable gain. Using this, the sound is easily loud enough on the lowest gain setting.
Conclusion: amplifier required.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.