Project in progress
Mouse-O-Leum (Multiple Live Catch) Mouse Trap

Mouse-O-Leum (Multiple Live Catch) Mouse Trap © CC BY-SA

Commercial traps are too small or not good enough so I designed my own electronic version. Mice *cannot* escape if they trigger the IR beam!

  • 5,093 views
  • 16 comments
  • 19 respects

Components and supplies

About this project

2019-02-08
Busy with the all new rewrite of the software. Will be using a Finite State Machine structure to accommodate the IoT functionality and better error handling.
After that, I will design a custom PCB with on-board Arduino and connection for the ESP-01 wifi module.

2019-01-19
Schematic online for the new MouseOleum v2.1 design, build on an Arduino shield with Wifi E-mail notification. sketch and PCB files will follow...

2019-01-18
Ditched the unreliable Chinese IR boards and now made an Arduino UNO shield with all the components on it. Will publish this soon

2019-01-13
- schematic online now
- WORKING ON A WIFI CONNECTED VERSION!

2019-01-06
The trap is in use continually and no mouse has escaped... Total caught mice count: 40

IMPORTANT NOTE:

The infrared modules used in the project are very cheap. They perform beautifully BUT ONLY FOR A LIMITED TIME... The problem is that the resistor value for the IR transmitter LED (the transparent one) is way too low. I had problems over time with the trap, behaving erraticly and I did not know what the problem was until I discovered that the transmitter LED was dying. So I replaced the 100ohms resistor with a 390 ohms resistor which is more than enough to cover the small distance needed for the IR beam.

UPDATE: this also did not work... So I made my own very simple IR solution with one LM358 chip.

Why design a mouse trap if you can buy dozens of different model traps?

We have chickens so mice are feasting on the feed and it is hard to avoid having mice rampaging the chicken coop at night.

We first decided we want to catch the mice alive so I first bought some good trip trap mouse traps and set them. Curious what was happening at night in the chicken coop I installed 2 camera's and a Network Video Recorder.

To my frustration the mice did not enter the traps I bought! They sniffed a bit night after night but entering them? No...

From that moment on it was a case of MANKIND against MICE!

I watched a lot of mouse trapping video's from

I TOOK OUT THE HEAVY GUNS and made a microcontroller powered trap. But this first version of the MouseOleum trap was not good enough because older mice were so incredible fast when the trap doos opened! They could turn and jump out in a matter of 0.1 (!) seconds. I first could not believe my eyes...

Look at some footage of the first build. The 3rd mouse did escape:

3 mice entering the trap, 1 managed to escape!!

Still I caught 12 mice with this trap but still, the score was: MANKIND: 0 - MICE: 1

The MouseOleum v2

Demonstration of the mouse trap:

The "making of video":

See the trap in action!

Compilation of multiple caught mice. NOTICE the LED 'mouse counter' on top of the trap

Lessons learned about mice

These are my observation, yours may vary...

When looking at the mouse trap reviews of Shawn Woods, you can see mice enter traps very easily! But when I bought 6 live catch mous traps, no mice would come in... That's why I build this trap.

I also read many tips and tricks but these thnigs I observed by looking at many video recordings I made:

  • mice are very, very cautious, especially the older ones.
  • it takes 2-5 days before the smell of peanut butter will convince mice to overcome their fears of the trap. TIP: put peanutbutter in the back of the trap, on the back wall, at the same height as the IR led's
  • make it easy for the mice to climb onto the trap.
  • you do not need to wear gloves when handling the trap.
  • dead mice smell in the trap will not scare new mice away
  • already trapped mice will not scare other mice away nore lure them to enter also

Design considerations

A trap door model seemed to me the most simple solution to catch multiple mice. When entering the trap they are 'lowered' into the lobby of the MouseOleum and the trap is ready for the next guest. To prevent escape when triggering the trap, a front door is lowered simultaneously with the trap door.

IT IS IMPORTANT to leave a 5mm gap when lowering the front trapdoor because else the tail of the mouse will get stuck and they will be hurt.

Ventilation holes provide enough fresh air. Some hay on the bottom provides a soft landing and a way for the mice to hide in. Pieces of apple and bread will keep them alive and well.

Many young mice died because of the exhaustion from trying to escape so take that into account.

How does the MouseOleum trap work?

Some peanut butter (NOT cheese...) will lure the mice. I used some wire mesh to make it easy to climb onto the trap. Mice have to get used to a trap so I put some peanut butter on the entrance area, midway and all the way in the back of the trap.

When a mouse enters the trap, it will trigger the first infrared beam. (They cannot see the IR light so they are not scared away.) When it moves (often reluctantly) further to the back, the mouse will at some point trigger the second infrared beam and immediately the front door is lowered and simultaneously the trapdoor is opened.

GOTCHA! We now have caught a very frustrated mouse...

NOTES:

WHY TWO IR BEAMS:

The first IR beam will trigger a 15 second timer. In this time the second IR beam has to be triggered to actually activate the trapdoors. I designed this on purpose because else a moth or other nasty bug can trigger the trap sometimes, activating it continuously!. I observed this on my first design.
As long as a mouse is present in the trap, the timer will reset itself so the 15 second limit is then never exceeded.

SPEED:

The FRONT DOOR is lowered in a 45 degree angle. This way the door closing time can be MUCH faster as when we would use a 90 degree mounted door.

Mice are so incredibly fast so I didn't want to give them a chance... In the first video you can see the third mouse escaping in a split second!

The TRAPDOOR opening time has to be as short as possible. 0.3 seconds open time is more than enough. Any longer and a mouse can maybe jump up.

The servo's

I used two servo's, the Towerpro SG92R. They are cheap, fast enough and small.

Notice on the photo the idle position (trapdoor closed) of the servo arm. In this position alone, the servo does only need very little effort to keep the bottom trapdoor in the closed position.

If you use any other position, the servo will make noise because the trapdoor is relatively heavy and the servo has to maintain its closed position. This humming noise will scare the mice away.

The test lever

I made this to test the IR led's. The front trap door is lowered so sticking your hand in the trap will maybe damage the servo's.

To prevent mice moving the lever at the inside of the trap, I made a pocket in the acryllic. By adding a spring between the knob and the sidepanel, I can now push the lever out and move it.

The IR beam LED's

Use some brass pipe to keep the IR beam focussed and this also will help to keep other light away from the IR receiver. Of course if you use a wooden trap this is not necessary.

Read the notice about the LED's at the top of the story!

Code

MouseOLeum sketch v1.0Arduino
This is the sketch for the MouseOleum WITHOUT shield and Wifi notification
//    __  __                              ____         _
//   |  \/  |                            / __ \       | |
//   | \  / | ___  _   _ ___  ___ ______| |  | |______| |     ___ _   _ _ __ ___
//   | |\/| |/ _ \| | | / __|/ _ \______| |  | |______| |    / _ \ | | | '_ ` _ \     
//   | |  | | (_) | |_| \__ \  __/      | |__| |      | |___|  __/ |_| | | | | | |
//   |_|  |_|\___/ \__,_|___/\___|       \____/       |______\___|\__,_|_| |_| |_|
//                    _ _   _       _        _ _                       _       _
//                   | | | (_)     | |      | (_)                     | |     | |
//    _ __ ___  _   _| | |_ _ _ __ | | ___  | |___   _____    ___ __ _| |_ ___| |__
//   | '_ ` _ \| | | | | __| | '_ \| |/ _ \ | | \ \ / / _ \  / __/ _` | __/ __| '_ \  
//   | | | | | | |_| | | |_| | |_) | |  __/ | | |\ V /  __/ | (_| (_| | || (__| | | |
//   |_| |_| |_|\__,_|_|\__|_| .__/|_|\___| |_|_| \_/ \___|  \___\__,_|\__\___|_| |_|
//                           | |      | |
//    _ __ ___   ___  _   _ _|_| ___  | |_ _ __ __ _ _ __
//   | '_ ` _ \ / _ \| | | / __|/ _ \ | __| '__/ _` | '_ \                            
//   | | | | | | (_) | |_| \__ \  __/ | |_| | | (_| | |_) |
//   |_| |_| |_|\___/ \__,_|___/\___|  \__|_|  \__,_| .__/
//                                                  | |
//                                                  |_|

// free to copy! by Erik de Ruiter
// 2018-10-02 - Version 1.0

//  ########  ######## ######## #### ##    ## ########
//  ##     ## ##       ##        ##  ###   ## ##
//  ##     ## ##       ##        ##  ####  ## ##
//  ##     ## ######   ######    ##  ## ## ## ######
//  ##     ## ##       ##        ##  ##  #### ##
//  ##     ## ##       ##        ##  ##   ### ##
//  ########  ######## ##       #### ##    ## ########

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
// http://arduiniana.org/libraries/pwmservo/
//
//   Board                     SERVO_PIN_A   SERVO_PIN_B   SERVO_PIN_C
//   -----                     -----------   -----------   -----------
//   Arduino Uno, Duemilanove       9            10          (none)
//   Arduino Mega                  11            12            13
//   Sanguino                      13            12          (none)
//   Teensy 1.0                    17            18            15
//   Teensy 2.0                    14            15             4
//   Teensy++ 1.0 or 2.0           25            26            27
//   Teensy LC & 3.x                 (all PWM pins are usable)

#include <PWMServo.h>

PWMServo trapdoorservo;  // create servo object to control a servo
PWMServo frontdoorservo; // create servo object to control a servo

// define variables
bool manualOpenTrapdoor = false;
bool manualCloseFrontdoor = false;
bool mousePresent = false;
bool mouseEating = false;
int mousecounter = 0;
int blinkcounter = 0;
unsigned long timer1 = 0;

// stuff for the mouse count LED function
static int count = 0;
static unsigned long lastBlink = 0;
int blinktimes = 0;
#define LED_BLINK_INTERVAL 4000L
#define LED_BLINK_RATE 200
#define MOUSEPRESENT_DELAY 10000L


#define RELAY 3
#define IR_MOUSE_EATING 5
#define IR_MOUSE_PRESENT 4
#define LED A0
#define MANUAL_LOWER_TRAPDOOR A1
#define MANUAL_LOWER_FRONTDOOR A2

//   ######  ######## ######## ##     ## ########
//  ##    ## ##          ##    ##     ## ##     ##
//  ##       ##          ##    ##     ## ##     ##
//   ######  ######      ##    ##     ## ########
//        ## ##          ##    ##     ## ##
//  ##    ## ##          ##    ##     ## ##
//   ######  ########    ##     #######  ##
void setup()
{
    trapdoorservo.attach(SERVO_PIN_A, 400, 2300);  // attaches the servo on pin 9 to the servo object
    frontdoorservo.attach(SERVO_PIN_B, 400, 2300); // attaches the servo on pin 10 to the servo object
    // intitialize servo's
    servoFrontdoorOpen();
    servoTrapdoorClose();

    // define Arduino ports
    pinMode(IR_MOUSE_PRESENT, INPUT);
    pinMode(IR_MOUSE_EATING, INPUT);
    pinMode(RELAY, OUTPUT);
    pinMode(LED, OUTPUT);
    pinMode(MANUAL_LOWER_TRAPDOOR, INPUT_PULLUP);
    pinMode(MANUAL_LOWER_FRONTDOOR, INPUT_PULLUP);

    // deactivate the mouse-in-trap-notification relay
    digitalWrite(RELAY, HIGH);
    // mouse detection led OFF
    digitalWrite(LED, HIGH);
    // reset mouse count led function
    count = 0;
}

//  ##        #######   #######  ########
//  ##       ##     ## ##     ## ##     ##
//  ##       ##     ## ##     ## ##     ##
//  ##       ##     ## ##     ## ########
//  ##       ##     ## ##     ## ##
//  ##       ##     ## ##     ## ##
//  ########  #######   #######  ##
void loop()
{
    // check the infrared sensor. if a mouse walks between the IR transmitter
    // and receiver, a signal is sent.
    checkForMouse();
    blinkMouseCountLed();
    checkSwitches();

    if (mouseEating == true)
    {
        // YAHOOOOO! The mouse will not be happy because the trapdoor
        // is being activated!
        servoFrontdoorClose();
        servoTrapdoorOpen();
        // after the trap door is opened by the unLockTrapDoor function
        // we close it by the servo after 300Ms
        delay(300);
        // now we can lower the servo arm again, ready for the next event
        servoTrapdoorClose();
        
        delay(100);
        servoFrontdoorOpen();
        
        // activate the relay so we get a notofication using for example
        // a domotica system.
        digitalWrite(RELAY, LOW);
        delay(500);
        digitalWrite(RELAY, HIGH);
        
        mousecounter += 1;
        mouseEating = false;
    }
}

//  ######## ##     ## ##    ##  ######  ######## ####  #######  ##    ##  ######
//  ##       ##     ## ###   ## ##    ##    ##     ##  ##     ## ###   ## ##    ##
//  ##       ##     ## ####  ## ##          ##     ##  ##     ## ####  ## ##
//  ######   ##     ## ## ## ## ##          ##     ##  ##     ## ## ## ##  ######
//  ##       ##     ## ##  #### ##          ##     ##  ##     ## ##  ####       ##
//  ##       ##     ## ##   ### ##    ##    ##     ##  ##     ## ##   ### ##    ##
//  ##        #######  ##    ##  ######     ##    ####  #######  ##    ##  ######

void checkForMouse()
{
    if (digitalRead(IR_MOUSE_PRESENT) == HIGH)
    {
        // mouse detected by the FIRST infrared sensor beam.
        timer1 = millis();
        mousePresent = true;
    }
    else
    {
        if (millis() - timer1 > MOUSEPRESENT_DELAY)
        {
            mousePresent = false;
        }
    }

    if (digitalRead(IR_MOUSE_EATING) == HIGH)
    {
        // mouse detected by the infrared optical sensor.        // I use the Arduino on board LED only for testing.
        // set the variable so we can give the mouse a little surprise...
        // HAHAHA!
        if (mousePresent == true)
        {
            mouseEating = true;
        }
    }
    else
    {
        // no mouse detected, BUMMER!
    }
}

void checkSwitches()
{
    // With 2 switches we can manually operate the doors. This is handy to clean and/or
    // put bait into the back of the trap.

    // We have to halt all activities while one of the doors is opened manually
    // so I use a WHILE loop here. Else the doors will operate while triggering one
    // of the IR sensors with our hands.
    while (digitalRead(MANUAL_LOWER_TRAPDOOR) == 0)
    {
        servoTrapdoorOpen();
        manualOpenTrapdoor = true;
    }
    while (digitalRead(MANUAL_LOWER_FRONTDOOR) == 0)
    {
        // here I lower the frontdoor a bit more because
        // it will somehow resonate if I use the normal value
        // of 25 which is used in the servoFrontdoorClose() function.
        frontdoorservo.write(18);
        manualCloseFrontdoor = true;
    }

    // we have to open/close the doors ONLY after a manual operation else it will
    // of course interfere with the normal operation of the trap.
    if (manualOpenTrapdoor == true)
    {
        servoTrapdoorClose();
        manualOpenTrapdoor = false;
    }
    if (manualCloseFrontdoor == true)
    {
        servoFrontdoorOpen();
        manualCloseFrontdoor = false;
    }
}

void servoTrapdoorClose()
{
    // set upper position of the trapdoor
    trapdoorservo.write(131);
}

void servoTrapdoorOpen()
{
    // set lower position of the trapdoor
    trapdoorservo.write(10);
}

void servoFrontdoorClose()
{
    frontdoorservo.write(25);
}
void servoFrontdoorOpen()
{
    frontdoorservo.write(85);
}

void blinkMouseCountLed()
{
    /*
    The count variable controls when to blink and how many times. 
    While it's zero, no blinking.
    When not blinking, it keeps comparing actual time with the last time it blinked. 
    When the time exceed <INTERVAL>, it puts count to five, and in the next loop, the blinking start.
    Variables are declared static so they keep their values between loop executions.
    */

    unsigned long now = millis();

    if (count > 0)
    {
        count = count - blink();
        lastBlink = now;
    }
    else
    {
        if (now - lastBlink >= LED_BLINK_INTERVAL)
        {
            count = mousecounter;
        }
    }
}

/*
 * Do one blink.
 * Return 1 when blink is done.
 */
int blink()
{
    static unsigned long lastFlip = 0;
    static int count = 0;
    bool last = false;
    unsigned long now = millis();

    if (now - lastFlip >= LED_BLINK_RATE)
    {
        digitalWrite(LED, !digitalRead(LED));
        lastFlip = now;
        count++;
        if (count == 2)
        {
            count = 0;
            last = true;
        }
    }
    return (last) ? 1 : 0;
}

Schematics

MouseOleum schematic - version WITHOUT shield and wifi
This is the schematic for the MouseOleum v2.0 which uses external IR detection boards, without Wifi notification
MouseoLeum schematic - WIFI + SHIELD version (!)
This is the schematic for the MouseOleum v2.1 which uses an Arduino shield with Wifi notification

Comments

Similar projects you might like

Digital 3D Printer Filament Counter Using PS/2 Mouse

Project in progress by ArtSuzhou

  • 8,632 views
  • 11 comments
  • 33 respects

Arduino with multiple sensors and a web interface

Project showcase by Nicolas Mora

  • 20,333 views
  • 9 comments
  • 32 respects

Air Quality Monitor Live Display

Project in progress by Parts Oven

  • 1,942 views
  • 0 comments
  • 7 respects

Where's my stuff?? - Find your misplaced things with Alexa!

Project in progress by Team Crakers

  • 1,629 views
  • 0 comments
  • 6 respects

Magnetic Levitation

Project showcase by Hao Jie Chan

  • 34,653 views
  • 66 comments
  • 71 respects

VU Meter on Steroids: Arduino Nano and NeoPixel WS2812B

Project in progress by Team WannaDuino

  • 21,815 views
  • 81 comments
  • 80 respects
Add projectSign up / Login