Wolf detector prototype

Hi all,

I've put together a first prototype for our wolf boxes - see the photo below.  The main components are:

  1. Raspberry Pi.  With a couple of status LEDs added for data write and GPS fix.
  2. Solar panel, charger with LiPo battery, power conditioner - all OTS Adafruit parts.
  3. USB cellular modem (pay-as-you-go for the moment).
  4. OTS Adafruit GPS module.  Note that the timing is via the PPS signal - more on that later.
  5. OTS Behringer USB audio interface.  This is easier for a prototype than a dedicated ADC, but there may be sensitivity and/or latency issues.
  6. Software written in C++ using PortAudio for the audio interface, GPSD for the GPS, and wiringPi for the hardware lines (LEDs and PPS signal).

The whole thing works, broadly speaking.  The main issues are:

  1. Is the USB audio interface sufficient?  There are a number of problems with PortAudio, particularly with the callback interval at low sampling rates.  If anyone has experience of that library it would be useful to discuss further.  However, we'll probably have to run it at a high sample rate and downsample offline because:
  2. Time synchronisation is probably only reliable using the PPS (pulse per second) GPS signal.  On receiving a callback for the PPS, we raise a flag and then mark the PPS signal when next entering the audio callback.  As callbacks are probably ISRs, the best we can do is mark the first byte in an audio buffer as corresponding to the PPS, so our synchronisation precision is only (buffer size)/(sampling rate).  That means that if we use a tiny audio buffer (32 samples) and sample fast (44000 Hz), we can synchronise to 0.7 ms. Good enough, as long as the processor can handle such rapid task switching (we're writing data in a separate thread as well).

Any thoughts and suggestions are welcome!  I'm off to North Carolina next week to check out the field site where we're hoping to track red wolves in the wild.