Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A meower for the Raspberry PI
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
images
sounds
README.md
debug.py
meow.py
meowPi.py
sonar.py

README.md

MeowPI

meowPi

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

Introduction

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.

Sonar

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.

Parts

Hardware Setup

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

Software

The software is split into 4 main files:

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

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

python2.7 meowPi.py

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

Enjoy!

Something went wrong with that request. Please try again.