
I have built this project with many
microcontrollers. Some were complicated and expensive.
This one uses the Athena Chip and is the simplest and least
expensive of the bunch.
The Athena also has one advantage over most
microcontrollers on the market. It has an ultra low power
consumption mode when put to sleep. In the configuration I
will show in this application note the Athena will use < .1ua of
power while waiting for something to trip the sensor.
After my two
dogs ruined my sofa I purchased a new one. I decided it was time to
use some technology to keep the dogs at bay.
Our dogs (or at
least the main culprit) are very smart. The main perpetrator is a
red Doberman female named Moxi. She absolutely knows she is doing
wrong as she waits till we are a sleep or out of the house until she
makes her self comfortable. It would not be so bad except she tends
to slobber when she sleeps and there is nothing worse than having a
guest sit down in a juicy wet spot.
My first idea
was to use some sort of detector that transmitted to one of those
electric training collars. But I kept imagining one of my cats
jumping on the sofa just to shock the dog.
We will use the Kronos
Siren application note to build a 120db+ Siren.
After some set
up at manual testing it became clear that this would do the job.
Not only did the siren put a end to her midnight maneuvers but it
seemed to make the other male Doberman very upset that she was
causing so much commotion. Moxi seemed to think it just wasn't
worth the effort and decided that her bed was much more quiet and
conducive to sleep.
Getting Started
The first thing you need to do is build the KRSiren.
Complete instructions and parts can be found
here.
The Sensor
The sensor is very simple and
can be built by just about anyone. As you can see by my sloppy hot
glue job, you don't even need a steady hand.
Here is a list of Items you will need to build the sensor.
- 1, 6" long support: The
support can be just about anything. I have used wood and
plastic. In this case we are going to use a discarded piece of IC
tube. Your support will need to be 6" long. Note
that you can also forgo this support and just use the case as the
base for the sensor.
- 1, Insulated ring terminal
with a 1/8 or smaller hole. The smaller the hole the more
sensitive the sensor.
- 2, 6" long pieces of
24-28" GA hook up wire.
- 1, #4 hex nut to act as a
weight. Note you can use a piece of discarded copper wire or
just about anything at hand for this.
- 1, piece of piano wire.
(thinnest you can find) 6.5" long. The thinner the wire the
more sensitive the sensor.
-

Attach the ring terminal to
one side of your support with hot glue. Install the ring about 1/2"
from the end as shown. It is also helpful to wet the base of the
ring just above the insulation with solder. This way you won't have
to apply as much heat later when you attach the hookup wire.
Remember you can mount the sensor components directly to the inside
of the case.

Take the 6.5"
wire and bend it as shown. Clean about 1" of the straight end with
sand paper. The little nub on the bent end is used to attach the
hookup wire. This nub should be cleaned with sand paper as well.
Note that the thinner the wire the shorter the main span needs to
be.

Attach a hookup
wire to the nub on the bent end as shown. Then insert the straight
end through the hole on the ring terminal. Attach by using hot glue
on the bent end as shown.

Now attach the
other hookup wire to the ring terminal. Also take the small weight
and attach it to the end of the straight wire with solder or hot
glue. Go ahead and tack down the hookup wire with hot glue. At
this point you need to slightly bend the wire so that it balances in
the middle of the ring terminal.
You can make the sensors more
sensitive by adjusting the wire so that at it barely contacts the
ring terminal (or splice cap). For the ultimate sensitivity adjust
the wire so that it is actually touching the contact point. This
way just about any movement at all will set it off. Just keep in
mind that you can make the sensor so sensitive that just walking can
set it off.
As far as battery life goes
you will get several months of use out of a set of Alkaline
batteries. You can also use rechargeable batteries.
Hookup

Use no more than 4 cells for your battery. If
you use alkaline batteries this will yield 6 volts. Even
though the Athena is rated at 3.5 - 5.5 volts I have found on
projects like this that a 6 volt battery works just fine.
Your actual layout will depend upon the case that
you use. I used a small packtec case.

I used the Athena Carrier #1 for hookup. You
can also use a general purpose PCB as well.

Here is a close-up of my sensor. I used the 9v
battery compartment for mine. Notice the hex nut glued to the
end of the main sensor wire.

A simple 4 Cell battery pack works fine. I use
AA's but AAA's will work just as well.

I mounted the KRSiren on the top of this case.
You could also mount it inside as long as you have a hole for the
sound to escape.
Program
(download it here)
'Coutch Watcher
dim x
RCSTA=0 'Turns off UART
configio 0,1,2,3,4,5,6,8,9,10,11,12,13,14 ' Sets all ports to output
'Only need this if using carrier 1 board
setio 11,12
'Use this if port 11 and 12
are not held high with resistors as they are with the 'Carrier1
setio
gosub blink
p7irq 3
loop:
sleep
gosub soundalarm
longpause 250,8
goto loop
soundalarm:
longpause 250,4
high 1
longpause 250,4
low 1
longpause 250,2
high 1
longpause 250,4
low 1
return
blink:
for x = 1 to 20
high 1
pause 2
low 1
pause 50
next
return
The program is straight forward. The key is to
make sure power usage is at a minimum when the chips is sleeping.
setting all IO ports to output and low will lower power consumption.
Also turning off the UART.
Note: When the UART is turned off make sure you
don't use a print or debug command as the Athena will lock up.
The program sets up the port 7 IRQ then goes to
sleep. A change of state on the IRQ will cause the Athena to
wake up. Once the chip wakes up it sounds the alarm and goes
back to sleep.
Parts
Easy RS232 Driver
Athena
Athena Carrier 1
SPST Switch