555 Timer Help.
Hello all,
I am currently working on a remote controlled Ranch gate that will respond to headlight flashes using the photoresistor.
Pseudo Code is as follows.
Determine what time of day it is
Take initial reading, monitor and adjust sensitivity as time progreses and the RC time begins degradation.
Activitation
one flash - substantially higher than the current day light
pause 500
Wait for another flash
question - how do i Get the stamp to wait and sense at the same time? - 555 timer???
with 555 ( set 555 timer. while time is less than 15 seconds and # of flashes != 3 ) THEN keep sensing.
So.... This is pretty much the core of it. How do I operate this wonderful 555 timer with the stamp?
I've searched with
[noparse][[/noparse]/code]
I am currently working on a remote controlled Ranch gate that will respond to headlight flashes using the photoresistor.
Pseudo Code is as follows.
Determine what time of day it is
Take initial reading, monitor and adjust sensitivity as time progreses and the RC time begins degradation.
Activitation
one flash - substantially higher than the current day light
pause 500
Wait for another flash
question - how do i Get the stamp to wait and sense at the same time? - 555 timer???
with 555 ( set 555 timer. while time is less than 15 seconds and # of flashes != 3 ) THEN keep sensing.
So.... This is pretty much the core of it. How do I operate this wonderful 555 timer with the stamp?
I've searched with
[noparse][[/noparse]/code]
Comments
In terms of hooking up a 555 timer to a Stamp, you use one I/O pin for the trigger input to the 555 with a LOW acting as the trigger and HIGH as idle. The output of the 555 gets connected to another I/O pin in INPUT mode.
Post Edited (Mike Green) : 1/3/2008 6:40:03 PM GMT
DO
(Calibrate the sensor)
LOOP WHILE "one flash not detected"
READ time and date and other data and GOTO back to the DO/LOOP to wait for another "one flash"
This is what Mike Green is referring to
Check Sensor:
If light sensor > threshold value then PAUSE 1000 (gives a one second pause)
For interval = 1 to 10 : Read light sensor
··· IF light sensor > threshold value then goto open·gate routine
··· Pause 100
Next
Goto Check Sensor
·After the initial flash, the program waits for one second before taking the next reading.· Thereafter it reads the sensor once every 100 milliseconds for ten consecutive loops (= one second in total).· If the light sensor reading exceeds the threshold value during this time, the program jumps to the open gate routine.· If not, it goes back to the start of the program.·
You can use the·NAP and/or SLEEP commands for saving power between cycles.·
You could also time the length of the flashes by using a loop with an incremental counter.