Output Devices
Somehow you don't realize batteries produce current until you short out a board by plugging it in the wrong wayI decided to work on programming a speaker board this time, in line with one of my original final project ideas - that of a sound redirector from one side of the head to the other for people who have hearing loss in one ear. I'd have to eventually integrate a microphone to create that, but for now I wanted to program the speakers to play a simple tune, to see how well they work.


The first time I milled this board design, the wire that should have run between the second and third rows of the 2x3 header ended up connected to the second row of the header, because I placed it too close to the header pieces in the above design - so even with a .010in endmill, there wasn't enough room to fit a cut. Basically, always leave a gap between wires *at least* as wide as the tip of the endmill you're cutting with.
The below image shows the badly-milled board (left) and the correct design (right).

I milled two boards with the redesigned schematic for safety's sake, and this time as always it paid off. Soldering parts to the first board was quite simple (although I now understand the importance of a properly heated soldering iron tip), but when I went to plug the battery into the board, I accidentally inserted the header in the wrong direction, (+ -> ground instead of VCC) and short-circuited the board. Again. Wires turned red and began smoking, and while I didn't see a noticeable broken wire, I decided not to take the risk and soldered a second board. Make sure you understand the orientation of your header, especially when there's a battery on the other end that can't regulate power output, unlike a USB cable.
The second board, with the speaker and battery attached in the correct orientation, is shown below.

Unfortunately, the IDC lab's AVRISP programmer was broken - again, somehow - and I did not have a functioning programmer to use to load code onto the board. The code I would have used to program the board to play a simple melody is included below, for reference.
Notes file (toneMelody.ino)
Pitch definitions (pitches.h)