How one man’s mission to protect his garden from squirrels saw him build a weatherproof Raspberry Pi camera

For garden lovers, squirrels are the enemy. There's nothing more frustrating than the rodents digging up your prized plants and vegetable patches.

Many people go to great lengths to keep the creatures out, trying methods like planting hot peppers, spraying vegetables with garlic or placing motion-sensor sprinklers.

But squirrels are smarter than people think, and will often find ways around any deterrents.

One man from Michigan in the U.S. decided enough was enough when his sweet peas and tomatoes were consistently meddled with, and turned to technology in his war against the rodents.

He programmed credit-card-sized computer Raspberry Pi with OpenCV, which developers often use for real-time computer vision, so that he is emailed the moment a squirrel intrudes on his garden.

The camera records images constantly and then passes it to Open CV for face recognition. Once it recognises something in the image, it sends an alert to the email address with the image in the attachment. The code can be modified to include any kind of object recognition.

When the man failed to find a weatherproof Raspberry Pi carry case on the market, he decided to build his own.

With no experience in designing plastic parts, he watched tutorials on YouTube and learned from various iterations.

‘It took one month for me to become familiar with the tools,’ wrote the man, who goes unnamed on his blog. ‘I broke down the design work [with] several intermediate goals, beginning with obtaining the dimensions of Pi A+, Pi Camera, WiFi adapter and micro USB power cord.

‘Vernier with LCD display manufactured by General Tools was very handy for this work. Ubiquitously available CAD models of Pi and Pi camera also helped to verify the clearances in the design by importing them and assembling with the designed case.'

His next step was to size and fit all the parts in the given space, choosing to mount the camera directly on the top case due to the flexibility of Raspberry Pi's data cable.

‘It was not difficult to split the case into two parts and then add the groove for holding the seal. Similarly, seal of the glass is held together by the seal holder attached to the case,’ he said. ‘It compresses the seal and holds it in place.

‘Designing screw bosses was a totally new area for me. I could not find any reliable information source and resorted to plastic part design guidelines from several plastic manufactures and handbooks.’

He tested the camera in the rain and it was a success. It even survived a thunderstorm without any water entering the case.

He shares all of the parts he used and the full method on his blog, so any squirrel haters can replicate his work. Here is the view from his camera.

Avatar photo

Ben Rossi

Ben was Vitesse Media's editorial director, leading content creation and editorial strategy across all Vitesse products, including its market-leading B2B and consumer magazines, websites, research and...