This page covers my Pokey Watch project- chromatic tuners for musical instruments, made in the shape of pocket watches. I made them for my music-major friends, who I always joke are better-dressed than I am. And what better way to be classy than a pocket watch?
Before going any further: Why "Pokey Watch"? I was emailing pictures to my cousin, and she mistyped something along the lines of "cool pokey watch". I just decided to roll with it.
The overall thing is pretty simple, but it still took a lot of effort to put together. The electronics were definitely the easy part, though maybe that speaks more to my capabilities (or lack thereof)than the actual difficulty of the tasks involved. Anyway, the circuit is basically just a microphone feeding into an op-amp, which is sampled by the ADC on an ARM Cortex M3 micro (NXP LPC1313). There's also a couple LEDs for output, a voltage regulator, and a LiIon battery charging circuit. Even milling the circuit board was pretty straightforward- it's a simple circuit.
The circuit board. Clockwise from the top of the board: Microphone cutout, op-amp, voltage regulator circuit, power switch, output LEDs, battery charge circuit. The middle is obviously the microcontroller.
I probably should have put some nail polish or something over the traces to prevent corrosion, but we'll see. If they start getting sketchy, I can do that down the line (after retrieving them from my friends, that is).
The software is similarly simple: It simply samples the ADC, does a FFT (using the wonderful KISSFFT library), then maps the dominant frequency to a pitch. The final version I have flashed on the units I gave to my friends sampled at 1200 Hz, and will detect notes from A3 to Db5. I feel kind of bad about that, as one said friends is a low brass player, so he has to tune the upper register of his horns.
Music notes are on a logarithmic scale; A4 is twice the frequency of A3. So the higher notes have a larger distance (in terms of Hz) between them. Tuners report flat/sharp in terms of "cents"- 1/100 of the step between the current note and the next note. If you put those things together, you can see that the lower notes each have a very small cent- under 0.1 Hz. Due to imprecision in my sampling and the limited size of my FFT, I wasn't confident I could consistently tune that well at low frequencies, so instead of doing something that may or may not work well, I just limited it. I might re-evaluate that later (firmware updates are easy; you can see the programming header right above the microcontroller).
The case is the part I'm really proud of. It's CNC-milled from two chunks of aluminum, and took far too long to get right- I should probably take a picture of the failed attempts.
Anyway, the cases started out as plate, like this:
Case top, one side milled
Then I milled out one side, flipped it over, milled the other, and finally cut it out. Again, not rocket surgery, but I messed up a couple times (don't flip about the wrong axis...). After being cut out, I ended up with pieces like these:
Milled case halves. You can probably see how it fits together. The USB port cutout hasn't been done yet on the bottom half.
(Milling the USB cutout was pretty easy, comparatively. I just clamped the bottom half to the edge of my table, and milled it out- you can see it in some of the more-complete pictures)
With both halves done, they needed to be joined together. This was more nerve-wracking than I care to admit- it took a few hours to mill each piece, and breaking a drill bit (or drilling crooked) could make it for naught. And breaking 1.5mm drill bits is easy. Surprisingly enough, drilling went OK:
Hinges drilled!
The next order of business was making a hinge pin. Fortunately this too was easy- I just found a jumbo-sized paperclip that had the right diameter, and cut a chunk out of it. The end of that chunk was hammered out a bit, and then the whole thing was pounded into the hole. It's not perfect, but it works pretty well:
Paperclip hinge pin inserted
With that, things were basically done:
Assembled enclosures, prior to finishing touches.
Things look pretty good at this point. There's some slight play in the hinge, and the lids and bases don't quite line up perfectly, but it's nothing worth re-doing things over. Oh, and one of the logos is actually what I would call upside-down, but I also wasn't re-doing that. What I did want to do was make things look a little more professional- those tooling marks weren't exactly what I had in mind. A little elbow grease with a ScotchBrite pad later, and the cases have a nice brushed finish. I didn't do the inside of the lid because I was worried I wouldn't be able to consistently finish it, which I think would be worse than the tooling marks.
Brushed finish on the lid. You can also see the USB cutout in this image.
As you can see, the ScotchBrite pad worked like a charm. It had the added benefit of rounding off the sharp edges from the detail engraving, leaving it smooth to the touch. The last mechanical thing to do was to stick the board in the case. The battery was hot-melt glued to the back of the board, which was press-fit into the case. This required a little bit of sanding down the board edges to the correct size, but it worked pretty well:
Fully-assembled watches. This also shows the cap screw I put on top for aesthetic reasons- it doesn't actually do anything other than look like the winding mechanism of a real pocket watch.
Finally, testing in-situ. I had already tested the parts individually, but there's nothing like seeing things work all at once together:
Charging the battery. Yes, that LED is obnoxiously bright. But it gives a cool alien effect when charging in the dark, so I'm calling it good.
And the actual testing of the tuner part:
Overall, it works pretty well. Meaning it accurately detects pitch. And looks snazzy while doing it.
Despite that, there are a couple things I'd like to fix, given infinite time, patience, and resources. Firstly, it would probably be a good idea to put a low-pass filter on the output of the op-amp. I haven't seen any issues from not having one, but in principle it would be a good idea. I'd also like to have used a chip with a little more RAM- a slightly-larger FFT could have been beneficial. And, of course, protecting the copper on the board from corrosion would have probably been a good plan. Finally, making the cases absolutely perfect would be ideal. There's some play in the hinge that's unprofessional, one of the logos is upside-down, and there are still tooling marks on the inside. I'd also like to add a magnetic closure. That could probably be retrofitted, with a small magnet inserted into the lid and a magnetic screw put in the top where the stainless cap screw currently is. (OK not quite "finally"- I'd also like to re-think the power switch).
There's also a lot of good things here. I think the case design is really good- it's pretty, sturdy, and easy to take apart if need be, so the battery can be replaced, traces repaired, etc. I still think the programming header I left on the front is a good idea, since it makes future firmware updates possible. The simplicity of the firmware is also nice- that wasn't really a design "decision", but it's nice all the same.
Finally, I finished a project, it works, and it looks good. That in and of itself is awesome.