issue in powering segment by 5V and driving by 3.3MCU - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: June 24, 2021, 05:33:40 am
content: 1. I have connected 5V to common anode of 3 segments but it is driven by 3.3V MCU.2. Also tried removing by R11,R16, & R17 but its not working. What could be issue here?3. As soon as I turn high(3.3V) on T1,T2,T3 all segments get together.

author: Ian.M
author_rank: Super Contributor
timestamp: June 24, 2021, 07:41:24 am
content: Nope. Katesimon's idea wont work.You've got a level shifting problem - The PNP digit drivers bases need a drive signal referenced to the 5V rail, but your logic signal swings between 0V and 3.3V. The difference between 3.3V and 5V is 1.7V, still plenty enough to turn the transistors hard on. If you are *cheap* you can get semi-acceptable level shifting from your circuit by carefully choosing the base resistors to form a potential divider so Vbe is small enough not to turn the transistors on significantly when the MCU digit output is at 3.3V, and also so Ib is high enough for saturation when the output is at 0V.Try R11=390R and R10=1K2, which will give you an on state forced beta of about 20 @Ic=30mA, reasonable for saturation, and an off state Ic that should be under 1uA at 25 deg C.The down-side is that even when off, the MCU output must sink approx 1mA at 3.3V, and this may be problematic as you'll have 1mA * Ndigits trying to pull your 3.3V rail upwards when all digits are off. If the minimum load on your 3.3V rail is insufficient, adding a 3K3 pulldown on each digit output from the MCU should solve that with negligible effect on the other parameters. Alternatively if you are really cheap, omit the pulldowns and add a load resistor on your 3.3V rail!LTspice sim attached.

author: gamalot
author_rank: Super Contributor
timestamp: June 24, 2021, 07:46:41 am
content: I don’t know what kind of MCU you are using. According to my experience, most MCU GPIO pins can be configured as open-drain output.

author: Ian.M
author_rank: Super Contributor
timestamp: June 24, 2021, 07:56:57 am
content: .... which doesn't help if the MCU I/O pins aren't 5V tolerant, as they wont be real isolated open drains so will still sink current (to the 3.3V rail) through their upper internal protection diodes. If they are 5V tolerant, configuring them as open drain will be a major improvement allowing much more flexibility in the choice of base and b-e resistor values.

author: magic
author_rank: Super Contributor
timestamp: June 24, 2021, 08:14:04 am
content: Power the LEDs from 3.3V if possible.Or, if they are low voltage types (red, green), use NPN emitter followers for common anodes and recalculate cathode resistors.That looks like the simplest/cheapest options.

author: Zero999
author_rank: Super Contributor
timestamp: June 24, 2021, 05:34:04 pm
content: I agree about powering the LEDs straight from 3.3V. If they're higher voltage green, white, or blue, they might not even need series resistors, as the output resistance of the output pin could be enough to limit the current to a safe level.Failing that there are plenty of ICs which can be used to level shift from 3.3V to 5V.The 74ACT14 can be used to level shift 3.3V to 5V and its six outputs can drive up to 25mA, although not all simultaneously. The sum of the output currents mustn't exceed 50mA.https://www.mouser.com/datasheet/2/149/74ACT14-1006522.pdfIt's inverting, so you'll need to adjust the software to suit.There's also the 74ACT241, which is non-inverting and has eight channels that can output up to 50mA per channel, up to a total of 200mA.https://www.ti.com/lit/ds/symlink/sn74act241.pdf

author: Doctorandus_P
author_rank: Super Contributor
timestamp: June 24, 2021, 05:53:27 pm
content: Adding two or three diodes in series between the uC and each PNP transistor probably also works.This raises will have enough voltage drop to prevent a current flow from the 5V supply into the uC pins when their outputs are high, and will pull the bases low enough to open the transistors.If you do this, you may also have to tweak the resistors a bit to ensure the transistor has enough base current.