Level translator for led matrix
From the question and the comments:


  [Question] I want to replace the leds with higher voltage and current, 24V 50mA for example.


LEDs have a forward voltage of about 3.5 V max. What you have is something other than an LED. A string of LEDs, perhaps, with a built-in current limiting resistor? Details are important.


  [Comment (3)] There is no datasheet, they are single leds. 24V leds work at both directions.


Again, they are more than LEDs and you seem to be saying that they are, in fact, AC or bidirectional lamps. Again there is no clue to this in the original question or the schematic.


  [Question] There is a problem in my level translator that allows a current flow through output stage when the input is 0V. I assume this happens because the PNP does not turn off completely. The amount of current is about 20mA at 24V.








simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. OP's level-shifter with base current flow marked up.

Without R3 current will flow through the base of Q1, R1, R2 and the base of Q2 and both will turn on. R3 just makes the situation a little more complex. You will probably find that there is a lot more than 20 mA flowing through Q1 and Q2's collector circuit as a result. With the load connected OUT settles down somewhere between 0 and 24 V and that is what is causing the problem.


  [Comment (2)] Also, I wouldn't like to change the software, that's why I came up with push-pull solution. 




Figure 2. Sneak-paths through bi-directional LEDs shown in blue. Source: LEDnique - multiplexed display.

I suspect that your need to use a push-pull solution is to hold the lines at a defined voltage to prevent sneak-paths through the other rows and columns lighting up the other LEDs. This is only a problem because the "LEDs" are bidirectional.


  [Comment (4)] I can't save the sheet because a membership is required.


No membership is required when you use the CircuitLab button on the editor toolbar. EE.SE has a deal with CircuitLab.







simulate this circuit

Figure 3. A get-you-started level-shifter.

I haven't ever had to do this but you can run the CircuitLab simulator on this and see how you get on. How it works:


Q1 is a regular NPN low side switch. When GPIO goes high Q1 turns on and pulls the output low.
Q2 is wired in common-base mode. When GPIO goes low Q2 will conduct drawing bias from Q3 and turning it on. The output will be pulled high.
R3 limits the current drawn from Q3. I've positioned it in the emitter leg to minimise the likelihood of shoot-through Q3 and Q1 when the GPIO transitions from low to high. The simulation shows that it still does and that output current from Q3 more than doubles.


Hopefully someone will critique my circuit and give you some better guidance.