Need to create a 3.3V pull-up from 5V - zener or LDO? - Page 1
Forum section: electronics / beginners

author: HwAoRrDk
author_rank: Super Contributor
timestamp: December 14, 2023, 08:17:48 pm
content: I face a need to create a 3.3V pull-up voltage from a 5V supply, but I'm not sure which is the best method to use. The reason I need specifically 3.3V for a pull-up is because I'm "tapping in" to a momentary push-button on another device so I can detect when it has been pressed. The other device runs on 3.3V. But, the other device is not always powered (it is switched under my control), so I need to provide my own pull-up voltage for the button during that time. The only load on the 3.3V will be when the momentary button is pressed, so at most perhaps 10 mA.Should I use a zener to regulate 3.3V, or a linear regulator?If I use something like a BZX84 or BZT52, I see that I'll need to provide approx. 5 mA current through it to properly regulate to 3.3V, so I figure a 330 ohm current-limiting resistor should work. One thing I've noted about a zener though is that it will fall out of regulation while the button is pressed, because current will be being diverted through the button and its pull-up resistor (say, 1K) to ground. But then does that even matter? As far as I can see, when the zener current drops, the regulated voltage drops; but all I'm concerned about (and the whole reason for this) is that when the button is off the pull-up voltage doesn't exceed 3.3V, which I don't think it can.The downside I can see to the linear regulator is it needs more supporting passives - i.e. a couple of caps on the input and output - versus the single current-limiting resistor for a zener diode.Any advice on which I should use?

author: Alex Nikitin
author_rank: Super Contributor
timestamp: December 14, 2023, 08:29:54 pm
content: A simple voltage divider (two resistors) is not good enough? Assuming the 5V supply is reasonably stable.CheersAlex

author: SuzyC
author_rank: Frequent Contributor
timestamp: December 14, 2023, 08:47:59 pm
content: If you insert a red LED in series with a pull-up resistor to 5V, the LED will drop the voltage to 3.2V with 10mA or so.

author: DavidAlfa
author_rank: Super Contributor
timestamp: December 14, 2023, 08:50:45 pm
content: Be careful, this current will leak into device's VDD when unpowered, if the current is too high it might be able to power it up!10K to 5V, 18K to gnd, will make 3.2V.22k/39k, 47k/91k, 100k/180k...Maybe device you're connecting the button to has configurable pullups? Is It a MCU?

author: ledtester
author_rank: Super Contributor
timestamp: December 14, 2023, 08:54:42 pm
content: Another approach... connect a new button to your main MCU and drive the original button input with a GPIO line which will either be HI-Z or LOW. Then use the new button instead of the original one.Update: or you could use the original button but cut traces and re-route it to the master MCU.

author: Peabody
author_rank: Super Contributor
timestamp: December 14, 2023, 08:57:37 pm
content: If the "other device" is a microcontroller, it probably has protection diodes from its GPIO pins to its Vcc pin. If the device is unpowered, Vcc will be at ground. So you will have a diode to ground even when the momentary button is not being pressed.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: December 14, 2023, 10:23:46 pm
content: Quote from: DavidAlfa on December 14, 2023, 08:50:45 pmHmm, good point. I had forgotten about that possibility. The other device isn't an MCU (some kind of PMIC I think?), but I suppose it might have protection diodes on its button input. I don't know if it's using an external or internal pull-up, or what value the pull-up is. I will need to investigate.I also hadn't thought of a resistor divider. Actually, that might be the better option, as the upper half of the divider can also serve as the pull-up for the button. To save introducing extra odd values of component into the design, I could use three 1k resistors - one upper, two in series lower - to get 3.33V, which is probably close enough not to cause trouble.I'm wondering whether limited current through a 1k resistor (~1.6 mA?) will be enough to activate the other device...Quote from: Peabody on December 14, 2023, 08:57:37 pmHuh? Surely the other device's VCC will be floating when un-powered? How can it be at ground?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 14, 2023, 11:18:43 pm
content: Draw the equivalent circuit: if it has ESD clamp diodes, then the pull-up flows through the VCC diode, into VCC, into whatever load is on VCC (the IC and whatever is connected?). Maybe the VCC load is tiny and VCC pulls up far enough to enable the circuit you thought was supposed to be disabled; maybe it's heavy enough that the pin never pulls up to a sensible logic level and you don't read anything from it.If you have a schematic for what you're trying to do, and the thing you're trying to do it to, and datasheets of relevant components, that will help greatly.Tim

author: magic
author_rank: Super Contributor
timestamp: December 15, 2023, 07:35:40 am
content: Use your divider to pull up the button and then 10k or 100k between the button and the other chip.Should be good enough for the other chip to read the state of the button (unless it has internal pullup, thenyou are screweduse a diode instead of resistor).Will vastly reduce current leaking to the other chip from your pullup.Or simply this:Quote from: ledtester on December 14, 2023, 08:54:42 pmOr a PNP emitter follower between the modified button and the other chip's button input.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 15, 2023, 08:24:39 am
content: Modern circuit can run on rather low current. So 1 mA may well be enough to power a µC.Modern electronic does not need much current for the input / switch. So one may get away with much lower current and resistors in the 1 M range. With the other device powerd off the signal level would be low (e.g. 0.5 V range) and it may need a comparator input at the µC to detect.

author: Peabody
author_rank: Super Contributor
timestamp: December 15, 2023, 03:24:56 pm
content: Well what about inserting a diode in each line. Then when pressed the button would ground the 3.3V pulled-up line and the 5V pulled-up line, and neither would interfere with the other. No divider needed. The 1N4148 would probably work so long as 0.7V is read as LOW by both devices. If not, then use schottky diodes.

author: Terry Bites
author_rank: Super Contributor
timestamp: December 15, 2023, 05:10:48 pm
content: Put resistor in series with the pin and pull the other end up to 5V . The pin will have internal diode clamps (not seen an exception yet) to its Vdd and Vss check the the max current into the pin is not exceded, typically 20-40mA!Obviously you don't want to waste power and generate heat, so 20kish. eg (5-3.3)/16k= 100uA, well within limits. No worries with 3.3 powered down and 5V active.There is a speed penalty of course. You wouldn't want to do this with a clock input.

author: wraper
author_rank: Unknown
timestamp: December 15, 2023, 05:17:08 pm
content: Quote from: HwAoRrDk on December 14, 2023, 08:17:48 pmAnd it comes with a problem. If that button is connected to IC input, most likely it will be powering that circuit through ESD protection diodes in IC. So what you most likely need is not a 3.3V pull-up but a diode between push button and pull-up and IC in that circuit. Then you also can safely pull-up to higher voltage.

author: DavidAlfa
author_rank: Super Contributor
timestamp: December 15, 2023, 07:33:58 pm
content: Quote from: Terry Bites on December 15, 2023, 05:10:48 pmThis will cause issues with analog peripherals (Mainly ADC) in a lot of MCUs, so avoid when possible or test thoroughly to ensure there're no side effects.

author: Peabody
author_rank: Super Contributor
timestamp: December 16, 2023, 02:57:21 am
content: Quote from: HwAoRrDk on December 14, 2023, 08:17:48 pmI believe the attached circuit will satisfy this requirement. If not, then I don't understand what's needed.