Hey all, new to this forum and new to the picaxe line of chips. I been reading on here for a few weeks and doing research to fix my issues with the cats getting on my counter tops. I needed to find a way to keep them off, especially when I'm not around. After reading about how easy it was to program these chips (last time I did any microcontroller programming was in college learning assembly language on motorola chips), I decided to implement my own solution.
So the basic rundown is that my cheapo blender can be activated rather easily. A simply normally open relay wired into the blender to close the circuit between the ac power and the motor. A motion sensor as an input source and a picaxe in between to handle everything else.
Part 1 of my project is on my blog here, Part 1, and part 2 (with a video of it in action) is here, Part 2
Here's the schematic I of the circuit I built.
Here is a shot of it where it is currently sitting. It works so well on the counter, I decided to put it under the Christmas tree to keep the cats out.
And last but not least, the simply program I threw together.
Looking forward to building more gadgets!
So the basic rundown is that my cheapo blender can be activated rather easily. A simply normally open relay wired into the blender to close the circuit between the ac power and the motor. A motion sensor as an input source and a picaxe in between to handle everything else.
Part 1 of my project is on my blog here, Part 1, and part 2 (with a video of it in action) is here, Part 2
Here's the schematic I of the circuit I built.
Here is a shot of it where it is currently sitting. It works so well on the counter, I decided to put it under the Christmas tree to keep the cats out.
And last but not least, the simply program I threw together.
Code:
init:
symbol relayout = 2 ; Set pin 2 as an output with name 'relayout'
symbol prox = pin3 ; Set pin 3 as in input with name 'prox'
for b1 = 1 to 15 ; Loop that creates a 30 second delay
pause 2000 ; so that the proximity sensor can initialize
next b1
main: ; Main program code to watch for movement
if prox = 0 then goto alarm ; If there is movement launch the alarm subroutine
goto main
alarm: ; The alarm subroutine
high relayout ; Turn on the blender
pause 2300 ; Wait 2.3 seconds
low relayout ; Turn off the blender
pause 5000 ;Wait 5 seconds to give cats time to run away
goto main ; Go back to the begining