Delayed switching of relays - Page 1
Forum section: electronics / beginners

author: Faringdon
author_rank: Super Contributor
timestamp: November 19, 2021, 11:34:49 pm
content: Hi,For this circuit, when the signal goes from 0V to 5V, there should first be a delay of 5 seconds. Then Relay_A must be switched ON for just 3 seconds.Then when the 5V later goes to 0V, there should again be a 5 second delay, and then Relay_B should be switched on for 3 seconds onlyIts achieved by the attached, though can you think of a lesser_component way?(PDF schem and Ltspice sim attached)No microcontroller is allowed...there would not be sufficient quantities required to warrant a microcontroller.

author: Manul
author_rank: Super Contributor
timestamp: November 20, 2021, 12:14:37 am
content: Quote from: Faringdon on November 19, 2021, 11:34:49 pmOh yes, you bet we can. I have never seen such overcomplicated design. What about a monostable (build from two schmitt trigger input nand gates or even just two inverters) with RC delay on the input and mosfet driving the relay on the output?

author: Renate
author_rank: Super Contributor
timestamp: November 20, 2021, 03:01:24 am
content: Are we to make the requirement that the input can't change more than once every 8 seconds?Two half monostables does the job.

author: Martian Tech
author_rank: Regular Contributor
timestamp: November 20, 2021, 03:11:45 am
content: I think the lowliest of low microcontrollers, a PIC10F200 is all you need. Along with a pair of 2N7000 MOSFETs to switch the 12V. And the diodes (D3 and D5) stay.

author: ledtester
author_rank: Super Contributor
timestamp: November 20, 2021, 07:04:04 am
content: Quote from: Faringdon on November 19, 2021, 11:34:49 pmI had to run the LTspice simulation to figure out what this meant. Here's how I would have worded it:QuoteMy initial interpretation was:QuoteThat is, it is an edge triggered event -- once the signal rises from 0 to 5V a 5 second timer is started and when that timer expires the relay is energized for 3 seconds. The signal doesn't have to stay at 5V for any specific length of time for the subsequent events to follow.

author: t1d
author_rank: Super Contributor
timestamp: November 20, 2021, 07:09:27 am
content: Quote from: Martian Tech on November 20, 2021, 03:11:45 amAgreed.Additionally, solid-state relays can be driven directly from the microcontroller pin, because they require extremely little current, to drive them. We drive the SSR for our DIY Reflow Oven directly, with a PIC18F4450. AFAIK, the PICs, and most Arduino-types, output/source 20mA, from each pin, with about 100mA total, for the entire chip. They can sink a little more, 25mA, IIRC. The SSR we are using only requires a maximum of 7mA to drive it.However, this kind of sounds like a school assignment and MCUs may not be allowed... Yep, just reread the original post. FYI, if it is a school assignment, that fact is supposed to be disclosed, upfront, IIRC. Somewhere on the forum there is a list of requirements for posting homework. Just saying...

author: Faringdon
author_rank: Super Contributor
timestamp: November 20, 2021, 11:10:37 am
content: QuoteWell they can actually......but this woudlnt be usual.The 5V input goes high when car ignition is switched ON...low when OFF.The relays, are changeover relays on each connection (go and return) to a motor. The relays are connected to pos of input 12v supply when not coil_powered.Obviously which relay you switch on (contactor to neg of input supply) determines which way the motor spins.When both relays are off, the motor terminals are thus both connected to pos (of input supply), so it wont spin.

author: Renate
author_rank: Super Contributor
timestamp: November 20, 2021, 11:25:20 am
content: I tried to make my circuit as simple and clear as possible, but it will cause a B activation when the main power is turned on.You can either hang the second capacitor "from the ceiling" or add an extra inverter and switch the A & B labels.Since the first delay is longer than the second delay you don't actually get into a lot of difficulties with timing.I hope that motor has limit switches.

author: PKTKS
author_rank: Super Contributor
timestamp: November 20, 2021, 12:43:45 pm
content: Also a SINGLE IC 4060 can do this trick...Just use a frequency which can be counted for all delays..And put a stable XTAL (or cheapo RCs)...The counter has every output needed with even longer delays..Fairly wide used in benchPaul

author: Martian Tech
author_rank: Regular Contributor
timestamp: November 20, 2021, 04:50:39 pm
content: "there would not be sufficient quantities required to warrant a microcontroller."What is that supposed to mean? Is it a cost thing(*) or do you assume that microcontrollers are mask programmed and must be purchased in large quantities or...?(*) An E temperature range (-40C to +125C) PIC10F200 in a DIP-8 package costs $0.76USD in single quantities at Mouser.btw, for anyone confused why I went down this path: the "no microcontroller" restriction was not included in the original post, but edited in later (which I find a bit rude).

author: Nusa
author_rank: Super Contributor
timestamp: November 20, 2021, 05:45:29 pm
content: There are a number of cheap microcontrollers that would do the job AND be cheaper than two 555's (or one 556). Not to mention supporting components. My guess is the OP simply is not willing to deal with even the simplest of software tasks.

author: Renate
author_rank: Super Contributor
timestamp: November 20, 2021, 06:12:29 pm
content: Lol, I had thought that the "no microprocessors" was some requirement on a school assignment. Silly me.I think that the OP needs a bit of a dose of reality and should add up the price of the bill of materials in the first post.Yes, in the 21st century you should only use a microcontroller if the quantity justifies it.Code:Quantity µC justified?-------- -------------1000 yes100 yes10 yes1 yes0 no

author: Capernicus
author_rank: Frequent Contributor
timestamp: November 20, 2021, 06:17:27 pm
content: I love the OP's original circuit, thats the love of electronics design there!

author: Zero999
author_rank: Super Contributor
timestamp: November 20, 2021, 07:31:30 pm
content: To save others from downloading and simulating it, here's the output.I'm curious as to why different methods have been used to implement the delays in triggering and output pulse length.

author: Renate
author_rank: Super Contributor
timestamp: November 20, 2021, 11:50:25 pm
content: Hey, Faringdon? I want to thank you for being a good sport and not being scared off by us.You've got a dozen people all trying to help you. Even when we get a bit snarky at times.Sometimes you ask for something but you're not really addressing what you want.If you had said, "I want something to make my car antenna go up when I turn on the ignition and go down when I shut it off." (Presuming that is what you wanted, or something similar.) We would have all said, "Mmm, maybe a little microprocessor and an H drive with current sense?"

author: Faringdon
author_rank: Super Contributor
timestamp: November 21, 2021, 10:14:11 am
content: QuoteYes the first trigger circuit used a series capacitor, and then the second way used an XOR, with one input delayed. I think ill use the XOR as its less components.I must admit, ill just be honest and say the circuit is for door mirrors.......fold them in when ignition off, and out when ignition back on again. (they keep getting knocked off otherwise)I dont know the full spec.They are currently manually operated with a switch.Im not getting payed for this.Its a powerfold motor, thats all i know...i cant find details on it.I already suggested a micro and they threw it back.But with analog its hard to handle all the exceptions......like someone putting ignition on/off for just 3 seconds etc.They said they didnt want the mirrors to fold out/in only half way.Circuit has to work with whats already in there........so thats a changeover relay at each 'side' of the motor.The "bit of schem" i was shown doesnt show anything else but that.Judging by the name of the car company, they must have solved this themselves by now, but its interesting anyway. (then again maybe not as its low volume) I was actually emailed the task a month back, but only just got to it.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 21, 2021, 10:24:29 am
content: Microcontroller, not only because it's cheaper and smaller, but also because tomorrow the specification changes: can you add one more relay and make it switch after 1.23 seconds +/- 1%, and hey, by the way, we need this shutdown sequence as well...

author: Faringdon
author_rank: Super Contributor
timestamp: November 21, 2021, 10:29:26 am
content: QuoteThanks, but sorry im not with you, AFAIK, the shutdown is that when the ignition turns off, the mirrors fold in , after a 5 second delay.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 21, 2021, 06:05:48 pm
content: I mean, they likely come up with more requirements later. That's usually the case when you have some complex delayed sequence of things.In my reply, I just assumed this is power-up sequencing of supplies, a common requirement in awfully designed systems (sometimes just inevitable despite good design). And then you find out you need another sequence when powering down, which was initially forgotten. And then you need some other logic when entering a sleep state, and so on.This is an FSM, and microcontroller is the most suitable way of implementing FSM. They are called microcontrollers for a reason; they come in a tiny package and control things, just what you need.

author: SL4P
author_rank: Super Contributor
timestamp: November 23, 2021, 10:56:07 am
content: In #15, you suggest they are powerful motors…That doesn’t preclude a $1 microcontroller with $3 worth of external components.Add a $1 pcb and you’re All done.

author: Zero999
author_rank: Super Contributor
timestamp: November 23, 2021, 11:18:11 am
content: Quote from: Faringdon on November 21, 2021, 10:14:11 amDid they say why? Are they avoiding programmable parts for some reason?

author: Refrigerator
author_rank: Super Contributor
timestamp: November 24, 2021, 11:31:34 am
content: I like experimenting with discrete circuits for things like this, here's my take on it (included pic).Timing with RC's is a PITA but you can get it done.TL431 can sink up to 50mA so if your relay resistance is 1k (12mA at 12V) you can drive it directly from the TL431.It's basically just two RC timers with TL431 and an SR latch that gets set by the input rising edge and reset by the relay output rising edge.And the NPN+PNP combo means that you can trigger on either/both rising and falling edges.One problem is that if your pulse time is longer than 8s (5s+3s) then the SR latch will not reset and your relay will stay low until you recycle power.But an RC wave shaper takes care of this.I then just copypasted my circuit from cap2.JPG and changed it around a little to trigger on the falling edge and got the circuit in double.JPG.One circuit is for relay A and the other is for relay B.I'll include my LTspice file but it uses a TL431 model, which doesn't come with LTspice as standard so you can substitute with whatever equivalent model you have.The sim is also messy because that's what happens when i toss my ideas at it.I think this would be the perfect application for a small µC (like Attiny10 or similar).But whatever floats your boat.

author: Renate
author_rank: Super Contributor
timestamp: November 24, 2021, 12:11:53 pm
content: Quote from: Refrigerator on November 24, 2021, 11:31:34 amHuh? Most trips that people take in cars are longer than 8 seconds in duration.