Delay/Duration Timer

fritz42_male

Senior Member
Hi all,

I've built a little delay/duration timer based on an 08m. The setup reads 2 10K linear pots and then assigns a duration and delay based on those 2 values. I'm currently switching on an LED but will be hooking it up to an SSR (3-32V input, 250VAC 4A output). Everything is working fine but...

2 questions:

1) Can the 08M adequately drive BOTH an LED AND an SSR or will it drive only the one (without a darlington/transistor booster). I do not have the full spec for the relay other than it is an SMT 2000/4 made by Huntleigh Technology, Cardiff, UK.

2) As it stands, my program (see below) monitors the 2 pots at the start of the routine but not during. This is fine for shorter periods but when using longer periods, it gets tedious waiting to see how long it goes for (for calibrating the pot scale). Is there an easy way of monitoring the pots DURING the delay/duration cycle and shortening/lengthening the delay and duration DURING the sequence if the pots are altered?

symbol delay=1
symbol duration=2

begin:
debug
readadc delay,b1
readadc duration,b4
high 4
for b2 = 1 to b1
pause 100
next b2

low 4
for b3=1 to b4
pause 100
next b3

goto begin


My programming days are decades behind me and I was never much good so any help would be appreciated.

Cheers

Mike
 

inglewoodpete

Senior Member
My programming days are decades behind me and I was never much good so any help would be appreciated.
Surely asking for help on this forum means you have more programming days ahead of you:)

It would be best to connect the SSR via a FET of biploar. They can pull currents greater than 25mA, which is the limit for a typical PICAXE output.

If you have enough pins, use a different one for the LED, with a 330ohm to 1kohm series resistor.

Change your delay loops to something like the following to constantly read the ADC value during the high or low delay period:

Code:
For b2 = 1 To 100
    ReadADC 1, b1
    Pause b1
Next b2
 

hippy

Ex-Staff (retired)
For 'dynamic control' of delay and duration I'd use ...

b2 = 0
Do
ReadAdc delay, b1
Pause 100
b2 = b2 + 1
Loop Until b2 >= b1

b3 = 0
Do
ReadAdc duration, b4
Pause 100
b3 = b3 + 1
Loop Until b3 >= b4
 

fritz42_male

Senior Member
Surely asking for help on this forum means you have more programming days ahead of you:)

It would be best to connect the SSR via a FET of biploar. They can pull currents greater than 25mA, which is the limit for a typical PICAXE output.

If you have enough pins, use a different one for the LED, with a 330ohm to 1kohm series resistor.

Change your delay loops to something like the following to constantly read the ADC value during the high or low delay period:

Code:
For b2 = 1 To 100
    ReadADC 1, b1
    Pause b1
Next b2
Thanks IP. I'm hoping that the SSR will pull minimal current. Yes I have a spare pin but what is the total current an 08M can supply? Does anyone know what the opto in a typical SSR pulls? I can do without the LED if I have to.

I've based the board on the 08M protoboard which I built as a 3/4 servo controller so I already have 330ohm res's on all the outputs - and all the outputs are on 3 pin headers in a servo arrangement - makes life simple. Adding a FET or tranny would destroy the simplicity! lol. If I need the extra current, I'll use one of my spare 14M/darlington boards.

As for the programming - probably right. I just picked up a 20X2 the other day to add to my stock of 08M, 14M and 28X1 chips. Yes, I have a lot more ahead of me.
 

fritz42_male

Senior Member
For 'dynamic control' of delay and duration I'd use ...

b2 = 0
Do
ReadAdc delay, b1
Pause 100
b2 = b2 + 1
Loop Until b2 >= b1

b3 = 0
Do
ReadAdc duration, b4
Pause 100
b3 = b3 + 1
Loop Until b3 >= b4
Ahhh. Hippy to the rescue again! Thanks very much. I'll try it out.
 

inglewoodpete

Senior Member
Specifications, specifications

For voltage and current limitations of the PICAXE, refer to Manual 1 (Getting Started) Page 7 "At a Glance: Specifications"

You need to research the SSR you have. It could be an AC type (Triac based) or DC (FET based). This will tell you the input characteristics: usually optoisolated, I believe.
 

fritz42_male

Senior Member
Thanks Pete.

Spec says 20mA per output up to 90mA max. LED consumes 20ma (approx) and SSR (Triac based) consumes approx 15mA so I should be fine.

(I shouldn't be so lazy and should do some reasearch first)

Thanks for the help!
 

inglewoodpete

Senior Member
For the LED, you can drop the current to 10mA with very little reduction in light output. Depends on how bright it needs to be.
 

fritz42_male

Senior Member
Well it's working an absolute treat. Got the LED on 0, the SSR on 4 and the 2 pots on 1 & 2 - even leaves me 3 for an optional trigger!

I had to bypass the 330 ohm resistors on my 'universal' board for the SSR to fire but other than that no problem.

Thanks hippy & pete for all the help.
 
Top