# Trigger mechanisim with time delay??

Status
Not open for further replies.

#### pepsimax007

##### Newbie level 4
how to make a delayed trigger

Hi guys,

Could you please tell me how to make a device that sends three pulses (close circut, then open again) in a sequence with time delay?

So that it sends:
Pulse wire 1
> waits for 5 seconds
Pulse wire 2
> waits for 5 minutes
Pulse wire 3
> done

Please see attached drawing for a better explanation.

#### GSM Man

##### Banned
symbol for time delay relay

This would be very easy to do with a cheap, low-pin count microcontroller. It would require very little code.

Do the outputs need to be 'dry contacts' or can you use a voltage output. If you need contacts you may be able to drive a relay directly, or you may need to drive it using a transistor - depends on the size relay you need.

Microchip has lot's of controllers that you could use http://www.Microchip.com

#### pepsimax007

##### Newbie level 4
Thank you so much for your answer. Do I need a lot of expensive product to be able to program a microchip? I have never used that, but I am a programmer - so the technical part is fine. But could someone guide me in where to buy what I need?

Preferrably they would need to be try contact, if not I could probably just use a relay or something

Thank you SO much!

#### pepsimax007

##### Newbie level 4
Dude! You are a legend!

Last question: Do I program in assembly, or C? or something that is specific for microcontrollers ?
Do you have some code samples , just so I get an idea.
Is it like IF somethen, then blabla ... or push AEX(12) etc?

Thanks

#### GSM Man

##### Banned
As IanP pointed out, products like the PICAXE are easy to program. If you're building only a couple of these then that's a good option. 'C' gives you a lot more flexability but is more difficult to learn. Microchip has a Free IDE (MPLAB), and 'C' compilers that have free student versions.

You'll have to decide what to use based on trade-offs of cost, easy of development, speed, flexability, etc.

#### pepsimax007

##### Newbie level 4
That was definately the way to go. Downloaded the software, and my project is done .. All I need are the parts so I can load it onto the chip.

Final question:
When input 0 = 1, then the sequence starts. A sequence that takes about 4 minutes in total.

Will that sequence re-start if input 0 receives a secondry pulse, in between those four minutes?Or will it run the program from start to end, then after its done ... check to see if it receive a pulse to start up again ?

#### IanP

pepsimax007 said:
Will that sequence re-start if input 0 receives a secondry pulse, in between those four minutes?Or will it run the program from start to end, then after its done ... check to see if it receive a pulse to start up again ?
That depends entirely on how you program the microcontroller to read the inputs ..
It can do (almost) anything you like ..

Rgds,
IanP

#### pepsimax007

##### Newbie level 4
That is true. Here is how my code looks now, does this help you interpret the action now? .... Im just curious, since I've ordered all the parts and hopefully have everything I need for my project.

Code:
symbol varA = b0
symbol varB = b1
symbol varC = b2
symbol varD = b3
symbol varE = b4
symbol varF = b5
symbol varG = b6
symbol varH = b7

main:
low 5
if pin0 = 1 then label_14	'Decision command
high 5
pause 2000	'Wait command
low 5
goto label_88

label_14:	high 0
high 7
pause 500	'Wait command
low 0
low 7
pause 3000	'Wait command
high 1
high 7
pause 500	'Wait command
low 1
low 7
high 6
pause 10000	'Wait command
pause 10000	'Wait command
pause 10000	'Wait command
low 6
high 7
high 1
pause 500	'Wait command
low 7
low 1
pause 1000	'Wait command
high 0
pause 500	'Wait command
low 0
high 7
high 6
pause 200	'Wait command
low 7
low 6
pause 200	'Wait command
high 7
high 6
pause 200	'Wait command
low 7
low 6
pause 200	'Wait command
high 7
high 6
pause 200	'Wait command
low 7
low 6
pause 200	'Wait command
high 7
high 6
pause 2000	'Wait command
low 7
low 6
goto label_88

label_88:	let pins = 0
stop

#### senthilkumar.b

##### Member level 3
Hi,

Really i cannot able to study your program.

First you should configure the microcontroller.

You should assign the I/O port configuration

You should configure ADC if required.

you should initilize your default port status which are assigned as output .

Now you are ready for logic development.

You should provide suitable subroutene for delay otherwise should configure your timer.

if you have doubt about these, welcome with doubt about and expected way of solution.

if you go through this datasheet means, you can get much more idea.

Take care.

Status
Not open for further replies.