New and Improved Mouse Trap

by ballen110 in Circuits > Sensors

102 Views, 2 Favorites, 0 Comments

New and Improved Mouse Trap

mouse.jpeg
replicator__1.png
products-238-4_1.jpg
11884-Servo_-_Hitec_HS-422__Standard_Size_-01.jpg

Regular household mouse traps aren't working for a variety of reasons, including not being able to detect the mouse, getting jammed or the mouse not being able to detect the odor of the bait put on the trap. The goal of this improved mouse trap that uses a motion sensor is to catch the mouse without harming them and ensure the mouse is quickly captured the moment it is sensed. This mouse trap is effective, convenient, and quickly catches the rodents to be used in any household or building.

Supplies

circuit_playground_cpx02.jpg

The supplies you will need to complete this project are a 3D printer, Circuit Playground Express, Servo, Cardboard, Push button, Blue wires, solderable breadboard,USB-C cord and the website Adafruit Makecode.

Print the Parts

unnamed-12.jpg

Using this link below print the 3D parts using a 3D printer, located in a classroom or the Makerspace. A printer with supports is needed.

Create the Pressure Plate

First, you need to create a pressure plate to sense the mouse when it enters the trap. In order to do this, we need to solder a push button to a piece of solderable breadboard to act as a pressure plate. The solderable breadboard contains holes that you will use to connect the electronic components onto the board. Solder the blue wires onto the two points of the breadboard so when the push button is triggered, the electric currents will run through. The purpose of using the solderable breadboard is to build semi-permanent prototypes of electrical circuits.

Adding an Extra Layer of Surface Area to the Pressure Pad

products-238-4_1.jpg

Next, cut out a piece of cardboard with the same measurements as the breadboard. Then, place and glue it over the piece of the breadboard. The purpose of adding the piece of cardboard is to add an extra layer of surface area to the pressure pad for support.

Wiring

unnamed-11.jpg

Now, we need to wire the circuit playground express to our mouse trap. The servo will be placed on top of the trap, the 3 wires connected to the servo will control it. Most importantly the wire in the A1 slot. The A1 wire is going to tell the servo to move while the other two wires provide it with a flow of electricity for it to work. The servo motor is a functional tool, which helps to control the movement of the trap.

  • In order to connect and assemble the servo motor, we are going to place the servo into the holder hole facing towards the entrance hole, the wires connect to the ground port, 3.3v port and the control wire is connected to one of the control ports.

Coding

unnamed-13.jpg

Here is the code you will need to use to control the mouse trap using the website Adafruit Makecode.

  • On make code, under the input section you will select "On button A click", then connect the block to "set servo A1 angle to 0 degrees."
  • You are going to repeat this step using another block from the input section that says "On pin A6 click" and connect that to block "Set servo A1 to angle 60 degrees."

https://learn.adafruit.com/welcome-to-circuitpython/what-is-circuitpython?gad_source=1&gclid=CjwKCAjww_iwBhApEiwAuG6ccMMOmWzYFJ5aJ_7MavohiAocqQiJAkJc0HGC6xxwa5WioFowe5QowRoCfnUQAvD_BwE

https://makecode.adafruit.com/

https://learn.adafruit.com/makecode/downloading-and-flashing


In order to download the code we have to follow two simple steps:

  1. Connect your board via USB and enter bootlander mode. To do this press the reset button once on your CPX to put it in bootlander mode. The LEDs will turn red briefly, then green.
  2. Next, click the download button and it will generate a .uf2 file, then download it to your computer!

How to Use

mouse.jpeg
unnamed-11.jpg

Connect your USB cord from the CPX to your laptop. When pressure is sensed entering the trap, the door of the mousetrap will automatically close. The pressure pad works to sense the movement of the mouse as quickly as possible. To open the trap all you need to do is simply press the A1 button on the CPX.

Downloads