Overview
For Boston University's Artemis Project the BU Electronic Design Facility (EDF) offers a two day session where we teach the students how to solder, solder up a kit and then do some embedded programming, traditionally on 8-bit AVR microcontrollers. Usually the project is a variation on the POV toy, which you see around online all of the time as a beginner electronics project. However, we decided to deviate from our traditional path this year and create our own synthesizer kit, with an SPI DAC, Audio Amplifier, Microcontroller and some buttons. There is also a possibility for programming in new wave forms via an optical link with a computer (post coming soon). To give a good overview of the whole project I plan on doing a write up on each part of the project as I go along.
First up lets check the constraints of our Audio Amplifier and see if we can get it working in an appropriate way. The amplifier we are using is a TDA2822M and is a dual audio amplifier. We are not driving a stereo channel, so we will be using the TDA2822M in a bridge configuration inorder to both push and pull on the speaker dramatically increasing the amount of power we can drive through the speaker.
Table of Contents
Schematics and Parts^
Schematic^
Schematic for the TDA2822M Bridge. Taken from the datasheet
Part List^
- 3 .1uF Capacitors Ceramic
- 1 10uF Electrolytic Capacitor
- 1 470uF Electrolytic Capacitor
- 1 TDA2822M Dual Audio Amplifier
- 1 10k Ohm Resistor
- 2 4.7 Ohm Resistors
- 1 8ohm speaker
Notes on the Schematic^
The datasheet for the TDA2822M is where the schematic above was pulled from. The schematic is a basic bridge, which drives both sides of the speaker in mono for added power. It is important to note the gain of the circuit for future calculations since the output of or DAC will be full swing from 0V to 5V (or close). Thus we will need to divide those voltages so that we don't clip everything to a funky looking square wave. At 1kHz the noted voltage gain is 39db, which is about Vin*89.125. A rather respectable gain, which we will later have to contend with.
The Testing^
I decided used to prototyping with breadboards, but this time I have decided to use protoboard and solder and skip breadboards completely. While breadboards are nice I find that if I spend the time to sit down fully plan what I am doing and soldering it down on to protoboard that I reach an end result faster.
Once the soldering was done (see schematic above), I hooked up the input of the TDA2822 Audio Amplifier to a digital output of an arduino and used the tone function. The code that was used was straight from the Arduino examples. I just wanted to test that I could amplify sound and play it through the speaker. Both of the speakers I had available performed very well. However, the cost difference means that we should choose the lower cost speaker even though the sound quality is worse (but not by much). We want to minimise cost, while still providing a system which can be used to experiment with sound, or any application which requires a decent quality DAC.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
/* Melody Plays a melody circuit: * 8-ohm speaker on digital pin 8 created 21 Jan 2010 modified 14 Oct 2010 by Tom Igoe This example code is in the public domain. http://arduino.cc/en/Tutorial/Tone */ #include "pitches.h" // notes in the melody: int melody[] = { NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4}; // note durations: 4 = quarter note, 8 = eighth note, etc.: int noteDurations[] = { 4, 8, 8, 4,4,4,4,4 }; void setup() { // iterate over the notes of the melody: for (int thisNote = 0; thisNote < 8; thisNote++) { // to calculate the note duration, take one second // divided by the note type. //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc. int noteDuration = 1000/noteDurations[thisNote]; tone(8, melody[thisNote],noteDuration); // to distinguish the notes, set a minimum time between them. // the note's duration + 30% seems to work well: int pauseBetweenNotes = noteDuration * 1.30; delay(pauseBetweenNotes); // stop the tone playing: noTone(8); } } void loop() { // no need to repeat the melody. } |
Results^
Here is a video of the results of the test:
The audio amplifier works very well and can run at 3.3V or 5V, but I have concerns about it running at 3.3V with the SPI DAC.
4 thoughts on “Artemis Synthesizer 1: Testing the TDA2822 Audio Amplifier”