Delay ON circuit to turn off LEDs

Thread Starter

Kamool

Joined Dec 9, 2018
18
I'm using STM32L432KBU6 MCU, datasheed states that each pin can source 20mA, then it's plenty enough. I'm connecting LEDs in parallel instead of series to make them turn on at the same time. If I understand it wrong, and they will turn on at the same time connected in series then I'll do that, just correct me.

When it comes to added diode - I see the same results with or without it, I don't understand why...

That about 1.1V for each LED.
 

crutschow

Joined Mar 14, 2008
38,555
they will turn on at the same time connected in series then I'll do that, just correct me.
Since the current has to go through both at the same time a series connection is just as fast as a parallel connection.
When it comes to added diode - I see the same results with or without it, I don't understand why...
Me either.
Are you referring to my circuit?
Is the diode connected exactly as I show in the simulation.?
 

Thread Starter

Kamool

Joined Dec 9, 2018
18
Since the current has to go through both at the same time a series connection is just as fast as a parallel connection.
Me either.
Are you referring to my circuit?
Is the diode connected exactly as I show in the simulation.?
Then I should connect them in series?

yes, it’s connected exactly the same and after some quick pin highs it’s turning leds for less time than set by capcitor and resistor.
 

djsfantasi

Joined Apr 11, 2010
9,237
If you put the two opto LEDs in series, you’ll need one 180Ω resistor in series with both. No 270Ω resistors should be used.
 

AnalogKid

Joined Aug 1, 2013
12,173
I'm using STM32L432KBU6 MCU, datasheed states that each pin can source 20mA,
20 mA is plenty, but my question was about the output *voltage*. Also, whatever that voltage is will sag downward with increasing load current. This is another reason to put the two inputs in series.

ak
 
Last edited:

Thread Starter

Kamool

Joined Dec 9, 2018
18
Me either.
Are you referring to my circuit?
Is the diode connected exactly as I show in the simulation.?
I have moved to LTspice and now it looks fine. Thanks for that!
I have added R6 additionaly to simulate MCU pull down resistor and R5 to keep LEDs side down, just for safety.
PWL for input voltage to simulate quick inputs:
1654507028411.png

Simulation with D1:
1654507048705.png


Simulation without D1:
1654507085196.png


20 mA is plenty, but my question was about the output *voltage*.
Sorry, read that wrong. I cannot find informations about voltage output ranged of MCU pins, only input voltage.

So, question number one is how much current do the output transistors meed to source/sink?
One end of SSR is tied to 5V through 1k resistor, the other into cars APS that has another 2k resistor before ECU pin, so that's like 1,6mA. It seems that basically * any* current that will turn ON LEDs is sufficient.


Right now I'm thinking about going with crutschows first suggestion with driving low side as it will really add only one trace and cut some components. I just have to go back to my PCB design to check where I can route that track. One thing that looks better with PMOS solution is cutting power almost immediatelly, with NMOS solution it gradualy dimms.
Also as you say that connecting LEDs in series won't cause troubles there I'll probably go that route.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,173
Also as you say that connecting LEDs in series won't cause troubles
Electrical troubles and operational troubles are not the same thing.

1. If it is important that both controlled functions come and go together, then putting the two opto inputs in series assures that if one input LED fails, the other output does not come on.

2. If it is important that each output come on no matter what is going on with the other one, then the parallel arrangement is better.

But wait - there's more. On the opto datasheet, the maximum LED dropout (turn off) voltage is 1.5 V. This means that the series arrangement needs a minimum of 3.0 V across the two LEDs to guarantee turn-on. With a 3.3 V rail in an automotive environment (with terrible power quality), that is not much operating headroom.

Note that in the series arrangement, the current limiting resistor must be less than 100 ohms.

Any particular reason why you are using such a high voltage part? With the 212, the output resistance would be over 10x less.

ak
 
Last edited:

Thread Starter

Kamool

Joined Dec 9, 2018
18
OK, let's try this again.

What is the power supply voltage for the MCU?

ak
That's 3.3V. I was looking in datasheed for information about min. I/O pin output voltage (I remember seeing 0.96*Vin somewhere)

Electrical troubles and operational troubles are not the same thing.

1. If it is important that both controlled functions come and go together, then putting the two opto inputs in series assures that if one input LED fails, the other output does not come on.

2. If it is important that each output come on no matter what is going on with the other one, then the parallel arrangement is better.

But wait - there's more. On the opto datasheet, the maximum LED dropout (turn off) voltage is 1.5 V. This means that the series arrangement needs a minimum of 3.0 V across the two LEDs to guarantee turn-on. With a 3.3 V rail in an automotive environment (with terrible power quality), that is not much operating headroom.

Note that in the series arrangement, the current limiting resistor must be less than 100 ohms.

Any particular reason why you are using such a high voltage part? With the 212, the output resistance would be over 10x less.

ak
The most important thing is to turn them on at the same time, later if one fail then second one should fail as well, then I'll go with series connection.
Yes, I've seen maximum 1.5V stated by table, but chart shows it shouldn't really reach that. With 100Ohm resistor in series connection and 1.5V voltage drop across each LED it would result in only 3mA, what mich be not enough as datasheet recommends 5-10mA.

I went with 214, because it was available in PCB manufacturer stocks upon ordering first batch of PCBs, it is working great since then, so I haven't changed that. Also 214 is a bit faster when it comes to turn on time.
Right now I don't understanc 8-3 chart. Why voltage on X axis goes only up to 1V instead of 5V/6V like in other versions?
 

crutschow

Joined Mar 14, 2008
38,555
One thing that looks better with PMOS solution is cutting power almost immediatelly, with NMOS solution it gradualy dimms.
My simulation of the single NMOS circuit shows it shuts off in <6ms, with the opto output shutting off in about a microsecond (with a 1kΩ load), which I think would be fast enough for your application.
 

eetech00

Joined Jun 8, 2013
4,709
Here is a general AQW212 simulation.
I delayed the signal input so it would be easier to see.

(the grounds are the same for sim purposes only)

1654542659889.png
 

Thread Starter

Kamool

Joined Dec 9, 2018
18
My simulation of the single NMOS circuit shows it shuts off in <6ms, with the opto output shutting off in about a microsecond (with a 1kΩ load), which I think would be fast enough for your application.
I will check timing again tomorrow. I might have had error in schematic.
Here is a general AQW212 simulation.
I delayed the signal input so it would be easier to see.

(the grounds are the same for sim purposes only)
Where did you get AQW212 ltspice model? I think I’ll go with 130-150ohm resistor, it’ll still draw less current than my first solution.
 

eetech00

Joined Jun 8, 2013
4,709
I will check timing again tomorrow. I might have had error in schematic.

Where did you get AQW212 ltspice model?
I made the model using the AQW21x datasheet.

I think I’ll go with 130-150ohm resistor, it’ll still draw less current than my first solution.
Whatever your design requires. The opto inputs can operate with 5mA series current (although it can operate at higher current if you want). But if you compute the Vf/If input requirements @ 5mA (staying somewhat above 3mA max variance), the input series limiting resistor is going to be significantly higher than 150 ohms.
 

Thread Starter

Kamool

Joined Dec 9, 2018
18
My simulation of the single NMOS circuit shows it shuts off in <6ms, with the opto output shutting off in about a microsecond (with a 1kΩ load), which I think would be fast enough for your application.
That's the difference I've got:
1654588666200.png

It looks huge to me, but NMOS solution introduces only one mosfet that could potentially fail instead of two, then it might be better solution. I will just increase R4 value to increase working time and it should be good. I hope this circuit will never activate, but it will be there, so gradual drop won't be an issue. Do you think that AO3400A will be good mosfet for that?
 
Last edited:

crutschow

Joined Mar 14, 2008
38,555
That's the difference I've got:
---------------
It looks huge to me,
What difference are you referring to?
You seem to be referring to the difference in time at which the delay shuts the output off but that should be of no consequence as long as it's less than a second (according to your first post).

I was referring to the fall-time (time from high to low), which I thought was the time of concern.
 
Top