Author Topic: Voltage divider without loading rest of circuit.  (Read 3636 times)

0 Members and 1 Guest are viewing this topic.

Offline johmTopic starter

  • Contributor
  • Posts: 39
  • Country: es
  • Really fond of Sines & Silicon.
Voltage divider without loading rest of circuit.
« on: October 06, 2016, 08:36:13 pm »
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.
Assembly is the high level programming for an ASIC design engineer (with no VHDL/Verilog).
 

Offline trophosphere

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Voltage divider without loading rest of circuit.
« Reply #1 on: October 06, 2016, 09:07:58 pm »
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.
 
The following users thanked this post: johm

Offline johmTopic starter

  • Contributor
  • Posts: 39
  • Country: es
  • Really fond of Sines & Silicon.
Re: Voltage divider without loading rest of circuit.
« Reply #2 on: October 06, 2016, 09:10:39 pm »
Thanks, but I have used all I/O from the microcontroller  :'(
Assembly is the high level programming for an ASIC design engineer (with no VHDL/Verilog).
 

Offline darrellg

  • Supporter
  • ****
  • Posts: 105
  • Country: us
Re: Voltage divider without loading rest of circuit.
« Reply #3 on: October 06, 2016, 09:12:29 pm »
There are op-amps with tri-state outputs, but without an IO pin to trigger it that probably won't help.
 
The following users thanked this post: johm

Offline johmTopic starter

  • Contributor
  • Posts: 39
  • Country: es
  • Really fond of Sines & Silicon.
Re: Voltage divider without loading rest of circuit.
« Reply #4 on: October 06, 2016, 09:15:30 pm »
I think I can reuse another pin to trigger a tri-state opamp, have to change the design though. Other options are welcome!
Assembly is the high level programming for an ASIC design engineer (with no VHDL/Verilog).
 

Offline trophosphere

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Voltage divider without loading rest of circuit.
« Reply #5 on: October 06, 2016, 10:02:17 pm »
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.
 

Offline johmTopic starter

  • Contributor
  • Posts: 39
  • Country: es
  • Really fond of Sines & Silicon.
Re: Voltage divider without loading rest of circuit.
« Reply #6 on: October 06, 2016, 11:29:32 pm »
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.

Sounds 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.
Assembly is the high level programming for an ASIC design engineer (with no VHDL/Verilog).
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2256
  • Country: ca
Re: Voltage divider without loading rest of circuit.
« Reply #7 on: October 07, 2016, 05:26:45 pm »
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.

Sounds 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.
Schottky 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)
 
The following users thanked this post: johm

Offline johmTopic starter

  • Contributor
  • Posts: 39
  • Country: es
  • Really fond of Sines & Silicon.
Re: Voltage divider without loading rest of circuit.
« Reply #8 on: October 07, 2016, 08:54:01 pm »
Worked nicely reversing the polarity of the diode ;D I'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.
« Last Edit: October 07, 2016, 10:42:45 pm by johm »
Assembly is the high level programming for an ASIC design engineer (with no VHDL/Verilog).
 

Offline bson

  • Supporter
  • ****
  • Posts: 2270
  • Country: us
Re: Voltage divider without loading rest of circuit.
« Reply #9 on: October 08, 2016, 11:43:40 pm »
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.
Op amps in many configurations create a virtual ground at an input.  https://en.wikipedia.org/wiki/Virtual_ground
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf