Arduino Mouse Trap

27,179

134

36

Introduction: Arduino Mouse Trap

Hi people!
For this Challenge, I created an Arduino controlled Mouse Trap to capture any unwanted pests that may wander into your space. The project is complete but I have one more addition that I will try to make. More about this at the end.

Step 1: Make the Box for the Trap

Here is the basic trap box. The wire mesh was cut and bent to the shape. Size is 3" x 3" x 6" [7.5cm x 7.5cm x 15cm] long . The mesh is McMaster-Carr #9219T173. You get a 12" square piece. I cut out the piece as shown with a Dremel. Here is the pattern that I used.

.

Step 2: Make the Door and Hinge

The door is a piece of polycarb that I had in my scrap box. It is 1/8" x 2" x 2". The hinge is a 1/8 dia. x 1-3/4 lg. tube that is glued to the Door top edge. The Hinge Pin is just a rod that fits inside the Hinge Tube. The Hinge Pin is glued to the TrapBox so that it is free to open and close.

Step 3: Servo Mount and Tie Rod

Servo support and IR sensor holders were also recycled from other previous projects. You
can make one from plastic or wood. The Servo support is a piece of phenolic. The Servo is just a Micro-Servo available from almost any electronics ebay vendor. Same with the IR Led and IR receiver. I bought them years ago, probably from Digi-Key. Again any ebay electronics vendor has them. Just get a pair matched to the same IR wavelength for best results.

At the bottom of the Door, I glued a short piece of tubing to fasten the Tie Rod from the Servo to. A wire was bent to go between the Servo Horn and the tube. You will have to adjust the Servo open and closed position in the sketch to get the Door open and closed correctly.

Step 4: Fritzing Schematic, Sequence of Operation & Code

Electrical/Electronic Parts List:


* Arduino UNO w/USB cable

* Micro Servo

* Breadboard

* LCD Display 20 x 4 Lines w/I2C backpack (4-wire connection to Arduino)

* IR Transmitter and Receiver Set

* 1k-1/2 watt Resistor

* 10k-1/2 watt Resistor

* 4.5v Battery Holder for Servo power

* 9vdc Battery for Arduino, LCD and Sensors

* Jumper Wires

Mouse Trap Operation Sequence.


1. Arduino is plugged into a 9v battery starting the sketch.

2. Servo moves to the start position which opens the door.

3. The Arduino checks for Door Opening and IR Sensor alignment

4. The condition of these checks appears on the LCD display.

5. Now the Arduino waits for a mouse to enter the Trap.

6. When a mouse enters, it should move towards the bait at the far end.

7. Just before the bait is a IR Transmitter and Receiver to act as a break-beam.

8. Breaking this IR beam activates the Servo to close the door.

9. Now your pest is trapped.

Step 5: Videos

Here are (3) videos of my Arduino Mouse Trap. As you can see in the videos, I had to use a toy mouse to demo the Trap. A live one was not available. All together I had about 3 hours in building this project. It was fun and I will update the project eventually. I have on order a ESP8266 board. I may be able to send a message to yur phone when the Trap is closed and a mouse caught.

I hope you enjoyed looking at my Instructable.

Pest Control Challenge

Runner Up in the
Pest Control Challenge

1 Person Made This Project!

Recommendations

  • Big and Small Contest

    Big and Small Contest
  • For the Home Contest

    For the Home Contest
  • Game Design: Student Design Challenge

    Game Design: Student Design Challenge

36 Comments

0
christianity357
christianity357

Answer 6 weeks ago

Seems like the code is not there when i download it

0
dontno41
dontno41

Question 2 years ago on Step 5

Is the code for mouse trap available for download?

0
lexlexlexie1391
lexlexlexie1391

Question 3 years ago

Just curious... If using a 2 line not a 4 line LCD and you only have a 16 pin screen instead of a 4 pin LCD screen will there be any changes to the code?
Also, is there a way to just do this without the LCD all together? if so could you email me a revised code I would be eternally grateful!
One more thing, you have added a wire.h library but I didn't see any thing beyond recognizing it.
Ok I lied lol One more thing... I am using a PIR sensor instead of the transmitter and receiver... do I need to do anything different for it? (on both or either code and breadboard)

0
mughal1234
mughal1234

3 years ago

In the fall of 2018, I taught Sensor, Signals, and Systems class with 74 students enrolled in it. In this course students learn about commonly used sensors such as resistive temperature sensors, capacitive touch sensors, and inductive motion sensors and actuators. Numerous applications are presented to motivate coverage of fundamental operating principles of circuit elements such as resistors, capacitors, and inductors; model the signals produced by these sensors; and analyze the circuits and systems used to amplify and process these signals. Therefore, a term project with real world
application was a part of this course. The idea is to develop prototyping skills,
design complex projects, and provide solutions. The project such as this is a great way to
improve/implement student's understanding of the knowledge gained from the class, in addition to developing skills and ability to solve real world problems.
Students are encouraged to add and/or improve the features of the Instructables. In addition, students were required to package the final project by designing a 3D printed case.
The Excel file contains all the projects made by students including this one (Electronic Mouse) with Instructable web links included. The file project guidelines has all the details about the flow process on how to complete the project. Also attached is the proposal submitted by the students for this Instructable.

IMG_0682.JPGIMG-1290.JPGIMG-1291.JPGIMG-1292.JPGIMG-1293.JPG
0
RaffyR5
RaffyR5

3 years ago on Step 4

It couldn't open after i download. Can you pls send me a code. Or you can send to me in my gmail account raffyrosal@gmail.com im hope u send me the code because i really need it for my project. Thank you in advance. Hope u read this

Screenshot_20190718_190557_com.huawei.hidisk.jpg
0
Zohaib22
Zohaib22

6 years ago

Any programming used??? Plz tell me i want it to present in my school.

0
-Gary
-Gary

Reply 6 years ago

The code is available for download in Step #4 by clicking the "Mouse_Trap.ino" button.

0
Abby Aron
Abby Aron

Reply 6 years ago

I can't find it

0
-Gary
-Gary

Reply 6 years ago

It is in Step #4, below #9 of the Mouse Trap Operation Sequence.

0
RaffyR5
RaffyR5

Reply 3 years ago

It couldn't open after i download. Can you pls send me a code. Or you can send to me in my gmail account raffyrosal@gmail.com im hope u send me the code because i really need it for my project. Thank you in advance. Hope u read this

0
joshboye
joshboye

5 years ago

Cool project, I hope you modify it with the ESP8266 board.

1
奕軒呂
奕軒呂

6 years ago

Does the Arduino program have the annotation?

0
saadi_420
saadi_420

6 years ago

I believe that the circuit is a little wrong??? the servo motor should be connected to pin 9 in the diagram?? not A0. !! right

0
-Gary
-Gary

Reply 6 years ago

Good catch saadi_420! Thanks, it is now fixed.

0
-Gary
-Gary

6 years ago

Hi JhonattanX
To answer your question... the 1k resistor goes to the IR LED emitter, the 10k resistor goes to the IR transistor or receiver.
Sorry that I did not label it in my Fritzing schematic.

Regards,
-Gary

0
teletobi
teletobi

6 years ago

Very nice one! But what are you doing if you caught one? The Trap in your Pictures is missing a Floor, you can´t lift it off the Floor with a Mouse inside. And maybe you will need an Escape Exit to let the Mouse out.

0
-Gary
-Gary

Reply 6 years ago

Hi teletobi

Very observant of you about not seeing a floor! The floor is included with the Box Trap.pdf template. I doubted if I would ever have to use the trap so I did not include the floor. The actuator wire pulls out from the door to open it. You would decide what to do with him. Maybe take him down the street and release him or whatever.

0
albatools
albatools

7 years ago

where are the sensors connected to?

0
-Gary
-Gary

Reply 7 years ago

One is an IR led, the other is an IR receiver. When a mouse breaks the IR beam, the Arduino reads it and closes the door.