Timed Spike.

Joeroddis

Member
What would be the best way to create a 5v spike every 12 hours?
I'm currently making a project that will turn a light on for 12 hours and then off for 12 hours for my reptile tank.

Edit: How about if i use a 08m to do the timing and connect the output to the 18x?

For b1 = 1 to 720 ‘ 720 loops (12 hours)
pause 60000 ‘ wait 60 seconds
next b1

How accurate would this be?
 
Last edited:

Dippy

Moderator
Are you sure you mean a 'spike'?

Is this 'spike' a brief 5V spike that triggers a device that toggles on/off in response to a spike? i.e. spike-on .... spike-off .... repeat.
Duration of spike?

You could do this with a PICAXE as long as you don't expect fantastic accuracy.

Oh, youv'e edited/added while I was typing...

How accurate? Reasonably. There are the code/loop overheads which would add, and a slight variation with temp. But you can adjust the loop number with some trial and error.

Why not do it all on the 18X?
Or use a PICAXE which uses a crystal which would be moe accurate if important.
 
Last edited:

marcos.placona

Senior Member
Aren't you just talking about a pin x go HIGH every 12 hours?

As far as I'm aware, picaxe is not so accurate to work as a clock for 12 hours for example, but you could make some tests and see how accurate it can be.

cheers
 

hippy

Ex-Staff (retired)
You can connect a 32kHz watch crystal to an 08M and should get timing near as accurate as a watch or wall clock would be; a simple push-button to jump to the nearest hour would be all the re-syncronisation needed, a longer or other button push would set midnight or some other suitable time when you're awake.

Alternatively you can synchronise to the 50Hz/60Hz mains signal and use that as a fairly accurate timing source over the day.

I2C and SPI real time clocks could also be used but won't have much benefit over the above except for battery backup to survive power-outages and still keep accurate time.

Should all be achievable with a single 08M, no need for another PICAXE.
 

gengis

New Member
Sounds like a foot wound to me

You could just put a photocell outside and turn the light on when it was daylight outside - use that with a small power supply and solid state relay to turn on the light in the tank.

Or move the tank to a window.

Or use an 08M and use the photocell to synchronize to daylight each day and then fine tune the internal clock for 8 hours. I use an unused output pin on my 'axe to drive a quartz analog clock so it times itself.

Just out of curiosity are you just trying to raise reptiles or doing experimentation on their life cycles? I have turtles - they seem as much in tune with the daylight cycle as with the warmth - food consumption and activity goes up with either - but they like light and heat.
 
Top