Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A meower for the Raspberry PI
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.



meowPi is a Raspberry Pi program that emits a meow when a trip wire is activated.


Every person has a responsibility to himself and the world. As Gandhi once said: "Whatever you do will be insignificant, but it is very important that you do it."

Unfortunetly Gandhi wasen't alive to see the creation of RPi meowers, but if he were alive today, I'm sure he'd change his quote to reflect the importantace of these devices.

Anyways, let's get started.

Background Information

In this tutorial you'll be building a ultrasonic based tripwire for your Raspberry Pi that'll play a "meow" sound when activated.

Sonar works by emitting a pulse of sound, and timing how long it takes for that sound to to bounce back to a reciever. Since we know how fast sound travels (~340m/s) and we can figure out how long the sound took to get there and come back, we can calculate the distance of the object.


To play sounds we'll be using the pygame.mixer library. This library should already be installed on your RPi assuming you're using wheezy.


Hardware Setup

First up we'll be wiring the sonar to the RPi as follows : Wiring
Image courtesy of Matt Hawkins


The software is split into 4 main files:

  • Top level file. Checks for difference in sonar distance. Emits a meow if within certain range.
  • Driver for playing meow sounds.
  • Driver for sonar.
  • Simple debug output

To run the code, simply run the command in terminal:


And when an object is within a certain distance of the sonar, a meow is played.


Something went wrong with that request. Please try again.