Delay ON circuit to turn off LEDs

Thread Starter

Kamool

Joined Dec 9, 2018
13
I'm using STM32L432KBU6 to drive AQW214EHAX Solid State Relay to turn some other circuit ON when it is needed for up to 300ms. Circuit I'm using below:
1654328523842.png
I would like to add some kind of safety circuitry that would turn LEDs OFF when MCU_PIN is HIGH for more than 1 second.
Can anyone help me with such circuit? I'm looking for something that won't leak enough current to turn on LEDs.
So far I have figured such circuit:
1654328499155.png
R5, R7, R8 and Q2 will allow for fast capacitor discharge when MCU_PIN will be changed to LOW, if not capacitor will stay charged. I have decided to go with PMOS to drive LEDs, because I have plenty of space on PCB near MCU, but almost none near SSR. Design is based on PNP transistors on low side, I have never used them in such a way, so I'm looking for confirmation it will work, and won't damage anything.
Another thing I'm not sure about is whether I should use unpolarised capacitor like MLCC 0603 or polarized tantalum capacitor like in the rest of my circuit on power lines. Also if I should add some protecting dioded in case of current flowing in wrong direction from capacitor? What are your thoughts?
 

Thread Starter

Kamool

Joined Dec 9, 2018
13
Well, I've seen that in my simulations:
1654335141581.png

But that still seems fast enough for me. What I'm looking to achieve is physical circuit that will disable SSR after some time of MCU_PIN being HIGH. Whether that's after 1s or 1.1s doesn't really matter to me. To make LEDs turn OFF immediatelly I should replace PNP with PMOS? I'm a little bit worried about PMOS (That will replace Q1) overheating due to slow capacitor charging.
Do you see any other simple circuit that would achieve what I need? I'm not talking 555 or other stuff, just simple components due to space constraints.
 

LowQCab

Joined Nov 6, 2012
4,023
This project doesn't seem to make any sense ........
The Programming on your MCU should simply be set to provide no more than a 300ms Pulse.
No external Circuitry should be needed.

The MCU Output can't arbitrarily "get accidentally stuck" in a High-State,
it will always do what it is Programmed to do.

I would put the "safe-guards" into the Programming of the MCU.
This is one of the advantages of using an MCU, instead of an Analog-Circuit.
On the other hand,
depending on what exactly what You are trying to accomplish,
an Analog-Circuit might make more sense than an MCU.
.
.
.
 
Last edited:

Thread Starter

Kamool

Joined Dec 9, 2018
13
This is just a part of bigger project, MCU controls other things as well.
MCU turns on SSR for set time between 40-300ms, then if output is HIGH for set time +20ms additional code kicks in and turns that OFF. I’m just looking for additional layer of protection, when any transient, wrong code or something else will result in MCU being stuck in one place, so it couldn’t turn OFF SSR. Then I would like that circuit to work and disable that.
 

LowQCab

Joined Nov 6, 2012
4,023
The Output Transistors of the Comparitor sag pretty hard at 3.3-Volts.
Look at the Spec-Sheet to see the Graph.
The Outputs are rated for ~20ma, I'm only expecting ~10ma.
.
.
.
 

crutschow

Joined Mar 14, 2008
34,281
Below is the LTspice simulation of a simple circuit that should do what you want:
The N-MOSFET can be just about any logic-level type (max Vgs threshold <2V).
The value of R1 may need to be tweaked to get the desired time.

1654360183368.png
 

LowQCab

Joined Nov 6, 2012
4,023
If the SSRs have enough built-in Hysteresis that Circuit might work OK.
If they don't, it could possibly cause problems from the very slow switching of the FET.

The "exact" amount of Current required by the LEDs in the SSRs is normally not critical.
Most of them have a 3-Volt to 32-Volt Input-Specification with built-in Current-Limiting,
.
.
.
.
.
.
 

Thread Starter

Kamool

Joined Dec 9, 2018
13
Here's what I think is the easiest way to do it ..........
If your SSRs need more than ~10ma of Input-Current,
get the Quad version of the TLC3702
https://www.digikey.com/en/products...DVinIAVAEEAcQBRCvziwoAFBoAlBrri3ocARU80ABNtIA
and then parallel 2 +2 Outputs for ~20ma.
.
.
.
View attachment 268708
Thank you for that, but your circuit is significantly bigger, I'm limited with available space.



Below is the LTspice simulation of a simple circuit that should do what you want:
The N-MOSFET can be just about any logic-level type (max Vgs threshold <2V).
The value of R1 may need to be tweaked to get the desired time.

View attachment 268710
Unfortunatelly it's a no-go for me, because I have no spaca available near SSR, so I cannot squeeze additional NMOS in there - I have mentioned that I have to go with high side driver.



Do you see any way of improving my circuit to switch LEDs instantaneously instead of fading them without adding a lot of components?
 

LowQCab

Joined Nov 6, 2012
4,023
"" Do you see any way of improving my circuit to switch LEDs instantaneously
instead of fading them without adding a lot of components? ""


The short answer is NO.

The MCU, as connected, will do a fine job of quickly switching the SSRs.

Figure out how to write some Code modifications that will do what You want,
then don't worry about it.

What You want is substantial over-kill safety of what ever your Load might be,
( we still don't know what you're controlling ),
and You want it to occupy virtually zero-space.
.
.
.
 

Thread Starter

Kamool

Joined Dec 9, 2018
13
What You want is substantial over-kill safety of what ever your Load might be,
( we still don't know what you're controlling ),
and You want it to occupy virtually zero-space.
It's injecting some additional signal into car throttle signal for crisp downshifts. I would like to add additional safety just in case anything will go wrong, so there will be something that will turn off SSRs.
 

Thread Starter

Kamool

Joined Dec 9, 2018
13
I did not see that mentioned (why does the load need to be grounded?).
I mentioned in first post that I have to go with high side driver, because of space limitations. If it has to be low side driver then I have to add another 3.3v trace near SSR to send power to LEDs, and then trace LEDs low side near MCU, because I've got available space there. When using high side driver I'm just adding via on SSR pins and need only one trace with power.
Thanks for that schematic. How do you feel about changing IRF7404 with AO3401A that is rated lower when it comes to Vgs? Also it comes in SOT23 package that will save me some space.

Can we somehow add "fast-discharging" mechanism to your schematic, that will quickly (<0.1s) discharge capacitor when pin is pulled LOW? I have tried doing that with similar circuit to the one from my schematic, but it doesn't do that. If it will require additional NMOS can we combine that with M1 in one SOT-363 package? If it will be any other thing can you recommend SOT23 NMOS and "that" thing?
 

crutschow

Joined Mar 14, 2008
34,281
I have to go with high side driver, because of space limitations.
Don't understand that. :confused:
The low side driver just requires an extra wire connection, which doesn't require much space, and it saves a MOSFET.
How do you feel about changing IRF7404 with AO3401A that is rated lower when it comes to Vgs?
Yes, that should be fine, as you are operating well below the max Vgs rating.
Can we somehow add "fast-discharging" mechanism to your schematic, that will quickly (<0.1s) discharge capacitor when pin is pulled LOW?
Added a diode to do that (see red trace below):

Question: Does the MCU pin have sufficient output drive capability to provide the current for both opto inputs?

1654445965745.png
 

AnalogKid

Joined Aug 1, 2013
10,986
To reduce strain on the uC output pin, consider putting the two opto input diodes in series. Depending on the device, the diode Vf can be as low as 1.3 V, much less than a typical visible red LED. What is the voltage range for the uC signal?

ak
 

AnalogKid

Joined Aug 1, 2013
10,986
1.08 V per LED - ?

Checked three datasheets, got typical values between 1.18 V and 1.3 V, both lower than I would have guessed. I mucked around in LTS but couldn't find the SPICE parameters

ak
 
Last edited:
Top