Introduction: Smartphone Hacks: Interactive Mousetrap Phone Charger

Are you tired of those annoying mice running around your attic or your basement? It's time to put them to good use with this Interactive Mousetrap. When you catch a mouse with this trap, you will receive an e-mail notification (and a picture of the mouse). On top of that, the trap will start charging your phone when the mouse is running inside the included wheel.

Step 1: What You Need

Here are all the materials you will need:

  • MDF wood: 2500mm x 1500mm x 18mm
  • MDF wood: 1700mm x 500mm x 6mm MDF wood
  • 1000mm x 900mm x 4mm Plexiglas: 500mm x 450mm x 4mm
  • Wood glue 250 gr
  • Solid round bar iron 400mm, 3mm diameter
  • 1 Brushed CD Motor
  • Several power wires
  • Screws
  • Charging cable from phone of choice
  • Power bank
  • 1 hexagon nut
  • 1 flange plate
  • Android phone
  • Your own phone

Here are all the tools you will need:

  • Milling machine
  • Laser cutter Naler
  • Sandpaper Sander
  • Drilling Machine

Step 2: Cut Your Pieces

When you cut out your pieces make sure that you keep the pieces from the different materials separate.
Take the MDF of 18mm and mill the shape of the “” file with the milling machine.

The space you need to mill in the door of the mousetrap is 10mm. The holes for the two pieces of wood sticking out of the side are 6mm in height. The (big square) hole for the motor is 4 mm in the first layer and totally cut through in the second layer. The smallest hole for the phonecharger should be about 8 mm's.

Take the MDF of 6mm and cut out the shape of the “” file with the laser cutter.

Take the MDF of 4mm and cut out the shape of the “” file with the laser cutter.

Take the Plexiglas and cut out the shape of the “” file with the laser cutter.

Step 3: Assemble!

Check all your pieces and make sure that all irregularities have been sanded away. First make the frame of the mouse trap by taking the outside walls and attache the layers on top of each other with wood glue and use the nailer for extra security. See the mockup image for the right example.

Then cut the iron bar to 14,4 cm. Take the door and put it on the right position in the mouse trap with the frame of the phone on the inside. Then take the two little cut out circles and place them on each side of the door. Then take the iron bar and stick it through the wall of the mouse trap, circle, door, circle and wall of the mouse trap.

Sand the outside walls of the mouse trap and paint it with two layers of wooden glue. After applying the first layer, wait for applying the second layer until dry.

Cut out a piece of 23 cm from the iron bar and place this inside the mouse trap between the two coves. Take the three pieces for the seesaw and stick them together with wood glue and make sure that the slit is at the bottom. Take the vertical Place the seesaw onto the iron bar.

Take the CD Motor and attach it to the mouse trap by using two screws. Make sure that the transmitter is put through the big squared hole.

Take the two squared wooden pieces and stick them trough the two holes with some glue.

Take the last evenly squared wooden piece and glue it on the outside of the wall in front of the door.

Attach the flexible piece to a wooden circle on each side with wood glue. When dry, place the wheel on the DC motor and secure with a flange plate and hexagon nut.

Take a drilling machine and make small hole through the wall next to the DC motor on the left. Secure two power wires on the ends of the DC motor and put them through the whole. Put those in the bread board which is placed inside the mouse trap and implement a resistance on it. Place two new power wires onto the board and with an Android plugin on the other side. Stick this plugin through the hole beween the two sticked through wooden squares.

Step 4: Let's Code!

Download processing here.

We will use processing to create an application on your android phone.

Setup your processing for Android

To be able to create an android application with processing we have to download processing for Android. Download it here. Once the installation is complete be sure to activate android mode in processing in the top right corner.

Google Drive Files

Next up download the zip file from this google drive link. Open up one of the .pde files to see your code in processing. Plug your Android phone into your computer and run the processing sketch. Close the application to move your phone, open it up again if you place the phone in the phone holder on the mousetrap. Once the application is opened and the door falls down it will send a e-mail notification with a picture of the mouse you've caught.

Setup your Mailtrap inbox

Mailtrap is a dummy SMTP server for development teams to test, view, share transactional and other emails sent from DEVELOPMENT and STAGING environments. In our case we are going to use this tool to send a notification and picture to our e-mail inbox when the mouse is caught.

You will have to start by creating a mailtrap account here. After you have created your account you will be able to look at your mailtrap inbox. The next step is to set your mailtrap account inside of your regular e-mail account. In this case we will be setting it up inside of your Mac mail.

Go to your internet accounts inside of your macbook settings. (first picture)

Next, add a new account and fill in your name, e-mailadres and password you can find inside your mailtrap inbox. (second, third and fourth picture). Click on save. Your computer might give you an error message but this is completely normal.

Succeeding this you will have to go to your mail settings (on Mac mail it's: Mail -> Preferences) and copy the data that is filled in on the fifth picture. The password is the same one you used for setting up your internet accounts (mailtrap password).

Et voilà, you can start receiving e-mail notifications through Mailtrap and your android phone's sensors.

Step 5: Implement

Take a look at how to implement this Interactive Mousetrap Phone Charger.