discussion / Acoustics  / 30 April 2016

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.

Arik




Hi Arik,

Nice to see this progressing. I don't have any expertise on your sync issues but can help with other hardware.

The power supply needs to be scaled up significantly, but I acknowledge this is a prototype. Some numbers to consider in the power budget:

  • At idle the Pi2 will use about 230 mA and at full load with 4 cores about 420 mA. The Pi3 ranges from 240 mA to 720 mA.
  • some USB cellular modems can have current draw up to 700 mA in peak load, but typically around 250 mA. Best to test your device under peak upload/download conditions
  • USB audio interface should draw less than 500 mA but I dont have experience with these models and variation when in use.
  • GPS unit only 30 mA at 3.3V

This could add up to 2A @ 5V (10 W) at peak current draw which would drain your battery in an hour or two so power saving measures will be needed.

  • Power switching USB devices via GPIO - I havent seen anything off the shelf but relays are an option by re-wiring the positive/5V line. This also allows the use of a separate power unit to avoid over loading the Pi USB power which is a known issue. Power to the USB modem could be programmed to turn on when the batteries are at full charge or when solar power is available.
  • Disabling HDMI - modest savings ~20mA but still worthwhile.
  • Powering the Pi from 3.3 V - this works with the single core (models A, B, zero but I'm not sure about 2 or 3) and saves around 17%. Note, at lower voltages cables should be kept short to reduce resistance. Apparently many USB devices will also run from 3.3 V so this may be an option to only use a 3.3V power supply rather than 5V

If you can keep power consumption at 2 Watts you will still need a sizeable battery for 24 hr operation. With 3.7V Li-Ion/LiPo this may require over 8000 mAh to avoid full discharge. Should the battery need to power the unit for multiple days without solar in case of bad weather then this should be increased. Increasing the voltage of the pack (parallel) and number of cells (series) is fairly trivial these days. However, balanced charging, especially from solar, may prove a headache. I'm sure there is a product out there for this somewhere though.

Those are some thoughts on the power side. I'll make a quick comment on the audio in another comment.

Cheers,

Alistair

Great work! How much did this cost to put together? How is it detecting wolves? Or is it just streaming audio?

Hi Arik,

I've looked into audio interfaces for the Pi a little and it all seems to come down to trade-offs or building something from scratch.

I like the idea of using an OTS USB audio interface as you have done. I was looking at some of the options with mic pre-amps such as the similarly priced Behringer U-PHORIA UM2, Blue Icicle, up to the Sound Devices USBPre 2. This depends on whether you already have a microphone and amplifier as part of your system.

Another option is to look for an addon board like the Cirrus Logic (formerly Wolfson) Audio Card. This has mic and line input. I haven't seen the specs on power consuption but it should be low due to removing the USB interface. It also has programmable low power mode as far as I can remember. If you went down this path you may remove the need for mutliple USB interfaces and only require a Pi model A+ which would also reduce power consumption somewhat. 

Alistair

Hi Arik

Did you already test it with wolves?? I would be very interested in learning your results as I am preparing some accustic monitoring of wolves for my PhD.

keeping in touch

Nuno