SqueakMail

by dakota-mewt in Circuits > Arduino

461 Views, 3 Favorites, 0 Comments

SqueakMail

SqueakMail.png
SqueakMail_demo.gif

Do you use humane (live) mouse traps? Do you hate checking them every day to make sure that a critter isn't dying of thirst/hunger?

For <$3 USD, you can build a SqueakMail to alert you when the trap has been triggered.

Supplies

  • an ESP32 or ESP8266 microcontroller ($2)
  • an Obstacle Avoidance Sensor (<$1)

Mouse Trap itself

  • Reusable humane / live mouse trap ($4)
    • There are many sellers for this same style of traps
    • SqueakMail's enclosure makes use of the holes on the top of the traps. Some variations don't include those holes. If you have them you can either drill holes or modify the 3D printed enclosure accordingly

Create a IFTTT (If This Then That) Email Trigger

ifttt.png
  • Go to Random Nerd Tutorials and set up IFTTT following their instructions here ESP32 HTTP POST with Arduino IDE (for SqueakMail, skip their ThingSpeak section and jump to the section "2. ESP32 HTTP POST (IFTTT.com)"

Upload the Attached Sketch to Your ESP32/ESP8266

esp32.jpg
  • Before you upload, edit the file to replace the ssid, password, serverName with your own WiFi SSID, WiFi password, and IFTTT API Key respectively
  • Edit timerDelay to set how often you will get emails once the mouse has been caught. The default 30000 = 30 seconds
  • Upload the file to your microcontroller

Downloads

Wire Your Obstacle Sensor

wiring.png

  • Wire your Sensor's VCC to your ESP's 5V or 3V3 (either one should work)
  • Wire your Sensor's GND to your ESP's GND
  • Wire your Sensor's OUT to your ESP's Pin12 (change this to another Pin as needed based on your ESP layout)

3D Print the Holder

3d enclosure.png
  • The ESP holder has 2 pegs that tab into the top holes nearest the door (the pegs don't take up all the space so oxygen should still flow. also 11 out of the 13 holes remain completely unobstructed)
  • The Sensor holder fits into the groove at the bottom of the ESP holder and should situate the IR sensors slightly past the door and high up enough that it should stay out of the way of the mouse
  • You may need to tune the sensor's sensitivity using a phillips head screwdriver so that it triggers/lights up when the door is closed, but not when the door is open
  1. Fit the ESP holder onto the trap
  2. Fit the Sensor into the Sensor holder
  3. Fit the Sensor holder into the ESP holder
  4. Fit the ESP into the ESP holder

Downloads

How Does the Code Work

codecode.jpg

Pseudocode logic:

  • Flashes the onboard LED 3 times upon startup so you can visually see it initiate
  • Connects to your WiFi using your credentials
  • Posts to IFTTT, you will get an email with "trap initiated"
  • Starts a timer for how long it's been since the trap has been set
  • When it detects that the sensor has been triggered (door blocks the sensor because it's been closed)
    • Starts a second timer for how long it's been since the mouse has been trapped
    • Post to IFTTT, you will get an email "Trap has been running for <Trap Timer>. Mouse has been trapped for <Mouse Timer>

Video Demonstration

SqueakMail.gif

Questions, Comments, Feedback?

discord.png

Join me on Discord: https://discord.gg/9AsQSmHgDM

Acknowledgments

A big thank you to: