Components and supplies

Apps and online services

About this project

You will soon begin to realize that I cannot stay idle. I make things when I'm not idle.

Application for MEGA BREAD

Wanting some kind of sounds available on our Robotics platform the MEGA BREAD, I ripped apart an old laptop and rescued the little speakers out of it. Please do not hook this power amp up to the tiny Piezo speakers, no clue what would happen, but it would probably be a fantastic light show. Giggle.

This is the kind that I rescued. Note the 8 Ohm 0.7 Watt markings on the back.

Saved these from another older lappy top

Solder and Connections

Soldering both of the grounds together, and then 2 speaker inputs is what you want to have. The two soldered grounds will actually be going to the +5 Volt supply, these NPN transistors work on the negative side of things, like a switch on the Negative battery terminal and not on the positive. That is the easiest way I can explain it.

The two PN2222A transistors with 100 Ohm resistors

Top down view for your convienince

Video to Show Amps in Action

Here is a short video with the amps working. At least a 75% rise in volume and clarity was also increased slightly.

The Stereo Audio Amps at work

Code

MEGA BREAD - Stereo Audio Power AmpsArduino

Increase your audio volume, and gain a second chanell.

#include<ArduinoSound.h>intspeakerPINL=7;intspeakerPINR=6;// notes in the melody:intmelody[]={NOTE_C4,NOTE_G3,NOTE_G3,NOTE_A3,NOTE_G3,0,NOTE_B3,NOTE_C4};// note durations: 4 = quarter note, 8 = eighth note, etc.:intnoteDurations[]={4,8,8,4,4,4,4,4};voidsetup(){}voidspeakerPlayL(){for(intthisNote=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.intnoteDuration=1000/noteDurations[thisNote];tone(speakerPINL,melody[thisNote],noteDuration);// to distinguish the notes, set a minimum time between them.// the note's duration + 30% seems to work well:intpauseBetweenNotes=noteDuration*1.70;// This is the slower valuedelay(pauseBetweenNotes);// stop the tone playing:noTone(speakerPINL);}}voidspeakerPlayR(){for(intthisNote=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.intnoteDuration=1000/noteDurations[thisNote];tone(speakerPINR,melody[thisNote],noteDuration);// to distinguish the notes, set a minimum time between them.// the note's duration + 30% seems to work well:intpauseBetweenNotes=noteDuration*1.20;// This is the faster valuedelay(pauseBetweenNotes);// stop the tone playing:noTone(speakerPINR);}}voidloop(){speakerPlayL();speakerPlayR();}