Hi ghp,
thanks for the replies. Its really helping me a lot.
The input stage:
- The LED LXHL-BW2 is usually operated at 350mA. With a resistor of 100 Ohm it will run at 15mA. The input side of the optocoupler is using 1120 Ohm in total, so prox 20mA@24V are flowing there. Current transfer ratio of optocoupler is quite high, although uncharted for 20mA in diagram Fig.6 Current Transfer Ratio vs. Forward Current. But could work. I would replace this LED by a superbright red, green LED (e.g. HLMP-4740) And run this LED at 1mA or perhaps 5mA.
If you really want to illuminate a room, then add another 24V output stage and drive the LED LXHL-BW2 from this. GPIO in--> program --> another GPIO out->output stage.
- The two resistors 560 Ohm on the input can be combined into one of 1k1.
- the resistor R4, 10k is not needed if you run a LED-R-combi in parallel.
This LED in circuit is just only for simulation, but on my PCB I will be using this component(https://www.digikey.in/en/products/deta ... 90/3084288) as an DIO indicator.
The two resistors 560 Ohm on the input can be combined into one of 1k1., done...
the resistor R4, 10k is not needed if you run a LED-R-combi in parallel.
previously I tried same schematic with npn configuration, the LED were not glowing. Also the emitter output has to be given as input to RPi GPIO pin and also it has to be indicated in LED indicator.
For the output stage:
- Replace R3 by a wire. these 100Ohm would not bring any benefit.
- Make R2 2k2 (not 10k) This gives a current of prox 6mA when on, 0mA when off. Gate voltage is then prox 12V, max gate voltage is 20 -> good.
A lower R2 also brings the charge on the gate faster to zero, reducing thermal heat on this transistor if you switch often.
- The connection from drain---1N4007 is drawn with a connection to GND, (would not work as this 'shortcuts' the transistor). This wire to the right is the other out-pin.
And keep in mind that in spice there is only one ground reference point. When you construct your board in a schematics editor like kicad, then the RPI-GND and 24V-GND are not connected (which is good).
I updated the circuit but still no change when logic is 0, still the output is 24V, attached the schematic
thanks for the replies. Its really helping me a lot.
The input stage:
- The LED LXHL-BW2 is usually operated at 350mA. With a resistor of 100 Ohm it will run at 15mA. The input side of the optocoupler is using 1120 Ohm in total, so prox 20mA@24V are flowing there. Current transfer ratio of optocoupler is quite high, although uncharted for 20mA in diagram Fig.6 Current Transfer Ratio vs. Forward Current. But could work. I would replace this LED by a superbright red, green LED (e.g. HLMP-4740) And run this LED at 1mA or perhaps 5mA.
If you really want to illuminate a room, then add another 24V output stage and drive the LED LXHL-BW2 from this. GPIO in--> program --> another GPIO out->output stage.
- The two resistors 560 Ohm on the input can be combined into one of 1k1.
- the resistor R4, 10k is not needed if you run a LED-R-combi in parallel.
This LED in circuit is just only for simulation, but on my PCB I will be using this component(https://www.digikey.in/en/products/deta ... 90/3084288) as an DIO indicator.
The two resistors 560 Ohm on the input can be combined into one of 1k1., done...
the resistor R4, 10k is not needed if you run a LED-R-combi in parallel.
previously I tried same schematic with npn configuration, the LED were not glowing. Also the emitter output has to be given as input to RPi GPIO pin and also it has to be indicated in LED indicator.
For the output stage:
- Replace R3 by a wire. these 100Ohm would not bring any benefit.
- Make R2 2k2 (not 10k) This gives a current of prox 6mA when on, 0mA when off. Gate voltage is then prox 12V, max gate voltage is 20 -> good.
A lower R2 also brings the charge on the gate faster to zero, reducing thermal heat on this transistor if you switch often.
- The connection from drain---1N4007 is drawn with a connection to GND, (would not work as this 'shortcuts' the transistor). This wire to the right is the other out-pin.
And keep in mind that in spice there is only one ground reference point. When you construct your board in a schematics editor like kicad, then the RPI-GND and 24V-GND are not connected (which is good).
I updated the circuit but still no change when logic is 0, still the output is 24V, attached the schematic
Statistics: Posted by smarty — Fri May 10, 2024 4:44 am