0
\$\begingroup\$

What is the best way to make a level translator for a led matrix? I have an mcu port 3,3V 5mA and I want to replace the leds with higher voltage and current, 24V 50mA for example

This is my led array

schematic

simulate this circuit – Schematic created using CircuitLab

and this is a push-pull level translator I made. 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.

schematic

simulate this circuit

I would like to be able to choose what kind of LED I use in my matrix. I want circuit to be flexible to choose whatever voltage and current, of course between some limits.

Improved circuit:

schematic

Alternative suggestion:

schematic

simulate this circuit

I decided to go with first Transistor's suggestion. First, let me show you how the software control the led matrix. enter image description here

When a row is pulled high, the corresponding column is pulled low and the other column are pulled high. In current level of voltages the leds can withstand the reverse bias of -3.3V. But, the push-pull circuit will reverse bias some leds with much higher voltages and this will damage the leds. (If the leds are bidirectional will not be damaged but they will be lit instead).

The solution, according to @Transistor is: A non-inverting high side switch that pulls the row high when the corresponding PIN is high. And a non-inverting low side switch that pulls the column low when the corresponding PIN asserted low

\$\endgroup\$
  • 1
    \$\begingroup\$ Datasheet for the LED matrix? Common anode or common cathode? Info in the question, please. \$\endgroup\$ – Transistor May 11 '18 at 18:28
  • \$\begingroup\$ I want to add my own voice to @Transistor 's comment: Provide specific details about the matrix you are considering (and also, I think, some details on what has been working before for you -- you imply this -- so that we have an idea of what you are familiar with.) \$\endgroup\$ – jonk May 11 '18 at 18:41
  • \$\begingroup\$ So far, I'm considering a push pull circuit for each line, rows and columns. I'll upload the circuit I made soon. I don't know what is the difference between common anode and common cathode in led matrix. Rows are the anodes and columns the cathodes. \$\endgroup\$ – MrBit May 11 '18 at 19:13
  • \$\begingroup\$ (1) You don't need push pull. You pull the rows high when required. You pull the columns low when required. (2) "... that allows a current flow through output stage when the input is 0V." Which way? Through Q1 or Q2? (3) Still no datasheet for the LED matrix. Can it take 24 V reverse voltage? (4) If you use the CircuitLab button on the editor toolbar you can save editable images inline. That way we can copy and edit them in our answers. No need for screengrabs. \$\endgroup\$ – Transistor May 11 '18 at 21:39
  • \$\begingroup\$ @Transistor, Thanks for your prompt reply and your help! (1) The problem is I already have the circuit working at 3.3V and I have to change only the leds and drive them using the existing lines. Also, I wouldn't like to change the software, that's why I came up with push-pull solution. (2) through PNP, Q1. (3) there is no datasheet, they are single leds. 24V leds work at both directions. (4) I can't save the sheet because a membership is required. \$\endgroup\$ – MrBit May 11 '18 at 21:55
1
\$\begingroup\$

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.

schematic

simulate this circuit – 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.

enter image description here

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.

schematic

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.

\$\endgroup\$
  • \$\begingroup\$ Yeah. I kind of over-did it here: level shifter. \$\endgroup\$ – jonk May 12 '18 at 3:06
  • \$\begingroup\$ When the GPIO is pulled low (0V) there is a significant amount of current flowing to the pin. It is about -50mA. I would suggest to modify it as common-emitter mode. Wouldn't be possible? \$\endgroup\$ – MrBit May 12 '18 at 14:03
  • \$\begingroup\$ No, the whole point of the common base mode is to solve the problems caused by your common emitter approach. It was past bedtime when I drew Figure 3 and I can see that R3 is way to low. 5 to 10 mA would probably be enough so set R3 to 2k2 and see how you get on. I'll be back later. \$\endgroup\$ – Transistor May 12 '18 at 14:27
  • \$\begingroup\$ Updated Figure 3, etc. I'm still not quite happy with it. Anyone? \$\endgroup\$ – Transistor May 13 '18 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.