Hardware Reference
In-Depth Information
Networked Cat
Web browsing and email are all very simple
for humans because we've developed
computer interfaces that work well with
our bodies. Keyboards work great with our
fingers, and mice glide smoothly under
our hands. It's not so easy for a cat to
send email, though. This project attempts
to remedy that while showing you how to
build your first physical interface for the
Internet.
MATERIALS
» between 2 and 4 force-sensing resistors,
Interlink 400 series
» 1 1-kilohm resistor
» 1 solderless breadboard
» 1 Arduino microcontroller module
» 1 personal computer
» 1 web camera
» 1 cat mat
» 1 cat
» 2 thin pieces of wood or thick cardboard,
about the size of the cat mat
» Wire-wrapping wire
» Male header pins
If you're a cat lover, you know how cute they can be when
they curl up in their favorite spot for a nap. You might find
it useful during stressful times at work to think of your cat,
curled up and purring away. Wouldn't it be nice if the cat
sent you an email when he lays down for a nap? It would
be even better if you could then check in on the cat's
website to see him at his cutest. This project makes that
possible.
Putting Sensors in the Cat Mat
First, you need a way to sense when the cat is on the mat.
The simplest way to do this is to put force sensors under
the mat and sense the difference in weight when he sits on
it. How you do this depends on what kinds of force-sensing
resistors you use. Interlink's 400 series FSRs work well for
this project. Mount the sensors on something with a firm
backing, like masonite, or another type of wood or firm
cardboard.
The system works like this: force-sensing resistors are
mounted under the cat mat and attached to a micro-
controller. The microcontroller is attached to a personal
computer, as is a camera. When the cat lies down on the
mat, his weight will cause a change in the sensor readings.
The microcontroller then sends a signal to a program on
the personal computer, which takes a picture with the
camera and uploads it to a web server via a PHP script.
Then the program calls another PHP script that sends you
an email, letting you know that your cat is being particu-
larly cute. Figure 3-7 shows the whole system.
There are some FSRs that are long and thin, like Interlink's
408 series. Long sensors aren't all that common, though,
so you're more likely to have small round sensors like the
400 or 402 series. If you're using those or other smaller
FSRs from another company like CUI or FlexiForce, you'll
need to make a larger sensing pad. First, cut two pieces of
wood or firm cardboard slightly smaller than the cat's mat.
Don't use a really thick or hard piece of wood. You just need
something firm enough to provide a relatively inflexible
surface for the sensors. Attach the sensors to the corners
of one of the pieces of wood or cardboard. Sandwich the
sensors between the two boards. Tape the two boards
together at the edges loosely, so that the weight of the
cat can press down to affect the sensors. If you tape too
tightly, the sensors will always be under force; too loose,
and the boards will slide around too much and make the
cat uncomfortable. If the sensors don't give enough of
a reaction, get some little rubber feet—available at any
electronics or hardware store—and position them on the
You'll do this project in several parts:
1. Write an Arduino sketch to read sensors in the cat's mat
and send the results serially to Processing.
2. Write a Processing sketch to read the serial data and
when appropriate, call a PHP script that sends mail.
3. Write a PHP script to send mail.
4. Make a web page for the cat cam.
5. Write a second PHP script to accept new image uploads
for the web page.
6. Modify the Processing sketch to take new images and
upload them via the second PHP script.
Search WWH ::




Custom Search