Trouble with comparator open drain output and pull-ups

Thread Starter

spmaddox

Joined Nov 29, 2018
49
Hi folks,

I have a circuit design and prototype that I'm working on which includes a comparator with open collect/drain outputs and I'm not sure I'm understanding exactly how to employ the pull-up resistor to toggle between HIGH and LOW when the comparator + is above/below the comparator -. I'm attaching my schematic as well as a few images of my prototype which show voltage measurement at the comparator OUT.

The first image, Circuit Schematic.jpg, is the schematic.

The second image, 4 Circuit Prototype.jpg, is the full view of the bread boarded prototype which corresponds to the schematic.

The 3rd image, Circuit 1 - V for Circuit 1 Comparator OUT when Circuit 1 is Closed.jpg, shows V measured on the comparator OUT when the circuit is closed.

The 4th image, Circuit 1 - V for Circuit 1 Comparator OUT when Circuit 1 is Open.jpg, shows V measured on the comparator OUT when the circuit is open.

The comparator here is Analog Devices ADCMP393 which is a quad comparator. I'm supplying the - of each with 42mV, the + of each comes from the high side of a 100 ohm resistor located on the low side of a 1V circuit. Circuit 1, when closed, delivers 500mV to the comparator +. When Circuit 1 is open it delivers 0V to the comparator +. I've verified these measurements for the comparator + and - at multiple points including the actual pins on the comparator.

When closed: + = 500mV, - = 42mV so + > - and comparator OUT should be HIGH
When open: + = 0V, - = 42mV so - > + and comparator OUT should be LOW

Perhaps I've misunderstood or perhaps I've set this up incorrectly?

thx - sean
 

Attachments

ScottWang

Joined Aug 23, 2012
7,409
The power for ADCMP393 only provides 2.5V, how is the Vcc of RPI?

When you using the Output Drain, the voltage of OD will be divided by the pull up resistor and the R_load (please check the page 11 in datasheet), the R_load here is the input resistance of RPI GPIO, how many volts when the output of ADCMP393 is High?

Please measure the input resistance of RPI GPIO when there is no power on.
 

Thread Starter

spmaddox

Joined Nov 29, 2018
49
HI Scott,

The Vcc that will be supplied to the RPI is 3.3V, the resistance that I measure for the RPI GPIO is 5.8M ohms. When I terminate the comparator OUT line to the RPI GPIO I measure 2.538V on the comparator OUT line without power being applied to the RPI, since there is no power applied to the RPI I've not toggled the GPIO as an input. In this state I still measure the same 2.538V on the comparator OUT when the circuit is open and closed.
 

Thread Starter

spmaddox

Joined Nov 29, 2018
49
Hi Scott - perhaps I wasn't clear. What I said is that I do see a high state but I don't see a low state. When the circuit is closed and 500mV flows to the comparator + I see a high, this is because the + is > the - which is at 42mV. When the circuit is open the comparator + sees 0V and I should see a low on the comparator out because the - is now > than +. That is the crux of the issue I'm trying understand and solve.
 

ScottWang

Joined Aug 23, 2012
7,409
You can isolated the op amp and test its own function independently to see how it works, you should be see the High and Low states on the Output to proves its won function is OK and the voltages conditions should be the same as your experiments.

You can use two VR10K and connected the pin 1 to Ground and pin 3 to 2.5V Vcc, pin 2 connected to the two inputs of op amp, and adjust the two VR10K to let the op amp as (+) > (-) and to measures the Output pin, and adjust the two VR10K to let the op amp as (-) > (+) and to measure the Output pin.
 

Thread Starter

spmaddox

Joined Nov 29, 2018
49
Hi Scott - I've solved my issue by putting everything on a common supply/ground. I suspect because the IN + coming into the comparator was from a separate 1V supply/ground from the 2.5V supply/ground that is supplying VCC/GND to the comparator the IN+ may have been floating from the comparator perspective.

Regarding the external pull up resistors I've bypassed those for the time being and am currently utilizing the SW controllable pull-up/pull-down capabilities provided by the RPi for the GPIO. I may go back to an external resistor but for the moment I'm not using one.

thx - sean
 
Top