Voltage divider without loading rest of circuit. - Page 1
Forum section: electronics / beginners

author: johm
author_rank: Contributor
timestamp: October 06, 2016, 08:36:13 pm
content: Hello!I have a VCC passive voltage divider with two 10K resistors. This is going to an input pin (RA4) on a PIC12LF1552 microcontroller. Connected to the same pin, I have the output of an MCP6002 (op amp). Basically I'm trying to use both functionalities at distinct moments in time. Sometimes I ADC-read the voltage coming from the voltage divider and other times change the pin to a digital input to read the digital op amp signal.The problem comes when trying to read from the voltage divider. I should read half rail: i.e. VCC/2 nevertheless the op amp is actively pulling the pin low, so the ADC basically reads 0V. Knowing that it's some loading issue, that could be solved by placing an op amp voltage follower after the voltage divider or similar but I want to minimise component count and board space. A transistor solution might be OK.Can this easily be solved? With a series schottky after the voltage divider or something similar?Thanks for your patience.

author: trophosphere
author_rank: Frequent Contributor
timestamp: October 06, 2016, 09:07:58 pm
content: You will need to isolate the outputs of the op-amp and voltage divider from one-another. Try either placing a mosfet switch in series between the op-amp's output pin and its connection to the microcontroller's input pin or using an analog 2x1 DEMUX. Both of these solutions will require an additional pin from the microcontroller.

author: johm
author_rank: Contributor
timestamp: October 06, 2016, 09:10:39 pm
content: Thanks, but I have used all I/O from the microcontroller

author: darrellg
author_rank: Unknown
timestamp: October 06, 2016, 09:12:29 pm
content: There are op-amps with tri-state outputs, but without an IO pin to trigger it that probably won't help.

author: johm
author_rank: Contributor
timestamp: October 06, 2016, 09:15:30 pm
content: I think I can reuse another pin to trigger a tri-state opamp, have to change the design though. Other options are welcome!

author: trophosphere
author_rank: Frequent Contributor
timestamp: October 06, 2016, 10:02:17 pm
content: Here is a thought (I made a few assumptions): Place a diode in series with your op-amp's output pin and microcontroller input pin. The diode is biased such that the cathode end is towards the op-amp output. If the signal on your microcontroller's input pin is around 0v/(diode drop) then you can assume that the op-amp's output is around 0v. If the signal on your microcontroller's input pin is VCC/2 then you can assume that the op-amp's output is around VCC and that you are reading the voltage divider's output which should be VCC/2. The only other change is that you will have to set your microcontroller's input pin to always being analog in.

author: johm
author_rank: Contributor
timestamp: October 06, 2016, 11:29:32 pm
content: Quote from: trophosphere on October 06, 2016, 10:02:17 pmSounds interesting. Tried that with a shottky and worked as expected. The only issue is that in order to read the VCC/2 voltage, the opamp must be high. It's normally low because it comes from the EMF pulse of the windings of a brushless motor. But I think I can fix that.

author: macboy
author_rank: Super Contributor
timestamp: October 07, 2016, 05:26:45 pm
content: Quote from: johm on October 06, 2016, 11:29:32 pmSchottky diodes always have some reverse leakage current, which will skew the resistor divider. Use a normal silicon signal diode instead, such as 1N914 or 1N4148.Since the op-amp output "idles" low, then reverse the diode so that the cathode is at the MCU and the anode at the op-amp output. This way, any time the op-amp output voltage is less than the voltage divider voltage, you will read the voltage divider. Any time the op-amp output (less 0.6 V or so) is greater than the voltage divider, then you will read the op-amp output (less 0.6 V)

author: johm
author_rank: Contributor
timestamp: October 07, 2016, 08:54:01 pm
content: Worked nicely reversing the polarity of the diodeI'am sticking with the schottky though, it's already a BOM item, it's 1x0.6 mm and leaks 5microamps at 25deg; far beyond the 1% tolerance of the voltage divider.

author: bson
author_rank: Unknown
timestamp: October 08, 2016, 11:43:40 pm
content: Quote from: johm on October 06, 2016, 08:36:13 pmOp amps in many configurations create avirtual groundat an input.https://en.wikipedia.org/wiki/Virtual_ground