A couple of weeks back I was thinking about monitors and sensors and had a crazy idea: it ought to be possible to gather stats on how well my plonk is fermenting by attaching a mic to the airlock and counting the bubbles. So in a moment of enthusiasm I ordered a cheap lapel microphone from eBay and forgot all about it… until Saturday morning when it finally arrived in the post.
Time for some fun!
Yey! Just got my PCSensor TEMPer1 USB thermometer logging in Linux. It automatically detects and does expose USB HID profiles, but there’s no way to access the data by holding down the CAPS key like it says in the docs.
Thankfully, a search for the device ID (0c45:7401 Microdia) finds ruby bindings for Temper.c by Michitaka Ohno, which conveniently includes the reverse-engineered USB protocol. So I’ve forked this on GitHub, removed the Ruby bits, edited the unit test wrapped it up in a little script that logs the time and temperature to a CSV file. It currently only supports one device, which will change if I ever get another one of these devices (spoiler: I probably will)
Since I’ve not updated these two Android projects in a while, at risk of total future embarrassment (I’m still a Java newbie) I’ve decided to dump the source code on GitHub so others can make use of it. Details are on the Anonypic and Microphone project pages.
If you fix any bugs, please send a pull request and I’ll do my best to merge them in, but keep in mind this is also my first attempt at using git; expect schoolboy errors there too!
So, my 4th Android app is out, a simple mic which you can plug into your computer. It’s got quite a slating on the Android Market because of its latency, the problem is that there’s quite large minimum values on the buffer size for accessing input and output buffers, there’s no way to reduce this latency below the ~300ms which it currently has. Hopefully AOSP will address this eventually, paving way for realtime audio applications.