OPTOcoupler and CD4030 XOR - Not working as planned

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
Hi all,

I have a circuit that @crutschow helped me with in 2016. I have 6 Fog Lights on my car and I wanted the outer Left/Right Foglamps to mimic Turn signals. See old post ..
https://forum.allaboutcircuits.com/threads/convert-this-circuit-to-mosfets.126731/page-3

The mosfets were working, but getting hot. So I wanted to add 2 more Mosfets (one Mosfet per 55W 12V Bulb) and have a Optocoupler (PC814/EL814) trigger the circuit. It works, kinda. See Circuit below

1637016259390.png

With the newer OPTO trigger circuit, the Mosfets turn on and my Foglamps work. But only D1 Main status LEDs work. D3 and D4 do NOT work. I even swapped out the limiting resistors (R9 & R11) to 100ohms. Nothing. So I thought that OPTO was too weak and shorted out the (E and C) of the OPTO. Now the D3&D4 status LEDs are on. However, when 12V is applied to the (Right turn / Left Turn) inputs terminal of P2. The Q5 and Q6 do NOT shut-off. All 6 Mosfets remain on.

I did use Proteus to Simulate the circuit and it worked fine. Just not in real life ... Any guidance would be much appreciated.

Thank you,
TONY
 

crutschow

Joined Mar 14, 2008
34,280
You need to also look at data sheets.
The simulator will not tell you when you are abusing the circuit and using it beyond its ratings.
Look at the current rating for the CD4030 output below;
1637026170223.png
At best it's only good for a few mA.
Loading it with a 100Ω load may have zapped it and shorted the output.
 

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
I see four inputs and 6 lamp outputs.
How about providing an explanation of how the the circuit supposed to work?
Thanks for the response.

I presume you are referring to P2 Headers as inputs. If so ...
  1. While TRIGGER is active, all 6 Lamps are on.
  2. While TRIGGER is active and 12V applied to either R.TURN/L.TURN input. The associated R.TURN/L.TURN Lamp will turn off. Because the 12V is coming from the vehicle, through a Flasher. The 12V is intermitted causing the R.TURN/L.TURN Outer Fog Lamps to simulate a turning signal. The 4 center Fog Lamps remain ON. 12V to the R.TURN/L.TURN inputs does NOT affect them.
  3. With TRIGGER inactive and 12v applied to the R.TURN/L.TURN inputs. The R.TURN/L.TURN Fog Lamps will turn ON. Again, has the 12V is intermitted after going through the vehicle Flasher. It causes the R.TURN/L.TURN Outer Fog Lamps to simulate a turning signal.
  4. The GND OUT is a feedback output. It illuminates an LED on my dash to till when the foglamp circuit is active.


TONY
 

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
You need to also look at data sheets.
The simulator will not tell you when you are abusing the circuit and using it beyond its ratings.
Look at the current rating for the CD4030 output below;
View attachment 252782
At best it's only good for a few mA.
Loading it with a 100Ω load may have zapped it and shorted the output.
Thanks for the response.

When you say 100ohm load. Are you referring to the (R9 & R11) resistor I temporarily swapped out for testing?

The original 2016 circuit worked. See Photo Below ...

1637029342381.png

With this updated OPTO circuit I posted above. I did add two more MOSFETs (in comparison to the original design) for the CD4030 to turn on. Is it possible these additional MOSFETs are to much for the CD4030 to turn on, plus the D3&D4 status LEDs?

TONY
 
CD4030 XOR in one schematic yet 2016 CD4071 OR in the sim. :confused:The OR gate makes sense, not sure about XOR though. D2 is backwards in the one schematic as well.

Shorting out the opto C-E must have damaged something- although it shouldn't have unless you slipped.

R4 at 51k is pretty big and the four mosfets will be sluggish switching off. IPP120P04-04 is almost 15nF gate capacitance each for ~90nF.
R4 should also not include fuse F1, if it blows nothing can keep the other mosfets off.
I would drive the opto LED harder R3 around 2k ohm so R4 can be around 10x smaller at 4.7k say.

I would do the circuit differently, include some transient protection. But first see if the XOR gate is what you want.
 

eetech00

Joined Jun 8, 2013
3,858
Thanks for the response.

I presume you are referring to P2 Headers as inputs. If so ...
  1. While TRIGGER is active, all 6 Lamps are on.
  2. While TRIGGER is active and 12V applied to either R.TURN/L.TURN input. The associated R.TURN/L.TURN Lamp will turn off. Because the 12V is coming from the vehicle, through a Flasher. The 12V is intermitted causing the R.TURN/L.TURN Outer Fog Lamps to simulate a turning signal. The 4 center Fog Lamps remain ON. 12V to the R.TURN/L.TURN inputs does NOT affect them.
  3. With TRIGGER inactive and 12v applied to the R.TURN/L.TURN inputs. The R.TURN/L.TURN Fog Lamps will turn ON. Again, has the 12V is intermitted after going through the vehicle Flasher. It causes the R.TURN/L.TURN Outer Fog Lamps to simulate a turning signal.
  4. The GND OUT is a feedback output. It illuminates an LED on my dash to till when the foglamp circuit is active.


TONY
Does the following truth table look correct?

1637083284749.png

1=Active or On
0=Inactive or Off
F=Flashing
S=Steady On
X=Don't care or "Ignore"

State 6=Emergency Flash
 
Last edited:

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
What was the reason for adding the opto coupler?
2 reasons .. To simplify the circuit and allow for Gnd or 12v to trigger the circuit by moving jumper at J1 header.

Right now I am utilizing a 12V signal to a Vehicle factory switch to turn on the circuit. But I am trying to develop a whole CPU that will have 0V output to trigger the circuit. So the J1 jumper is a quick and simple solution.

TONY
 

eetech00

Joined Jun 8, 2013
3,858
2 reasons .. To simplify the circuit and allow for Gnd or 12v to trigger the circuit by moving jumper at J1 header.

Right now I am utilizing a 12V signal to a Vehicle factory switch to turn on the circuit. But I am trying to develop a whole CPU that will have 0V output to trigger the circuit. So the J1 jumper is a quick and simple solution.
But the PC814 opto is an AC optocoupler. It should be a PC817.
You should also lower the limiting resistor value so that about 10mA flows thru the opto LED. Maybe change value to 1k.
 
Last edited:

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
Does the following truth table look correct?

View attachment 252824

1=Active or On
0=Inactive or Off
F=Flashing
S=Steady On
X=Don't care or "Ignore"

State 6=Emergency Flash
Yes. The "Flashing" is done by the vehicle, not internal to the circuit. It is either a HIGH (12VDC) or a LOW (0V) at the inputs. So I updated the Truth Table to reflect the just HIGH (1) or LOW (0) status.
1637086018183.png

TONY
 
Last edited:

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
But the PC814 opto is an AC optocoupler. It should be a PC817.
You should also lower the limiting resistor value so that about 10mA flows thru the opto LED. Maybe change value to 1k.
The PC814 works good for me as a Bi-Directional OPTO coupler with 12VDC. Bi-Direction is needed to allow GND or 12V to trigger the circuit by moving the J1 jumper. Once I complete my CPU to trigger it. ... The PC817 does not. :(

Tony
 

eetech00

Joined Jun 8, 2013
3,858
Yes. The "Flashing" is done by the vehicle, not internal to the circuit. It is either a HIGH (12VDC) or a LOW (0V) at the inputs. So I updated the Truth Table to reflect the just HIGH (1) or LOW (0) status.
Sorry. I don't understand what you mean.
Does the ground side of the bulbs go to a flasher?
Or do you mean the LTURN or RTURN electrical signal alternately changes ON/OFF when flashing?

otherwise, how do the lamps flash?
 

eetech00

Joined Jun 8, 2013
3,858
Sorry. I don't understand what you mean.
Does the ground side of the bulbs go to a flasher?
Or do you mean the LTURN or RTURN electrical signal alternately changes ON/OFF when flashing?

otherwise, how do the lamps flash?
Ok. So I went back and reviewed the previous thread.

When you say "Flashing is done by the vehicle", you mean the LTurn and/or RTurn signal inputs continuously alternate between 0v and 12v causing the lamp(s) to flash.

That is what I meant in my original post showing the truth table. I should have changed the LT and RT columns "1" value to "F" to indicate an alternating signal input. Does this look correct now?
The "OUTPUTS" represent the state of the LAMPS.

1637088755885.png
 

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
When you say "Flashing is done by the vehicle", you mean the LTurn and/or RTurn signal inputs continuously alternate between 0v and 12v causing the lamp(s) to flash.
Correct. When the Turn signal lever is engaged. 12VDC is sent through a FLASHER that causes the 12V to alternate state. High/Low.

That is what I meant in my original post showing the truth table. I should have changed the LT and RT columns "1" value to "F" to indicate an alternating signal input. Does this look correct now?
The "OUTPUTS" represent the state of the LAMPS.
Yes it does.
 

eetech00

Joined Jun 8, 2013
3,858
Hi all,

I have a circuit that @crutschow helped me with in 2016. I have 6 Fog Lights on my car and I wanted the outer Left/Right Foglamps to mimic Turn signals. See old post ..
https://forum.allaboutcircuits.com/threads/convert-this-circuit-to-mosfets.126731/page-3

The mosfets were working, but getting hot. So I wanted to add 2 more Mosfets (one Mosfet per 55W 12V Bulb) and have a Optocoupler (PC814/EL814) trigger the circuit. It works, kinda. See Circuit below

View attachment 252775

With the newer OPTO trigger circuit, the Mosfets turn on and my Foglamps work. But only D1 Main status LEDs work. D3 and D4 do NOT work. I even swapped out the limiting resistors (R9 & R11) to 100ohms. Nothing. So I thought that OPTO was too weak and shorted out the (E and C) of the OPTO. Now the D3&D4 status LEDs are on. However, when 12V is applied to the (Right turn / Left Turn) inputs terminal of P2. The Q5 and Q6 do NOT shut-off. All 6 Mosfets remain on.

I did use Proteus to Simulate the circuit and it worked fine. Just not in real life ... Any guidance would be much appreciated.

Thank you,
TONY
Suggestion...

When commenting on signals, typing "when 12v is applied to the Right turn / Left turn" is somewhat confusing.
What does that mean? 12v to both inputs, or one, or the other. It would help if it was more specific.

Do you have a multimeter?

Start by removing the CD4030 from its socket and begin checking voltages at the gate of each mosfet.
Report back along with the status each lamp.

BTW-
I noticed on your current circuit that if the trigger is not active and an emergency flash is initiated, the left and right lamps won't flash because the inputs to both XOR gates are already pulled high.
 

Thread Starter

stillgrowingup

Joined Jul 15, 2015
210
Hello All,
I wanted to let yo good people know that I will respond and I am thankful for your help. I had some one close fall ill and die and I am currently helping the family. I hope to continue this after the Thanksgiving holiday.

TONY
 
Top