Waterwall - the details

First of all I want to assure all animal lovers that only fresh and clean water in very small drops is used to scare the hell out of these little creatures.
This project is the logical result from combining my wish to keep them out of my room with their natural fear of water. So far they had proven very hard to teach about my room. This means the solution had to be automated and on guard 24 hours a day. The idea for waterwall was born and now has become real. For entertaining purposes and lack of other use I threw my webcam in to - hopefully - get some nice pictures.

Have a look at the archive.

Hardware

circuitMain components are an IR intrusion sensor and a windshield washer pump. But even though the sensor modul is ready to go and has a relay built in, some extra parts are needed. For two reasons:

  • the sensor can only trigger up to 1A - this is most likely not enough for the pump
  • to avoid disasters the pump operation time must be limited
The best solution for the first point seemed to be a more powerful relay. To get the time limitation the relay is powered by a capacitor which is charged continously except for activation... It then triggers the relay for a short period.

Of couse this would only be half the fun if there wasn't a computer involved. To get the information into the computer and not having destructive voltage peaks (due to inductive components) do the same a separate relay switch is used to ground the parallel port's PE upon activation.

If you want to have a look at the whole thing, just click here.

Software

On the software side two shell scripts and a tiny c program are operating. The c program, called pare, is listening for a event on the parallel port and terminates as soon as one occurs. The first shell script (webcam-request) waits for pare to exit and then starts a listener for incoming webcam pictures and after that requests the image from the computer the webcam is attached to. This computer runs the other script called webcam-send. This script retrieves a picture from the webcam and sends it to the webserver.

pare

[not yet available]

webcam-request

webcam-request
#! /bin/bash
#
# Copyrights by Michael "Mr. Sump" Poppitz
#

EVENTLISTENER='/usr/local/bin/pare'
NETCAT='/usr/bin/netcat'
TMPPIC='/tmp/webcam.incoming.jpg'
WEBPIC='/home/httpd/htdocs/webcam/webcam.jpg'

while true
do
$EVENTLISTENER
$NETCAT -w 5 -l -p 12345 > $TMPPIC &
$NETCAT -z sfsump 12346
sleep 10
if test -s $TMPPIC;
then
     cp $TMPPIC $WEBPIC
fi
done;

webcam-send

webcam-send
#!/bin/bash
#
# Copyrights by Michael "Mr. Sump" Poppitz

VIDCAT='/usr/local/bin/vidcat'
NETCAT='/usr/bin/netcat'

while true;
do
$NETCAT -l -p 12346
$VIDCAT -d /dev/video1 -s 640x480 -q 50 -f jpeg | $NETCAT -w 2 sfweb 12345
sleep 10
done

Comments