Hedgehog Hardware and Detection
By Mike Irving - Published: 23/3/2023

I am pleased that as of Early March, hedgehogs have returned from hibernation and are now once again visiting regularly.

The tech on my hedgehog system never stopped for winter though.

This blog goes through what has changed since my previous blog posts .NET, IoT and Hedgehogs! and Hedgehog System Evolution!


Toshiba FlashAir SD Cards

Whilst the initial system setup progressed with only the one camera offering a connectivity solution (the Ceyomur CY95), it was always my intention to bring the other cameras into the world of automation, somehow, one day.

The solution came when I started researching Wi-Fi enabled SD Cards, and more specifically the FlashAir range from Toshiba.

Toshiba FlashAir Cards are SD Cards with built in Wi-Fi, and a built in Web Server.

Toshiba FlashAir Cards

They can be configured in a variety of ways, by changing a settings file on the card.

The cards are 'full size' SD Cards, not Micro-SD Cards, but I can work with that by providing connectivity back to a Micro-SD slot via a ribbon cable adapter.

Camera with SD Card ribbon cable adapter

I acquired a number of these cards, and have configured these to offer a Private Wi-Fi Network, and always on connectivity, much like the Ceyomur CY95 setup.

Also like the Ceyomur CY95 camera, I discovered an alternative URL for the web server to serve a list of files. Not in XML format this time, but a Comma Separated List (CSV), providing filename, type (file or folder), date and time.

The Date and Time provided an unexpected programming challenge.

These were stored as 16-bit integers, apparently the way MS-DOS used to store them!

Here is my function for converting them into a .NET DateTime.

I adapted my CameraExperiments project to cope with the new type of 'Camera' (a FlashAir device), and perform all the same tasks (download, delete, date correction), and I updated the JSON Camera Definition to be able to specify the Remote Folder that the particular camera saves it files into, i.e. /DCIM/

The system will go through an additional level of subfolders in it's processing, and will delete emptied out subfolders as it goes.


Improved outdoor setup

The garden setup has come on a lot since monitoring first started.

The Xega RBX-S50 camera is now in place, replacing the Arlo HD camera, and is the first camera to be providing Colour Night Vision!

I now have SONOFF Smart USB Timers in use, that can turn on / off parts of the system at set times.

Much of the system is now running off a central battery too, charged via a small solar panel.

Security Camera and Solar Panel (inset)


Motion detection

One of the cameras in use, the Xbro XC100, produces near constant footage when in use.

A lot of this footage is uninteresting, literally nothing happens in it - no visitors.

There are a lot of files produced daily by this camera, that would not make good candidates for image recognition, at least not until the bulk (noise) has been removed.

I am now addressing this problem using Motion Detection.

This takes place in the Lambda function that does the Video Thumbnail Creation.

For this particular camera, I produce a thumbnail image of both the first and the last frame.

I then use the SixLabors.ImageSharp cross-platform .NET image manipulation library to add Gaussian Blur to these images, and to reduce the in size to a 16x16 square.

The resultant squares, from their original images, look like this.

Start and End Frames - Blur and Resize

Upon completion, I compare them using the ImageSharpCompare NuGet package.

The package reports a % difference between the two images.

If under a certain percentage, I discard the footage.

If above a certain percentage, I approve the footage.

This system has been in place a while now, auto discarding or approving footage from the Xbro camera, which is inside the hedgehog house

This is on the logic "if it's seen something in the hedgehog house, it is of interest".


Image recognition

For the outdoor cameras, namely the Ceyomur CY-95 and Xega RBX-S50, I am now using Image recognition to try and identify hedgehogs!

To do this, I am making use of the Amazon Rekognition service.

This works best for short video clips (or images), and produces a list of matched objects, along with a % likelihood of them having been seen.

I provide a list of objects / 'things' too look for, and a minimum percentage I am happy with.

Processing runs in yet another Lambda Function, directly accessing video clips on AWS S3.

I auto approve footage that matches 'hedgehog phrases' (hedgehog, procupine, armadillo).

If still unapproved, but matching 'Cat', I discard the footage.

Anything else goes for manual processing, including matched for 'rodent phrases'.

You can run a free demo, with images, to see what matches are produced, over at

Amazon Rekognition demo


What's Next?

This entire project has been very fluid and fast changing. I expect this to continue.

For the future, I expect we'll see more cameras, perhaps with different viewpoints. Perhaps another hedgehog house elsewhere in the garden.

The Raspberry Pi is still sat next to my PC too, so I may move that either outdoors or to a dedicated position in range of Wi-Fi networks, to also be operated on a timer.

For daily footage, visit the Macclesfield Hedgehogs website.

I hope you have enjoyed reading this blog series.


Tech Talks

I have also been out and about presenting the story as a technical talk. 

Presentation slides, links, and any future dates, can be found over on GitHub.

.NET, IoT and Hedgehogs! on GitHub

View Blog Entries...
Page: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11