-
Raspberry Pi Power system in separate project
12/17/2022 at 22:09 • 0 commentsI documented the Raspberry Pi power system in a separate project because it is useful in its own right. It provides push button startup, push button shutdown with essentially no battery current draw (1 microamp), ability to monitor voltage, current and power from the command line, and automatic shutdown when the battery voltage drops too low. Here is the project: battery-power-system-for-raspberry-pi
pi@pi3:~ $ battery battery voltage = 12.451 volts. Run time = 0.3071861111111111 hours battery current = 332.275 mA. Capacity used = 98.555 mAh CPU temp = 49.93 deg C.
-
SaSS Microphone Build Details
12/15/2022 at 11:45 • 0 commentsI posted the build details for the SaSS style stereo microphone that is used with this project in a separate project. 'SaSS-Style Stereo Microphone for Nature Recording' I'll be breaking down this high level project into multiples and posting details. These can be used stand alone for other purposes. This high level project will remain to capture the overall system.
-
Second System
03/03/2022 at 02:29 • 0 commentsVersion 2 system is complete. It includes battery voltage and current monitoring with automatic shutdown when battery is low. Also includes a real-time clock and proper pc boards for everything.
-
The last TLV320ADC6140 ADC available on Octopart :(
02/10/2022 at 03:03 • 0 commentsI managed to order the very last TLV320ADC6140 ADC available on Octopart last August. Mouser had the last one. This part is on back order til 2023. I’m gearing up to make another ADC board for a second recording system.
-
Handling Cold Temperatures
01/16/2022 at 14:49 • 0 commentsWe had a cold spell so I took the opportunity to add temp sensors to the microphone enclosure to measure how the inside temp varied. The enclosure is foam insulation so I was curious as to how the 0.84W (12v x 0.070A) power usage of the system, which all turns into heat in the end, would keep the inside of the enclosure warm. For Li-ion cells, the lowest temp is -20C (-4F). I wanted to calculate the R-value of the enclosure, which is roughly related to the temp difference between the inside and the outside and takes into account the watts of energy introduced in the enclosure.
Time Series of Temperatures (deg F) and R-value (USA units)
The horizontal axis shows the day and time, with grid lines at 12 hour increments. The details for the traces are:
t_cpu - Temp as reported by the cpu die in deg F
t_in - Temp inside the enclosure in deg F
t_out - Temp outside the enclosure, but inside the wind screen deg F
Temperature - Historical temp from a weather service deg F
d3 - difference between t_in and Temperature deg F
Wind Chill - feells like temp for human exposure deg F
The system started at indoor temperatures and cooled off as the outdoor temperature also decreased.
In perfectly controlled conditions for this type of test, d3 would remain constant. But this test was done outside, so d3 is varying ,probably due to sunlight hitting the enclosure and also wind speed changes over the day. The test was done on the north side of a building so direct sun was blocked, but the air may have heated from a nearby building. Can see a daily bump around noon. Wind speeds varied from calm to peaks of 15 mph. Cloud cover varied from clear to overcast.
d3 statistics- Difference between outdoor temperature and internal enclosure temp
mean 14.649698 std 1.821744 min 9.625000 25% 13.568750 50% 14.787500 75% 15.706250 max 19.025000
The R value (USA units) is calculated as:
{𝑅=3.15459074295484(−𝑇1+𝑇2)𝑤}
So for fixed watts, its related to the temp difference d3 in the chart.
R-value (USA units) Statistics
mean 55.016429 std 6.841497 min 36.146352 25% 50.956968 50% 55.533941 75% 58.984275 max 71.447725
Bottom line based on this experiment:
For this enclosure design, a 'safe' outside temperature limit is about 10 deg F lower than the minimum internal enclosure temp desired. Safe here is 3-sigma from the mean. So a Li-ion battery with a -4F lower temp limit can be used at -14 deg F.
Unfortunately for my area the lower limit is around -20 deg F, so some sort of additional insulation, heating, or alternative battery is required for full unattended usage during winter. One option is to use battery power to heat the enclosure for the cold periods. Since we seek a 16 degree margin between inside and outside temp, a factor of 1.6, we need 1.6 factor in the watts of heat input to the enclosure, or 1.34 watts, instead of the 0.84 watts currently. We could use a 'dumb' resistor, or we could use a CPU to do something better with the energy.
(No Li-ion batteries were harmed in this experiment - it was done with mains power)
-
New Web App with Predictions
01/15/2022 at 17:49 • 0 commentsIn order to easily use some of the AI predictions on the recordings I put together a small web app that lets a user search for a particular animal and then hear the recorded sound detected by the AI algorithm. It also shows the spectrogram of the sample, along with any other animal calls detected in the sound clip. Samples come from 15 days of recordings made in 2021.
-
Example Recordings
10/10/2021 at 13:41 • 0 commentsHere are two example recordings. The first one is a complete recording done over 20 hours, with an audio file for each hour. The files are recorded using the opus compression standard with a high quality setting. The recording was done in April 2021 during the pandemic shutdown, 5 miles away from major highways in northern Wisconsin near a small field. There are some human sounds, but the majority are natural. The ADC gain is 50dB 30dB analog and 20dB digital. At some point I want to calibrate the full audio path (mic - ADC Gain - sample value) to be able to provide the rough absolute sound pressure in the signal.
Early Spring in a Small Field 2021-04-09
The second recording was 14 hours recorded using flac (lossless) near a bog overnight in northern Wisconsin on June 13, 2021. I made 2 files available because they are large (600MB per hour). The ADC gain is 57db, 30dB analog and 27dB digital. I ran these through my ML model and identified the timings of the detected bird calls with highest predicted probabilities in the recordings:
File: Marsh 2021-06-13 4:04:55am central time
Eastern Wood Pewee (t=1771.57)
White-breasted Wood-Wren (t=1632.63)
Veery (t=2182.36), and a Common Loon (t=276.05)
I hear some bullfrogs too, but the AI model only handles birds.
File: March 2021-06-13 5:04:55 AM central time
Eastern Wood Pewee (t=306.57)
Black Capped Chickadee (t=3407.63)
Veery (t=964.47)
Great Crested Flycatcher (t=575.00)
Blue Jay (t=1389.47)
Common Loon (t=3544.73)
and possibly a Scarlet Tanager (t=419.21)
I hear Trumpeter Swans too, but they are faint.
-
Recording Setup
10/09/2021 at 19:49 • 0 commentsHere is a typical setup for recording. The microphone housing with the ADC and raspberry Pi is on a tripod inside a non-woven bag to reduce wind noise. I use my phone's hot spot to create a wireless network for the Raspberry Pi and my tablet. I can then SSH into the Raspberry pi, edit the config script and launch the recording. I then disconnect and shut down the hot spot. I found that at high gain levels and during silent parts of the recordings I could hear a rumble or 'burp' sound every 5 seconds. This turned out to be interference caused by the Raspberry Pi WIFI transmitter searching for a network. I wrapped copper foil around the microphones and improved the microphone cable layout but it did not help. I also tried reducing the transmit power, but this does not seem to affect the actual power transmitted in the Raspberry pi. So the current code has the option to automatically shut down the wifi 2 minutes after recording starts to avoid the issue.
I got power usage down to about 60-70mA at 12 volts using a more efficient buck converter, so am able to easily run 48 hours on a 5000mAh 3 cell lithium ion battery. When the PI is shut down, it uses 20mA at 12 volts.
I've recorded about 30 days worth of recordings so far with this setup. The most interesting are recordings from before sunset to after sunrise for nature recordings.
-
Published code for Raspberry Pi
07/31/2021 at 13:19 • 0 commentsI put the working Raspberry Pi code out on github. It is capable of running on a Pi Zero W writing to either a USB stick or a large microsd (64GB) using about 240mA. My power source is ~12v with a stepdown regulator. This draws <100mA at 12 volts.
Recording is controlled by editing a configuration script. The script allows control over the recording format (ogg, flac, opus). I recommend either opus for lossy compression (~100MB/hr) or flac (~600MB/hr) for lossless. The script controls the file chunking, I have used 1 hr files. So far I have run for multiple days, generating up to 120 files on an hourly basis. Script also controls the gain settings of the ADC, currently analog and digital gain settings. Metadata collection settings are also set here.
Following metadata is stored in each audio file (most visible in Rythmbox or other music players)
Date, Title, Artist, Album, Genre, Location, Comment (used for recording gain), tracknumber, tracktotal
A couple odd issues:
- I've needed to run arecord -L before my script, otherwise the ADC is not recognized by ALSA and the script fails.
- There is an automatic shutdown flag in the config file. When using this, I have noticed a bug where shutdown occurs prematurely at random. If I do not have auto shutdown, recordings work the full length every time. The code for shutdown seems straightforward, so not sure why this happens at random.
-
ADC board
05/08/2021 at 01:55 • 0 commentsADC board with 40 pin connector for raspberry pi
Inside of the stereo microphone
Front of microphone