Author Topic: issue in powering segment by 5V and driving by 3.3MCU  (Read 633 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
issue in powering segment by 5V and driving by 3.3MCU
« on: June 24, 2021, 05:33:40 am »
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.



 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12852
Re: issue in powering segment by 5V and driving by 3.3MCU
« Reply #1 on: June 24, 2021, 07:41:24 am »
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.
« Last Edit: June 24, 2021, 08:12:36 pm by Ian.M »
 

Offline gamalot

  • Super Contributor
  • ***
  • Posts: 1303
  • Country: au
  • Correct my English
    • Youtube
Re: issue in powering segment by 5V and driving by 3.3MCU
« Reply #2 on: June 24, 2021, 07:46:41 am »
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.

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12852
Re: issue in powering segment by 5V and driving by 3.3MCU
« Reply #3 on: June 24, 2021, 07:56:57 am »
.... 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.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6758
  • Country: pl
Re: issue in powering segment by 5V and driving by 3.3MCU
« Reply #4 on: June 24, 2021, 08:14:04 am »
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.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: issue in powering segment by 5V and driving by 3.3MCU
« Reply #5 on: June 24, 2021, 05:34:04 pm »
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.pdf

It'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
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3341
  • Country: nl
Re: issue in powering segment by 5V and driving by 3.3MCU
« Reply #6 on: June 24, 2021, 05:53:27 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf