Kestrel Box entry counter

8 posts / 0 new
Last post
Holly Thompson
Holly Thompson's picture
Kestrel Box entry counter

Does anyone have a device that counts the entries into a nest box?  I am looking for a simple device that registers when a critter enters or exits the box?  Thanks,

Holly

Holly Thompson
Holly Thompson's picture

I am looking at an Arduino project with a counter or date/time stamp based on some kind of trigger such as Infra-red beam interruption.  Or proximity sensor?  Or motion detector?

AKP-Matthew
AKP-Matthew's picture

Hi Holly -

We'll forward this question to our IT guru to see if he has any thoughts. We know folks have calculated the number of nest visits using motion-triggered nest cameras and reviewing the captured videos manually, but we're not aware of any automated solutions at present. Hopefully some other folks can chime in if they know something we don't.

One thing that comes to mind right away is that if you're trying to calculate the number of times the parents visit the nest, the method used would need to be able to exclude nestlings hopping up and looking out of the box entrance (which, of course, they do frequently close to fledging). So something as simple as an infrared beam across the box entrance might not be a feasible option. (Also, visits by other animals, such as predators or other species trying to usurp the box, would trip such a sensor.) So the method selected would likely depend on what you're trying to count and how precise you need that figure to be.

If our IT guru has any ideas we'll be sure to post them here. And please let us know if you hit on any solutions on your end—we're guessing a number of folks would be interested in such tech.

Matthew
AKP Staff

Holly Thompson
Holly Thompson's picture

Thanks Matthew!  I am still trying to reconcile what I would like to do vs. what I am willing to pay for, LOL. 

AKP-Matthew
AKP-Matthew's picture

Hi Holly -

Our IT guru passed along the following information:

There may be a pre-built device like that available somewhere. I have usually seen DIY builds for Arduino projects though, such as https://www.instructables.com/IR-laser-person-counter/ and https://learn.adafruit.com/ir-breakbeam-sensors/arduino

There are conversations about build projects for this sort of thing at https://forum.arduino.cc/c/using-arduino/sensors/26 

I could see potential complications in the accuracy of this sort of device.  Success would likely depend on what specific event is being counted and how the device could be installed to minimize false events.

Hope this helps! Again, keep us posted on this project, and let us know if you have any further questions.

Matthew
AKP Staff

grantiago
grantiago's picture

Hi Holly: 

 

What you are looking for is not difficult or expensive. But the two big questions: Is there power and WiFi at the Kestrel box? If not that can be overcome with time and money.  More on that later.  

 

I started an esp32 cam (an Arduino module) project to put a webcam in my Kestrel box. Before I finished the project, I had a pair of Kestrels move into the box. So the project is on hold. When complete, I will share it here. I'm hardly an expert on Arduino. No C++ background which Arduino language loosely resembles. I am solid with Python, PHP and JavaScript. Which is helpful in the sense that I am comfortable looking at code and mimicking the structure.

 

 

I made a quick search for an esp32 cam with a PIR sensor to detect motion and then to take photos and store them on the onboard microSd card.

  

 

That was easy enough. It took about 30 minutes following this tutorial: 

 

  https://randomnerdtutorials.com/esp32-cam-pir-motion-detector-photo-capt...  

 

For the motion detection I would mount the PIR on an extension say three inches of 1/2 inch pvc pipe. Put it above the cavity and pointed level and forward. You are going to get fly-byes that way, but no moving chicks or battles with predators. I'd mount the esp32 on the ceiling and take photos while you are at it. The Arduino language lets you stack and add blocks of code. You have your PIR, your camera, and your etc.    

 

Software needed:  

 

free: Arduino IDE -- for coding and uploading the the module. 

 

 Hardware your going to need: not free: 

  • FTDI Adapter -- connect the esp32 module to your pc. Buy one that connects with a usb cable, not that has a usb male prong (and looks fancier, but isn't). ~$6.49 all prices from a quick search on amazon.
  •  
  • (a couple) ESP32-CAM AI-Thinker with OV2640 Camera ~$18 for two
  •  
  • breadboard starter kit. easily connect peripherals and make your circuits. elegoo kit $17.99
  •  
  • PIR sensor detect motion. hiLetGo 3 for 8.69
  •  
  • micro sd card with minimum write speed >= 10mb/sec sandisk extreme $14.55

 

 

total +- $66  The original PIR photo sketch is going to have to be modified to log the data somewhere accessible.

 

I have a raspberry pi running an ubuntu LAMP stack (Linux, Apache, MySQL, PHP)So that would be my answer. Around $200 for a complete kit. canakit.com  Order now as there is a shortage. 

 

There are free options, like google sheets or [deta.space](https://deta.space/) Didn't know about deta but going to have a look now. 

 

See this tutorial: https://randomnerdtutorials.com/esp32-how-to-log-data/ 

 

Now if you don't have power or WiFi there are self powered esp32 boards that use solar and batteries and have a cellphone sim onboard. So you can text yourself anytime the PIR is triggered. It has an external WiFi antenna so I am hoping the range is probably > the troublesome WiFi my AI-Thinker board has. With the WiFi you could send an entry to your database on your raspberry pi.  

 

https://www.lilygo.cc/products/t-sim7000g?variant=42275516743861 

I'll be buying one of these soon! ~$40

  • You will need a small solar panel
  • 18650 batteries. 
  • if you need to go the cellular way a IoT sim -- consumption-based rate of $0.10/MB https://thingsmobile.com

 

As the project develops, I will document it here.  

https://github.com/grantiago/kestrel_box

 

As it is now. It's a mess. 

Image: 
grantiago
grantiago's picture

Here is a working example of the Kestrel box entry counter on an Arduino esp32cam. Total cost in materias about $ 73. If you have on-site power you can omit the solar panel and powerbank and the total cost of materials is around  ~$27. Any questions, I'll try to help. I'm a Hello World kind-of Arduino Programmer. I have a motion-activated esp32 cam working as well. The same concept, materials and price. When I get some time, I will combine them. 

https://github.com/grantiago/kestrel_box/tree/main/counter

AKP-Matthew
AKP-Matthew's picture

WOW. Thank you so much for sharing this info! If anyone tries this out on an occupied kestrel box and gets some in-the-field results, we'd love to hear how it goes.

Thank you!!

Matthew
AKP Staff

accipiter