Bat detector

The workaround could be compiling the code to enable a long autorecord time. Set up autorecord with an extremely low record threshold (Signal strength above 25) so it will be activated all the time.
Activating autorecord will make a bunch of continuous recordings with a maximum time as set.

In bat menu you could set

if (set_menu_id==SET_MENU_AREC_DURATION)
{
AREC_D=cyclic_constrain(AREC_D,change,1,240); //5-1200sec


That would give 20 minute recordings.
A 384kHz recording would be just under 1GB I guess.
Larger than 255 would probably give problems, 240 is 1/3 of an hour, a nice number to use.

I do not like these large files but if you want to record a full evening even if there is only silence I guess this gets you a set of files you can handle and do not run into a file size limit.
 
There is no error message in Audactiy. It could be because of the formatting of the SD card. Formatted the SD with the standard allocation unit under Windows. I reformatted it with a 32kb cluster size. So far, the error has not occurred, even with 90 minutes of recording time for testing.
 
There is no error message in Audactiy. It could be because of the formatting of the SD card. Formatted the SD with the standard allocation unit under Windows. I reformatted it with a 32kb cluster size. So far, the error has not occurred, even with 90 minutes of recording time for testing.

Nice to hear that ! Good info for people that still have to format the SDcards.
 
Hi,

I have a suggestion for coming updates of the software. I would like to have the possibility to choose and indicate a frequency in the waterfall screen.

I think it can be helpful for identification of certain bats.
Teenst suggestion.png
/Anders
 
Hi

Thanks for the suggestion but I wonder how that would help identification. But maybe you do have a clear idea for this. Showing a "line" in the graph for a given frequency is in my view not very necessary as we do have a scale on the top of the graph.

kind regards
Cor
 
Hi,

I believe the line could help for a quick reference of the different Pipistrelle, Eptesicus and Vespertilio spieces. For me (living in the middle of Sweden) it could help to pinpoint possible rare parti coloured bats among the abundant northern bats (anything below 27kHz is interesting).

Since the scale is on the top of the screen and the sound is first shown in the bottom it is quite long way to aim and "guesstimate" the frequency of the call when it appears.

I have been thinking to put a taped line on the screen but if I change the screen sampling frequency the line will be in the wrong spot.

So if it can be one option in the software I think it might be helpful.

Best regards
Anders
 
I am not convinced this is going to help much. What I will consider is having a scale at the bottom of the graph to mimick the scale above.
But this does probably not look very tidy. For what I know of bats most species are not that simple to discern by a simple frequency-scale. We have the rythm of the calls (interpulse time), the sweep of the call (hi-lo), maximum peak etc etc. That all are necessary to "guesstimate" different species.

BTW: your screen seems to suggest that you are using an older version with numbered calls instead of the YYYYMMDDTHHMMSS.wav that we have recently added to the software. Which version are you using ?

regards
Cor
 
20210628T194526.JPG
This shows a possible way to allow a scale at the bottom, Ive added this to the current development-code we are working on.
If this stays you can simply set the "bottom-scale" variable with a size, in the example the size is 2. That gives a 2 pixels
high scale. The waterfall will not scroll in that zone so the scale is permanent and will follow the upper-scale.

cheers
Cor
 

Attachments

  • 20210628T194526.BMP
    225.1 KB · Views: 73
Hi All
I just wanted to say thanks for a great detector. I've got some great recordings of most of the bat species in my area.
I'm new to using Teensy, but I was wondering about the practicallities of introducing a sleep mode so that the detector could be left out for longer periods, only waking to record during specified times. I get 2 nights on internal battery now without having implemented the screen-off mods, which I will do at some point. Alternatively, rather than a full sleep, perhaps it would be possible to just not process sound between specified times whilst in auto record mode (presumably this would save battery?)

Thanks

Duncan
 
Hi All
I just wanted to say thanks for a great detector. I've got some great recordings of most of the bat species in my area.
I'm new to using Teensy, but I was wondering about the practicallities of introducing a sleep mode so that the detector could be left out for longer periods, only waking to record during specified times. I get 2 nights on internal battery now without having implemented the screen-off mods, which I will do at some point. Alternatively, rather than a full sleep, perhaps it would be possible to just not process sound between specified times whilst in auto record mode (presumably this would save battery?)

Thanks

Duncan

Hi Duncan,

This is one of the things we want to see how it can be done in a stable manner. There is a good sleep/snooze library for teensy but it will need proper testing. The screen-off modification will be helpfull as the TFT does use quite a bit of current. We could allow a user-set slot "time" that will make the system shut down as much as possible and only wake up to "kick" a watchdog function. The latter is often a wise way to make sure a device doesnt fall into an "eternal" sleep.

On your remark to try "not processing" sounds in auto_record, the whole concept of auto_record is that we only try to record to the SD when a sound is present in the "ultrasonic" part of the spectrum. We cannot "guess" that without the data this will need continous processing.

But keep feeding us with ideas/remarks on the usage of the system. I cannot yet show our recent "adventures" in the development but things are moving nicely forward and many of the things we hoped for seem possible in the next iteration of the TeensyBat.

cheers
Cor
 
Last edited:
Hi Duncan,

This is one of the things we want to see how it can be done in a stable manner. There is a good sleep/snooze library for teensy but it will need proper testing. The screen-off modification will be helpfull as the TFT does use quite a bit of current. We could allow a user-set slot "time" that will make the system shut down as much as possible and only wake up to "kick" a watchdog function. The latter is often a wise way to make sure a device doesnt fall into an "eternal" sleep.

On your remark to try "not processing" sounds in auto_record, the whole concept of auto_record is that we only try to record to the SD when a sound is present in the "ultrasonic" part of the spectrum. We cannot "guess" that without the data this will need continous processing.

But keep feeding us with ideas/remarks on the usage of the system. I cannot yet show our recent "adventures" in the development but things are moving nicely forward and many of the things we hoped for seem possible in the next iteration of the TeensyBat.

cheers
Cor

Thanks for the reply.
When I said not processing sounds in auto_record I meant only outside of the times when bats will be active - eg. stop processing between 7am and 9pm (user configurable of course). This would essentially mean starting and stopping auto_record mode on a timer, although it wouldn't be needed if full sleep/snooze is implemented.
This Raspberry Pi detector https://github.com/cloudedbats/cloudedbats_wurb_2020 can use an attached GPS to schedule start and end times according to sunset/sunrise times, which is a very nice feature for saving power if required.
 
Hi,

We have a GPS in the system working fine and I am sure that with some advanced algorithm we could use the latest record position as a "guesstimate" for the sunset/sunrise. But I think that its something a user can set very easily as this probably will not be a device you will leave around for a few months (if a battery anyway would last that long).
But we indeed intend to add a complete sleep/snooze, no code has been tested on this yet. I have seen a few threads on this forum that point towards proper ways to implement this.

cheers
Cor
 
Working towards a new update, now also for Teensy 4.1

Hi,

After we released TeensyBat 1.2 in May 2021 we (Edwin, Adrian, Thierry and me) have started to work on the next version.
As some of us had allready a Teensy 4.1 at hand we also decided to see if the code could be converted. At that same moment Edwin created a first prototype PCB for a Teensy 4.1.
At the end of May the code was converted to also work on the T4.1, the compiler had no problem but without a PCB and an audioboard we did not know. Edwin was the first to get "noise" from the new T4.1 mounted on the new prototype PCB. And although not everything worked right from the start most of the code had to be changed not a great deal. Since that moment we have added/enhanced/tested many features of the TeensyBat setup.

Currently the PCBs for the T4.1 are not yet available from Edwin as he is still considering a few changes. We might share a "development" update (code and hexfiles) for the software on the T3.6 and that way also share the software that can be used on the T4.1 in the coming month or so. Announcements will be made on this forum and on Edwin's http://www.teensybat.com

The list below shows some of the important changes:

Existing features that have been improved:
- recording to SD:
During testing we found out that V1_2 of the code was not able to write to the SD and record audio properly. Small gaps (often <0.5ms) of the incoming signal could be lost. This has been repaired
- start of recording:
In V1_2 we started the recording "after" the pushbutton was released, now we start when the pushbutton is pressed down. This allows a faster response.
- during recording:
Both the Live TimeExpansion and other modes can stay active during recording, including the waterfall graphs. In the previous version we had to switch to Auto-Heterodyne during recording as the only "feedback".
- recording:
The release of TeensyDuino 1.54 made it possible to switch over to the new sdFat setup, both reading/writing are now done using sdFat.
- filtering
We have changed from 1 biquad hipass filterstage to 4, this allows a far steeper (db/octave) filter to be used to prevent lowerfrequency signals coming in.

New features (both T3.6 and T4.1)
Automatic Gain Control:
Sometimes the signals of nearby bats can saturate the amplifier of the audioboard. The new AGC is set up to react very fast to this and reduce the gain. As soon as the signal weakens the gain will restore to the original setting.

SDconfig:
Teensybat saves many of the settings available to users to the EEprom to allow startup with user-preferred settings. In the next version this will also be saved to an SDcard if present. The advantage of this is that settings can be copied between machines and also stored for later usage.

New features only for T4.1

The T4.1 allows us to mount up to 16Mb of PSRAM to be used for processing. And although this PSRAM is not as fast as the usual RAM it is fast enough for our purposes.

-PREBUFFER (PSRAM):

A prebuffer (ringbuffer) is created that will automatically keep incoming data in PSRAM memory. The user can decide how much PSRAM will be used when compiling. The current default is set to 10000 blocks of 128 samples. That translates for a recording samplerate of 281K to 4.5 seconds of audio that is always present. The moment you press RECORD these 4.5 seconds will be stored (or any longer/shorter timespan) so you will not miss a sudden sound when pressing the button.
This option is also available in AUTO_RECORD mode, you can then set this in steps of 0.5 seconds.

-RECORDBUFFER (PSRAM)
During recording we are trying to write to the SD infrequently as the SD can create digital noise inside the TeensyBat. The RECORDBUFFER is used for this purpose.

- FRAMEBUFFER (RAM)
The scrolling waterfall graph can be changed into a horizontal scrolling waterfall when using a framebuffer.

Most of the above changes have been tested for some time and seem to work fine, we are still planning to do some further development for instance to allow the detector
to stay out for a longer time and have it "sleep" during the day. As development takes time we cannot set out a clear release date.

If you have any ideas that seem to be missing in the above and you would like to have added ... please dont forget to send in a request.

kind regards

Cor
 
It seems to be great additions/improvements of the TeensyBat detector! I like especially the possibility to have the waterfall during recording.
When can we expect the Teensy 4.1 version?

Best regards
Anders
 
Hi,

The code we are about to release (I hope within 2 weeks) will be for both the T36 and T41. So its one codebase and you can compile that for both machines with specific options for either machine.
Currently we are testing all kinds of features still and we will release this as a "development-release". Thats to notify we have not tested everything in every possible setting yet and things might still work different on your machine. And for the T41 ... nobody except the people of our development-team have been able to test that at all.

cheers
Cor
 
Reporting success!

Hi All,

Just a short mail to say thank you for this very cool project and report that my TeensyBat seems to be working ok.
blueProto1small.jpg
Originally I planned to use the standard box, but designing and printing a custom box would look much better (than drilling holes with my sub-optimal mechanical skills).

Greetings,
Fred Jan
 
Hi

Looks nice !
If you can try to share your works (design etc) so that others that have 3d printers can copy your work.

cheers
Cor
 
SD card differences?

While testing the TeensyBat with the latest firmware 1.2, I found not all SD-cards are created equal; a new 64GByte SanDisk Ultra wouldn't show the directories (writing did work), and an older 8GByte Kingston (formatted to fat32) did show directories, but seemed 'noisier'. Setting Hipass=12 made the 8GB card as silent as the 64GB card.

Greetings,

Fred Jan
 
Hi,

SDcards come in different sizes but also in different speeds. I only use SDcards with at least SD-HC 1, they allow higher transfer rates than the older cards.

Cor
 
Hi,

SDcards come in different sizes but also in different speeds. I only use SDcards with at least SD-HC 1, they allow higher transfer rates than the older cards.

Cor

Yes that is useful extra information. The 8GB is a HC I, the 64 GB a XC I.

Greetings,

Fred Jan
 
Hi Cor,

Found a solution; the 64 GB card was formatted exfat. Reformatting it as fat32 made the directory, and its contents visible. This is what PLAY looked like with the 64 GB XC I card (Exfat):
20210831T165443.png 20210831T165452.png

Greetings,

Fred Jan
 
Lets hope the update (which is completely based on the recent SDfat libraries) will be "easier".
 
Back
Top