Introduction: ARUPi - a Low-Cost Automated Recording Unit for Soundscape Ecologists

Picture of ARUPi - a Low-Cost Automated Recording Unit for Soundscape Ecologists

This instructable was written by Anthony Turner. The project was developed with lots of help from the Shed in the School of Computing, University of Kent (Mr Daniel Knox was a great help!).

It will show you how to build an Automated Audio Recording Unit for less than £150. You can use this unit to conduct research in the field of Soundscape Ecology (which is why I built this). You could use it to monitor the birds in your garden or just to make nice recordings of the dawn chorus, without having to get up really early.

The ARUPi (Automated Recording Unit Pi) uses the Raspberry Pi computer and an Arduino-based power-control board called the Sleepy Pi. It is fully customisable and you will be able to add different environmental sensors to the units if you wish (not explained here). This instructable will give you a bare-bones unit. I will provide you with an Arch Linux operating system (OS) that is stripped down and has the recording program pre-installed on it.

You may need to do some (very simple) soldering so be prepared for this, but it is possible to build this unit without soldering if you do not own or cannot afford a soldering iron (ca. £10). I will split this instructable into several steps. The first ## steps will deal with getting the software onto your ARUPi and getting the computer side of things up and running (uploading software to Raspberry Pi and Sleepy Pi). Once you have done this, you will be able to go your own way and decide which microphones and casing you want to use. If you want to make what I have made, then continue with the instructable and it will show you how to build some cheap (but good) microphones and assemble some field-tested, fully waterproof, pretty robust ARUPi's (pictured).

Step 1: Step 1 Items Needed

Picture of Step 1 Items Needed

NB: for a more detailed list of parts, see note at end of Step 2

1. Raspberry Pi A+ (case optional) - get it from PiMoroni/Ebay/Amazon

2. Sleepy Pi - http://spellfoundry.com/products/sleepy-pi/

3. Sleepy Pi programmer - http://spellfoundry.com/products/sleepy-pi-program...

  • This programmer saves a lot of hassle. However, you can build your own for less money if you buy an FTDI 3.3V USB to TTL Arduino Programmer cable/board (http://spellfoundry.com/sleepy-pi/programming-sleepy-pi-standalone-board/). If you are new to programming I recommend buying the Sleepy Pi Programmer.

4. 16GB Kingston Data Traveler Micro (pictured). You need to format the USB drive to NTFS before plugging it into your Raspberry Pi (format USB using Windows Explore - see image). If you decide to use a different make/model/capacity USB storage device, you may need to change some information in the /etc/fstab system files on the ARUPi OS I supply you with. The OS I provide you with mounts the 16GB Kingston Micro DT to sda1 (the kingston Micro DT 64gb usb drive mounts to sda5 - you need to alter these in the fstab folder, but that is included in the instructions a bit later on). Whichever USB drive you go with, make sure you use the same one each time you change it in your completed ARUPi when out in the field - the ARUPi will not automatically recognise a new USB drive.

5. USB soundcard. I chose the Creative Soundblaster Play! because it records 16bit Stereo up to 48KHz. It is also compatible with the Raspberry Pi and doesn't need any extra drivers - plug and play. However, there are cheaper USB soundcards available so it might be worth investigating.

6. USB splitter. The one pictured works well and is available on Ebay from multiple sellers. It is slightly less bulky than others that are available (but it is still rather big - but it is more bendy so fits inside my waterproof enclosure well).

Step 2: Step 2 - Collect Software

1. Download and install Win32 Disk Imager® software from http://sourceforge.net/projects/win32diskimager/

2. Install Arduino IDE software onto your computer: https://www.arduino.cc/en/Main/Software

3. Collect the operating system and other relevant files from my GoogleDrive Account by following this link:

https://drive.google.com/folderview?id=0BxoTy4JIKn...

  • The link should take you to a googledrive shared folder I created.
  • It contains:
    • the Operating System you need (ARUPi_240415). This file is 7.32GB so may take a while to download. GoogleDrive will also state that it cannot scan the file to check it is safe as it is too large. Don't worry about that - the file is virus free (it is an image of an Arch-Linux Operating System).
    • The Folder labelled "Sleepy_Pi" contains "_15min_Pi" (a program that tells the Sleepy Pi to wake the Raspberry Pi every 15 minutes) and a folder called Libraries. You need to save these files into the "Arduino" folder that should be found in the My Documents folder on your computer (assuming you have installed Arduino IDE.
  • It also contains:
    • A more detailed Parts List (ARUPI_PARTS_INFO.xls) with some links to where you can buy some of the parts. The first column (Step) states whether you need that item for the software side of things or not.
    • PDF document that cover step 5. and Step 6 I suggest following the PDFs as they are colour-coded and easier to follow.
    • A folder named "Example_ARUPI_Recs", which contains a small handful of example recordings made with these units in UK coppiced woodland sites from summer 2015 (I have ca. 35gb to get through so these are plucked randomly from the mix). I tried to include examples that cover, rainy nights, colourful dawn chorus mornings, low-power related beeping sounds (advice and ideas welcome), airplanes and moments of quiet! I think the recording quality is pretty good for a mono microphone (my how-to-build this microphone is still pending but on its way in the next couple of weeks),

      and is more than adequate for my needs so far

      . I think you could spend a bit extra and get very high quality audio if you desire - something I might also look into when time permits.

Step 3: Step 3. Create Disk Image

Picture of Step 3. Create Disk Image

1. Write the OS disk image to your micro SD card using Win32 Disk Imager.

2. When selecting Arupi_240415, you need to change file type to *.* to make it visible (see top image)

3. Select the disk drive that corresponds to your micro SD card (bottom image)

  • I always make sure I only have my SD card plugged in to avoid accidentally formatting an external HDD or other USB device.

4. Now click the “Write” button

  • This will write the disk image to the device.

Step 4: Step 4. Upload Program to Sleepy Pi

Picture of Step 4. Upload Program to Sleepy Pi

The Sleepy Pi is one of the most
important pieces of kit for this unit. It turns the Raspberry Pi on and off to a schedule that you choose. Therefore, you need to tell the Sleepy Pi what you want it to tell the Raspberry Pi to do.

1. The Sleepy Pi has an onboard Arduino microcontroller, on which instructions can be installed. To do this you need to have installed the Arduino IDE software.

2. Download the entire Sleepy_Pi folder from the GoogleDrive link on the previous step. Place the “_15min_Pi” file and “libraries” folder in the “Arduino” folder created in your “My Documents” folder (i.e. C:\Users\Ant\Documents\Arduino)

3. Open the script “_15min_Pi.ino” in the Arduino IDE. This script is what you need to upload to the Sleepy Pi. It tells the Sleepy Pi to turn on your Raspberry Pi every 900 seconds (i.e. 15 minutes). You can change this schedule by modifying the following line (i.e. 1800 seconds would equal 30 minutes).

int SYSTEM_SLEEP_TIME_IN_SECONDS = 900;

NB: it is possible to create a schedule based on turning the ARUPi on at set times during the day if this is your aim. To find out, consult the information on the Spell Foundry website.

4. To verify that the script works click on the tick symbol just below the 'file' tab (see image for better instructions). If the script doesn't run properly, check that you have put all the libraries from my GoogleDrive into your Arduino folder (see above).

5. Connect your Sleepy Pi to your computer and upload the _15min_Pi.ino script. If you have bought the programming unit from the Spell Foundry then follow the instructions given (install correct drivers etc etc). If you have your own FTDI programmer then use this webpage for guidance http://spellfoundry.com/sleepy-pi/programming-sle...

In a nutshell:

- connect the programmer to the GPIO pins of your Sleepy Pi and connect USB to your computer NB: Make sure you connect pins correctly (see webpage given above)!

- Plug in the power supply to your Sleepy Pi (micro USB OR via barrel jack)

- Open “_15Min_Pi” (or your modified script) in Arduino IDE.

- Select Arduino Fio as your board (see image)

- Upload your script to the Sleepy Pi by pressing the “upload” arrow next to the tick.

- If it doesn’t work then check the COM Port is correct (see image). You might have to reinstall the drivers for your FTDI serial programmer.

Step 5: Step 5: Set Up Sleepy Pi Real Time Clock and Raspberry Pi A+

Picture of Step 5:  Set Up Sleepy Pi Real Time Clock and Raspberry Pi A+

- FORMAT Kingson DT Micro USB DRIVE TO NTFS FILE SYSTEM – THE ARUPI OS IS PROGRAMMED TO AUTOMATICALLY INSTALL THE NTFS USB DRIVE. IT WILL NOT WORK IF THE DRIVE IS USING ANOTHER FILE SYSTEM

To install the time on the Sleepy Pi and get it to talk with your Raspberry Pi you must follow these instructions for each unit you build.

- Insert a CR1632 battery into the Real Time Clock (RTC) slot on the Sleepy Pi (image a)

- Plug in the Sleepy Pi to the GPIO pins on the Raspberry Pi as shown in image b.

- Plug in your usb splitter and plug in the soundcard, your USB storage device and a keyboard (image c – step 1).

- If you have a network cable (ethernet), plug it into the Raspberry Pi ethernet port now. Don’t worry if you don’t have one, the instructions will explain all.

- Plug in a HDMI cable into the Raspberry Pi HDMI socket to connect to your monitor/TV .

- Now ensure the power bypass switch is set to override the Sleepy Pi program (image d)

- Plug the power supply into the micro USB power socket on the Sleepy Pi (image c – step 2).

- The Raspberry Pi should boot up (if it doesn’t boot up and go to the Username/Password command lines see notes at end of this document).

- Type in the username: root and the password: root.

o Now you are in!

Accessing the sleepy pi clock:

1. Type:

i2cdetect -y 1

The screen-grab image displayed above should come up after you press enter (<enter> from here)

If that doesn’t work try:

i2cdetect -y 0

(If that doesn’t work then shutdown Raspberry Pi (type: shutdown) and check you have properly installed the Sleepy Pi onto the Raspberry Pi unit)

If the RTC is detected but the entry at 0x68 is “UU” not “68” then you need to unload the drivers from that address. To do this type:

rmmod rtc-ds1374 <enter>

Now try the i2cdetect command again and you should get the same output as the image above.

The RTC will be detected with the address 0x68.

Note: Remember which i2cdetect command worked (i.e. –y 0 or –y 1) as you need to enter /i2c-0/ or /i2c-1/ depending on which one worked, in the line after next (highlighted).

2. Now type the following:

modprobe rtc-ds1374 /bin/bash -c "echo ds1374 0x68 > /sys/class/i2c-adapter/i2c-1/new_device" <enter>

If you get error messages check very carefully that you have entered exactly what is above.

3. Now check the time on the RTC by typing:

hwclock –r <enter>

It won’t be the correct date if you don’t have an Ethernet cable connected.

4. Upload the correct time to the Sleepy Pi RTC. If you have a network cable connected to your Raspberry Pi simply type:

hwclock –w <enter>

If you don’t have a network cable you have to set the time on your Raspberry Pi. To do this type the following:

date –s “dd MTH yyyy hh:mm:ss”

eg. date –s “15 MAR 2015 18:33:46”

Now type: hwclock –w <enter>

5. Now check the time on the RTC by typing

hwclock –r <enter>

If the time is incorrect. Try repeating the necessary steps carefully – it is easy to mis-type things.

Stay logged into the ARUPi and go to Step 6!

If the Raspberry Pi Didn’t boot up properly

The Raspberry Pi will not load up properly if the correct USB stick is not plugged in. This isn’t a problem but it does mean you need to alter the “fstab” file.

If you are using a different USB storage device to the one I have recommended it might affect the way the Raspberry Pi boots up. If it does, you will be taken to a command line that says type password or press D to continue as administrator (the password is “root”) – do as it asks. This is because this OS is set up to automatically mount the Kingston DT micro 16GB USB stick.

- Type blkid

- Something similar to this should appear

/dev/sda1: LABEL=”System Reserved” UUID=”36423FA6423F6A2F” TYPE=”ntfs”

/dev/sda2: UUID=”B6DA024DDA0209F7″ TYPE=”ntfs”

/dev/sda3: UUID=”ARUPi_3Kingston_DT″ TYPE=”ntfs”

/dev/sda4: UUID=”f2025d4a-ab25-41de-a530-285f5b979cd0″ TYPE=”ext4″

/dev/sdb: UUID=”6ABB-232A” TYPE=”vfat”

- Identify your USB drive from the list and make a note of the mount point i.e. if it was the highlighted line, make a note of “/dev/sda3”.

- Now type nano /etc/fstab

- Modify the line that contains /mnt/arupi so that the /dev/sda1 corresponds to the ID/mount point of your USB drive.

- Ctl X to exit and Y to save changes.

- Now type reboot and the Pi should restart and load up normally (assuming you have the soundcard plugged in).

- NOTE: you can go through the following steps without the soundcard plugged in or even the USB drive mounted properly, but it is better to make sure your Pi loads up properly with all the parts plugged in!

Step 6: Step 6 - Modifying the Recording Script and Activating the ARUPi

Picture of Step 6 - Modifying the Recording Script and Activating the ARUPi

Download "Step_6" pdf from GoogleDrive Folder if you want colour-coded instructions.

1. Now set your desired recording lengths by typing the following:

nano /root/recordTest.sh

The first few lines that are preceded with a # are some instructions/information about what is in this file – the # prevents the computer from running the information following it much like in R, if you are familiar with that language). Basically, the last two digits on the script (the line that isn’t preceded with a #) indicate recording length in seconds. The default setting is to record for 60 seconds. So if you want to make two minute recordings delete 60 and change it for 120 (for three minute recordings 180 etc).

2. Finally set the Raspberry Pi to start recording automatically when the Sleepy Pi wakes it up. Type the following:

export EDITOR=nano

crontab –e

The following lines will appear in the nano editor:

# @reboot /root/setClock.sh &

# @reboot python /root/recordPi.py &

These lines are essentially your recording program. At the moment, these lines are not active when the Raspberry Pi boots up. You need to delete the # in order to activate them.

@reboot /root/setClock.sh & sets the Raspberry Pi’s clock to be the same as the RTC on the Sleepy Pi.

@reboot python /root/recordPi.py & runs a program using python software that makes the Raspberry Pi record for 60seconds when it is booted up and then shuts the Raspberry Pi down.

NOTE: Do not delete the # from the first 6 lines on this page – these are just re-iterating the instructions you should follow. Once you have deleted the two # symbols required, your ARUPi is ready to go.

Now press x to exit nano. It will ask you if you would like to save the changes you made press:

y and for yes

n and if you want to start afresh (in case you accidentally deleted everything or made a mistake but can’t remember what it was).

NOTE: when your Raspberry Pi boots up from now on it will automatically run these two files. So if you wish to alter anything, you will need to reverse what you have just done by placing a # at the beginning of the two lines just mentioned. Save the crontab file and then type reboot at the command line. You need to do all of this before the pi shuts itself down again. Also, remember to re-activate the Pi when you intend to use it in the field. If you cannot type fast enough to do that, you can boot up you Pi without the USB stick plugged in. This will log you in as an administrator and you can modify the pi as you like, without having to rush!

3. Shutdown the Raspberry Pi by typing:

shutdown

There will be a delay of around one minute whilst the Raspberry Pi initiates the shutdown so just relax. Now you are ready to go and do some automated audio recording! Alternatively, you can type poweroff to shut it down more quickly.

4. Once the Raspberry Pi has shutdown, remove the power supply from the Sleepy Pi.

5. Readjust the power bypass switch to enable the Sleepy Pi to control the power to the Raspberry Pi (image e).

NOTE:

If you are making multiple units and you have changed anything in this step (i.e. altered the recording length or activated the ARUPi – i.e. deleted the 2 #s in crontab) then you might want to make a disk image of your current micro SD card. To do this, use Win32 Disk Imager to read the data from the card into a new image file (eg. MYARUPi_170915). You can then write the new image to your subsequent SD cards and they should all perform identically. You can set the time on all of your Sleepy Pi units using just one Raspberry Pi.

Step 7: Step 7 Progress Update

·Now when you plug a power supply into the Sleepy Pi, the timer on the Sleepy Pi will start counting down from 900seconds (or whatever length of time you stated in step 4).

· After 900seconds, the Sleepy Pi will turn on the Raspberry Pi and the Raspberry Pi will record audio (WAV) for 60seconds (or whatever you stated). NOTE. If you don’t have a microphone plugged into the Soundcard, the audio file will be 60seconds of no sound!

· The file will be saved on your USB stick and will be labelled “ddmmyyhhmmss.wav” eg. 050715190559.WAV.

· It is always worth running the unit from your chosen battery supply to a few hours/days to check the recordings are working OK. Sometimes if the power supply is too low, there can be interferences (beeps and clicks) in the recordings. This is also worth remembering when deploying your units for long periods – find out when the power from your chosen supply method drops to a level where it affects the audio. NOTE. The beeps and clicks mentioned don’t seem to appear on any spectrograms so they are not a major problem for most purposes, but they are an indication that your power supply has dropped or is too low!

· Now you can mount your recording unit in a waterproof casing.

Step 8: Choose Power, Microphone and Casing

Picture of Choose Power, Microphone and Casing

The instructions for how to do the following two tasks are a work in progress - I am quite busy with my PhD research at the moment and this side of developing the unit is relatively easy and it depends on how much money and time you want to spend on it. You can research your own microphones and cases if you please or keep an eye out for these instructions to be uploaded!

You now have an automated recording unit. However, you still need a power supply, microphone and waterproof enclosure. From here on you can use your creativity/research to put your stamp on the unit. But you do need the following three things!

1. Power Supply: - The Raspberry Pi requires at least 5V to function, but this unit requires more since it has several bits of kit attached to it. The Sleepy Pi can regulate a 5.5V to 17V power supply via the power jack to the Raspberry Pi. I used 8xAA (non-rechargeable-ca.2400mAh each) batteries (ca.12V total) to power my ARUPis. They could record one minute of audio, every 15 minutes for ca 7days. The barrel jack shown in the picture comes with the Sleepy Pi unit. - You will need: Battery holder (i.e. 8xAA) pp3 9v battery clip and lead In-line switch (optional - but makes life simpler in the field and reduces stress on plugs and sockets!)

2. Microphone - you need a microphone with a 3.5mm stereo jack plug. Plug this into your soundcard mic slot and you are almost there! If you wish to build your own microphone, I recommend the Primo EM172 (or Primo BT EM-172). Please see the Microphone building PDF in my GoogleDrive to learn more about building your own Primo EM172 microphone. It really is quite simple. If the pdf is not in there then please be patient. If you simply cannot wait, send me a request (it is a work in progress at the moment - 16/09/15).

3. Waterproof Enclosure - I recommend the one pictured, sold by Solent Plastics amongst other vendors on Ebay and Amazon. It is very robust and comes with modifiable foam inside and I can vouch for their performance in terms of ruggedness and waterproof-ness. I used a 25mm cable gland (IP68) from screwfix to mount my microphone (which is encased in 15mm aluminium tubing). This involved cutting a hole in the case and inserting the cable gland - I sealed the edges with Sugru adhesive. I also bought some 11mm blanking grommets to use as a plug when the microphone is not attached - keeping the RasPi and Sleepy Pi dry is rather important!. Obviously, if you decide to go with a different microphone, your method for attaching it may be different!

Comments

AkerKits (author)2016-08-17

Hi Anthony,

I'd like to chat with you about your project. Can we have a Skype sometime? I'm from the Open Source Beehives project, and we'd like to use these to record some field audio in beehives.

Thanks,

Aaron

ARUPi303 (author)AkerKits2016-08-17

Hello Aaron,

That sounds interesting! I would be happy to Skype yes. I currently work full time but can Skype on Saturday or one evening (except this evening). Where are you based? I am in the UK.

All the best,

Anthony

Tatte (author)2016-05-06

Thank you Anthony for your amazing project! I've been looking for devices to automatically record something I call a soundlapse (soundscape+timelapse), to make a collage loop where you can hear how the soundscape changes through the year in different environments. This project is going to cut my search for different solutions short and get me right into business!

You mention something about aiming for better sound quality in the beginning, what's your opinion of alternative choices of soundcards? I'll do it stereo, that's for sure, but otherwise I need to try to keep the costs down!

A

ARUPi303 (author)Tatte2016-05-08

Hi Tatte,

Great to hear this project may be of use to you! If you want to keep costs down then there are plenty of cheaper USB soundcards out there. I went with the Creative Soundblaster because it was the only one I could find that gave full specs (so I could be sure of sampling rate (I think it goes up to 48KHz). But that doesn't necessarily mean it was the best option (just the only onw I could be sure of). It was also compatible with the Raspberry Pi (plug and play) but so are the following soundcards I believe (according to reviews I have read on Amazon).

https://www.amazon.co.uk/Sweex-USB-Sound-Card-Adap...

https://www.amazon.co.uk/Daffodil-US01-Speaker-Mic...

If you want to keep the costs down - building your own microphone will help (unless you already have mics). I bought some mic capsules from frogloggers - 10capsules for around US$100 delivered (so 5 stereo mics or 10 mono):

http://www.frogloggers.com/bt-em172-additional-inf...

These also have a water repellent acoustically transparent film/cover (i.e. they are waterproof). You would need to do a bit of soldering and build a battery box to power the mics (I have a schematic somewhere at home - i am away at the moment but if you need it let me know and I will try and find it for you).

It would be great to see how you modify the ARUPI to fit your purposes (if you decide to build one).

Let me know if I can be of help in anyway - I think the instructions are pretty easy to follow and I have used my units in all sorts of weather so they are reliable. There are some example recordings on my googledrive (link in the project). They can sometimes get a feint beeping sound in them, but this isn't visible on spectrograms. I think it tends to occur when the power drops. There is an example recording of this in the googledrive folder as well.

Hope that helps,

All the best,

Anthony


MarkSindone (author)2015-12-22

This is definitely a fascinating idea which I have never come across before in this forum. It must be such an amazing job you currently hold dealing with Mother Nature and almost hearing her respond back to you through this recording unit. Thanks for also sharing with us the few sound clips you have obtained which are of a high quality indeed.

ARUPi303 (author)MarkSindone2016-02-23

Hello! Sorry I haven't replied - I only just noticed your comment. Thank you! Yes it is a very interesting job - I have been working as an ecologist for oer 10 years now. Recently I became very interested in the field of Soundscape Ecology. The reason for building the ARUPI was to reduce the costs of surveys for my research. I only shared a few soundclips of around 20gb from a study I did last summer - they worked really well in all sorts of weather in the UK. I am rather happy with the ARUPI, and it is easily modified to suit different recording requirements, so...yes - all good. Thanks again :-)

taifur (author)2015-09-16

A very cool idea

ARUPi303 (author)taifur2015-09-23

Thank you :)

BeachsideHank (author)2015-09-16

This sounds like a very interesting venture, are there any online links to sounds captured by this technique?

ARUPi303 (author)BeachsideHank2015-09-16

Hello, I hadn't thought to upload some sounds - bit of an obvious mistake, doh! I have now uploaded a handful of recordings to a folder in my GoogleDrive - accessible via link in Step 2 of instructions. I think the recording quality is pretty good - I have tried to include a few different ones including night-time recordings, dawn chorus ones, rainy ones and an example of a feint-beepy one, which I think is due to low-power supply (and also the beeping sounds are not visible on a spectrogram, so I don't think they will have too much of an effect on spectrum analysis - but this needs to be investigated!).

Thanks the heads up :)

BeachsideHank (author)ARUPi3032015-09-16

Fascinating concept, it opens a whole new world waiting to be discovered, thanks for sharing, I hope it goes viral.

seamster (author)2015-09-16

This is a really cool idea, and a well presented project. Nicely done!

ARUPi303 (author)seamster2015-09-16

Thank you! I am glad you like it - I think the instructions will need a good few amendments as people start building their own - time will tell. I am sure the unit/idea (ARUPi) could be greatly improved as well - which would be really good. This kind of equipment is very expensive to buy as an ecologist if you go for the ready-made stuff. I think it is good to have the option of having 5 units of (potentially) slightly lower quality versus one unit that costs the best part of your entire funding budget. It is also good having a unit comprised of interchangeable parts, with the option of adding other sensors and beyond. Thanks again for your comment :)