MouseAir launches toy mice for the amusement of cats

Firing Sequence

MouseAir goes through a specific set of steps to launch a mouse. These steps are automated and timed to make sure that the mouse proceeds through the mechanism properly and to provide a good experience for the cat:

  • 1. Take a picture of the unsuspecting cat. Python threads this step in the background so the rest of the launch can proceed quickly.
  • 2. Open the top servomotor to load the mouse into the pre-load chamber and then close the servo.
  • 3. Open the bottom servomotor to drop the mouse in front of the door lock solenoid and then close the servo.
  • 4. Start the thrust motors one at a time to minimize the inductive kickback to the power supply.
  • 5. Fire the door lock solenoid, propelling the mouse between the two spinning motors.
  • 6. The mouse is launched!
  • 7. Retract the solenoid and shut off the two spinning motors.

Now the system is re-armed for the next mouse launch.

Control Panel

I really like having control panels for my projects, and I admit that I have used a lot of switches and lights in the past to make things look cool. However, in my advanced state of enlightenment, I have determined that I would rather build the control panels in software on an iPad and have the ability to control the device remotely from either across the room or across the Internet.

To do this efficiently, I use an application called RasPiConnect [4]. The app supplies a number of different controls, web views, and live graphs. The last project I built with this app (Project Curaçao, a solar- and wind-powered remote environmental monitoring system) used more than 100 controls, so I decided to use RasPiConnect to build the control panel for MouseAir.

Using the RasPiConnect is a lot easier than trying to write a custom iPad or iPhone app for a project. RasPiConnect communicates with a Python-based server on the Raspberry Pi and can even talk to Arduinos.

I created a MouseAir control panel with all four groups of controls on one page (Figure 9) as follows: (1) The camera controls (blue buttons) show the current picture or video stream. I can also position the camera or use the presets that look at the cat or the mouse. (2) The buttons in the gray panel allow me to control all of the loading servomotors, the DC motors, and the launch solenoid. Along with the camera, it allows me to launch mice manually and attempt to clear any jams. (3) The three trigger controls allow me to turn the ultrasonic, RFID, and camera motion triggers on and off. (4) A live, continuously updated graph shows the current output from the ultrasonic sensor. The ultrasonic sensor runs all the time but only triggers a mouse launch when the ultrasonic trigger is turned on.

Figure 9: The MouseAir control panel.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content