Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Time Delay

Status
Not open for further replies.

chandu13

New Member
hi

My application is

12 inputs to the micro controller and 12 outputs drive the 12 relays

Each input is connected to the each relay using 89s51

Here 89s51 monitors the each input and switched on the corresponding relays by using opto couplers.

Now my problem is ,

I have to switch off the relay with in 15 – 30 seconds Irrespective of the input high.
Time should be seated by the user, variable time delay.

Please suggest required hard for this problem

Thanking you

Regards
 
chandu13 said:
hi

My application is

12 inputs to the micro controller and 12 outputs drive the 12 relays

Each input is connected to the each relay using 89s51

Here 89s51 monitors the each input and switched on the corresponding relays by using opto couplers.

Now my problem is ,

I have to switch off the relay with in 15 – 30 seconds Irrespective of the input high.
Time should be seated by the user, variable time delay.

Please suggest required hard for this problem

Thanking you

Regards
hi,
As you want to have a hardware solution, you will require a mono-stable timer for each output, triggered by the 8951 MCU output. Each M/S will require its own delay adjustment potentiometer, the output from the M/S's will drive your relay circuits.

You could use 555/556 timers as the M/S.
 
Eric Gibbs already gave a solution.
In he's method you don't need a micro controller too.

after switch ON the first relay it should OFF after 15-30 Mins.

Then do you want to monitor the other relays also in this time period?(the relay one is already ON)

Is it interrupts possible for this case?
 
delay

Thanks for the replays

Iam using 89S51 controller, ILQ74 opto coupler and 5v relays. I have connected 12 inputs to the microcontrolar.
I have to monitor 12 inputs and switch on corresponding relay to the input.

When micro controller gives the high signal for corresponding input I have to switch ON the relay using Opto coupler.

Can I give same signal to the 555 timer for trigger?

I have to switch off the relay with in 15-30 seconds while Input is ON.

How to switch off the relay while input is ON ,Microcontroller output
is HIGH and Opto coupler is ON.

Regards

chandu
 
delay

Thanks for the replies

Iam using 89S51 controller, ILQ74 opto coupler and 5v relays. I have connected 12 inputs to the microcontrolar.
I have to monitor 12 inputs and switch on corresponding relay to the input.

When micro controller gives the high signal for corresponding input I have to switch ON the relay using Opto coupler.

Can I give same signal to the 555 timer for trigger?

I have to switch off the relay with in 15-30 seconds while Input is ON.

How to switch off the relay while input is ON ,Microcontroller output
is HIGH and Opto coupler is ON.

Regards

chandu
 
chandu13 said:
Thanks for the replies

Iam using 89S51 controller, ILQ74 opto coupler and 5v relays. I have connected 12 inputs to the microcontrolar.
I have to monitor 12 inputs and switch on corresponding relay to the input.

When micro controller gives the high signal for corresponding input I have to switch ON the relay using Opto coupler.

Can I give same signal to the 555 timer for trigger?
Yes, the Monostable timer would be triggered instead of the relay, the M/S output would trigger the relay.

I have to switch off the relay with in 15-30 seconds while Input is ON.
How to switch off the relay while input is ON ,Microcontroller output
is HIGH and Opto coupler is ON.
The monostable when it times out, after the initial trigger will switch off the relay.

Regards

chandu

Post a section of the MCU--- OPTO--- Relay circuit so we can see how its connected. Just one output is OK.
 
delay

Here initially I have to switch ON the relay and same signal
Will Apply to the timer for trigger. After 15-30 seconds relay should off while output signal ON.

How to switch off the relay while input is ON, Micro controller output
is HIGH and Opto coupler is ON.

With in soon I will send my circuit.

regards

chandu
 
chandu13 said:
Here initially I have to switch ON the relay and same signal
Will Apply to the timer for trigger. After 15-30 seconds relay should off while output signal ON.

How to switch off the relay while input is ON, Micro controller output
is HIGH and Opto coupler is ON.

With in soon I will send my circuit.

regards

chandu

This is what I mean. ref pix.
 
Last edited:
Eric,

With the circuit you posted, can't you just replace the MC with the push button. Maybe use an RC debounce circuit.

Mike.
 
After 15-30 seconds, and the relay is turned off (should have used copy/paste), how long before the relay is retriggered by the input? What kind of input signal are you using?
 
Pommie said:
Eric,

With the circuit you posted, can't you just replace the MC with the push button. Maybe use an RC debounce circuit.

Mike.

G'Day Mike,
From what I can see from the OP's 1st post he's using a MCU to detect 12 input lines then drive a relay based on his program. Why I do not know!.

For some reason he wants to output a high..........high?
And the relay to switch ON for 20-30sec at the leading edge of the high,then OFF, with output still set high??

The cct will do this,BUT if he told us the full project story, there MUST be a better way.

Regards
 
I read it as 12 inputs drive 12 outputs. When one input goes high the coresponding relay should switch on for a set time irrespective of how the input is.

You obviously interpreted the OP's "Irrespective of the input high" to mean input to the opto coupler, I read it as input to the uC.

As you state, if he told us a bit more then there will be a better way.

Mike.
 
Pommie said:
I read it as 12 inputs drive 12 outputs. When one input goes high the coresponding relay should switch on for a set time irrespective of how the input is.
That's also how I understood it.
µC input x1 high = output µC x1 high after 15 to 30 sec (set by user) output µC x1 low and that 12 times (x1 to x12)

The optocoupler is only for isolation between µC and relays.

Pommie said:
As you state, if he told us a bit more then there will be a better way.

Mike.
Absolutely better way is no external HW at all; all code in the µC


@chandu13
Flow in main routine
1) Set timer 0 for a 10ms interrupt
2) Declare twelve 16bit counters in RAM (2 bytes per counter)
3) Declare twelve bits in bit addressable RAM
4) Initialize all counters to specific value (20sec = 2000; 15sec = 1500)
5) Input x1 high? Yes: set output x1, set bit x1
6) Input x2 high? Yes: set output x2, set bit x2
... and so on for all twelve inputs
7) go back to step 5


Flow in ISR T0
0) reload T0
1) bit X1 high?
1a) Yes: decrement counter x1
1b) Is counter x1 = 0? Yes: reset output x1, reset bit x1 and reload counter x1
2) bit X2 high?
2a) Yes: decrement counter x2
2b) Is counter x2 = 0? Yes: reset output x2, reset bit x2 and reload counter x2
...and so on for all twelve counters


If time presets for relays are always the same (but different over all relays), use hard coded values for preset counters x1 to x12
If they always change, use PC to edit them and serial E²PROM to store them.

Understood?
Yes: go on with it :)
No: ask :)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top