As I learned from the last test, the mic I was using was adding lots of noise/distortion to the recorded sample so the first step was to try and clear that up by trying a different mic. I ended up going with the Logitech Labtech 600
We'll need to find cheaper alternative somewhere down the road but for initial tests this is a good option. As soon as I ran a few tests with this mic through the Pi's sound card I immediately started getting cleaner sounding recordings.
The next step was trying to figure out if there is a easy way on the Pi to run audio analysis on board to save the hassle of uploading audio clips to a server then processing them there. After looking around I found a neat little C library called aubio that says one of its main functions is pitch detection in audio clips. In order to test I hacked an openFrameworks app that lets me change the frequency on a tone generator:
Once this was up and running, I can play this tone on my laptop, put the mic from the Pi next to the laptop's speakers and record a 5-second sample, then run the pitch detection software on the resulting loop. After doing several different tests at different frequencies I'm pretty satisfied with the accuracy; here is the result of running the pitch detection on a .wav that was recording a tone at 1218 Hz:
Weight SensingThis still needs a bit of work: I've played around with a few different components and finally settled on a few that I think will work. I still need to get the output of this circuit back into the Pi and write software that will translate the A/D signal into pounds/kilos. I hope to have some time soon to get to that, but in the meantime here are a couple of shots:
So that's where we are at for now... hopefully I'll get some time soon to take this further!