Making an Internet-Connected Mouse Trap
If you live in a 100-year old house as I do, chances are big you have some mice walking around in the walls. To beat them once and for all, I am going to make an internet-connected mouse trap.
For 100 years, the mice have reigned in this house, but now itās time for revenge.
The traditional mouse trap works like this: You arm the trap, put some cheese on it, and wait. When the mouse comes for the cheese, the trap snaps a metal thing right over the mouse, leading to instant death.
The traditional mouse trap is boring. It doesnāt even have software updates.
Letās build a new version suitable for the 21st century.
Internet-connected mouse trap
The mouse trap will be connected to a small computer, and will send a notification to your phone when the trap catches something.
To make the mouse trap smart, we connect it to an ESP32 microcontroller. This is a small and affordable internet-connected computer. It reads real-time sensor data and can send messages on the internet.
Transforming the mouse trap into a sensor
We need to be able to read the state of the mouse trap. Either itās on and armed, or it has snapped with a mouse inside. To make this possible, we turn the mouse trap into a button.
We add some wires to two springs:
And attach them to the trap:
In the background, you can see that the LED lights up when the metal from the mouse trap touches the springs. Hurray!
Setting up the mouse trap to send notifications
I will leave out the technical details and source code, but if you are interested contact me and I will show it.
There are multiple ways to send notifications to a phone. One of the quickest is to use an existing app. We choose to send messages through the messaging app Telegram.
When running the code, we see it instantly on our iPhone:
Bringing it all together
To make this invention last as long as its predecessor, weāll attach it to a big block of wood.
Here are all the parts:
Using hot glue and screws we take it all together, and add a logo. Doesnāt it look beautiful?
The mouse trap in action
Time to test our creation. Didnāt find any mouse, so Iām using a banana instead.
It takes around 10 seconds before the notification shows up on the phone.
And a gif version of the action.
This invention shows that itās possible to hack together impressing things in a short time. The world of IoT devices like the ESP32 and services like Telegram make this possible.
It might not be the most useful thing in the world, but itās fun!
Do you have a dumb thing in your house you would like to make smart?