Question about an opamp

Thread Starter

mikekehrli

Joined Oct 2, 2012
24
I've got a bug in a project design with an opamp - the Microchip MCP6242 dual opamp to be exact. I'm missing something very fundamental about this chip and I'm hoping someone can set me straight.

I have a fluctuating voltage on the non-inverting input between 0 and 5 volts. For my testing, I'm supplying the voltages and can see the input voltages.

My first question is about the inverting input. I have a voltage divider with 15K resistors between Vdd (5V+) and Vss (Gnd). I should see 2.5V at the center which is connected to the inverting input. But instead I see 1.38V there. How is that possible?

My main question however is this: The output of the opamp is always the same at about .9 volts. I take the non-inverting input from rail to rail. The inverting input is stable at 1.38V. The output never budges. Can anyone tell me why?

Note, I have the output of the opamp feeding into an input of a pic chip. However, I have removed the pic chip, just in case I had a software goof in there somewhere. The results were nearly the same. Output voltage was a fractionally higher, but still unchanging.

I'm just trying to use this chip as a comparator. I want the output to go from 0 to 5 volts when the non-inverting input goes above the inverting input. Super simple application. But it's not changing.

Power and ground for the chip are present.

:confused:
 

LvW

Joined Jun 13, 2013
1,758
I am afraid, it is not easy to help you without any circuit diagram.
It is not easy for us to visualize the circuit based on your description only.
 

Thread Starter

mikekehrli

Joined Oct 2, 2012
24
Thanks, guys. I've added a picture. The amp is U3.

Bypass cap isn't shown in this fragment, but it's there - .1uF, and is right next to the chip on the pcb.

U5 is a dsPIC30F4013 - and I've tested the amp with U5 uninstalled as well, just in case I did something wrong in software.

 

tindel

Joined Sep 16, 2012
936
I'm just trying to use this chip as a comparator. I want the output to go from 0 to 5 volts when the non-inverting input goes above the inverting input. Super simple application. But it's not changing.
Ohp- Correction - you need positive feedback for a comparator. Well, technically you don't have to, depending on the amplifier. With that kind of loading effect on your non-inverting input the input stage is probably a npn input.

You have to be very careful using op-amps as comparators, it can be done, but you have to know all of the rules of engagement, if you will. You should almost always have some form of positive feedback to provide hysteresis on you signal.

You'll find this app-note helpful.

http://www.google.com/url?sa=t&rct=...CO21-KTit8IWavHv65u3GVw&bvm=bv.49784469,d.aWM
 

tindel

Joined Sep 16, 2012
936
Ohp- Correction - you need positive feedback for a comparator. Well, technically you don't have to, depending on the amplifier. With that kind of loading effect on your non-inverting input the input stage is probably a npn input.
I looked at the datasheet a little closer, and it seems to be a CMOS input stage. If you are getting that much loading effect on your input pin (causing your inverting input voltage to sag that much) then something is wrong. Check that your power supply voltages are correct, check that you are powering the correct pins, check that you've connected to your amplifier correctly.

Also, be mindful of any unused amplifiers (you said it was a dual) and terminate those gates properly per the datasheet.

If none of that works, then you possibly have a bad op-amp and would do a quick check using a simple buffer amp to see if it's working.
 

WBahn

Joined Mar 31, 2012
30,058
I've got a bug in a project design with an opamp - the Microchip MCP6242 dual opamp to be exact. I'm missing something very fundamental about this chip and I'm hoping someone can set me straight.

I have a fluctuating voltage on the non-inverting input between 0 and 5 volts. For my testing, I'm supplying the voltages and can see the input voltages.

My first question is about the inverting input. I have a voltage divider with 15K resistors between Vdd (5V+) and Vss (Gnd). I should see 2.5V at the center which is connected to the inverting input. But instead I see 1.38V there. How is that possible?
Verify that the voltage at pin 4 is 0V and that the voltage at pin 8 is 5V.

Verify that the voltage at the top of the voltage divider is 5V and that the voltage at the bottom is 0V.

Ensure that the inputs to the other opamp are tied to a stable voltage. You might tie one high and the other low. Make sure that the unused output is unconnected.

If the output of the voltage divider is still real low, remove the opamp and measure the voltage at the center of the voltage divider.

If the output is unchanged, then pull the two resistors and measure the resistance of each. If they are close to 15kΩ then check for a short between where the junction of the two resistors is in the circuit and anywhere else.

Else, if it goes up to close to 2.5V, then the opamp is probably bad.

You may be able to use the other opamp in the package, but if you can, just use a new part.
 

Thread Starter

mikekehrli

Joined Oct 2, 2012
24
Hi Guys. Thank you so much for all of your input. I think I have my notifications off because I didn't see them until I got back here to check the thread manually.

I got side tracked on an in-depth study of all the adc registers in the dsPIC, and rewriting a bunch of the code for it. I just got back to the opamp yesterday, and went through all of the posts above.

You have to be very careful using op-amps as comparators, it can be done, but you have to know all of the rules of engagement, if you will. You should almost always have some form of positive feedback to provide hysteresis on you signal.

You'll find this app-note helpful.

http://www.google.com/url?sa=t&rct=...CO21-KTit8IWavHv65u3GVw&bvm=bv.49784469,d.aWM
Thanks, tindel. I studied that doc. I'm not sure my app really require the comparator, but I'm going to switch to one anyway. That article convinced me not to mess around with it. I have some MCP6542's coming from DigiKey to test on the prototype.

Thanks Wbahn. Here's the results of the tests:

This is the 3rd chip I've used. I replaced it twice. I also measured the voltages at the pins with the chip removed, with the input high, low and floating. By "input" I mean the input the circuit upstream of the protection circuitry - or at the terminal block. Here are the voltages:

No Chip w/chip: Input Gnd Input floating Input 4.93V
Vdd: 5.01 5.01 5.01 5.01
Vss: 0.021 0.02 0.021 0.22
In+ .220 1.17 4.96 4.94
In- 2.50 1.23 1.83 1.80
Out: .021 1.18 1.74 1.7

The voltage divider top and bottom measure at 5V and 0V as expected.

Vdd and Vss are stable and at the correct pins.

The other opamp is in use and is tied to valid voltages in the 0-5 volt range. The In- is connected to 3.5V and In+ is connected to 2.5V. The output is low. But when I put 4.9V on In+ the output stays low - actually .25V - yet another mystery.

With opamp removed, the voltage divider has 2.5V in the center as it should with the opamp installed. But with it installed, the center of the voltage divider is approx 1.8V.

I've ordered some pin comaptible comparators and will try one in a couple of days. I'm also still looking for some hidden problem with the circuitry, cold joints etc, but the circuitry all works as expected without the amp in place. It appears to all be correct. But still looking as something must be wrong with it.
 

WBahn

Joined Mar 31, 2012
30,058
If there is a problem in some other part of the circuit that is causing the opamp to behave poorly, we really need to see the entire schematics and how all of the opamps in the package are used and what they are hooked up to. Also, if you haven't ready (or even if you have) please mention the exact opamp that you are using.

We may also need to see some pictures of the circuit to see if there are any problems there, but we can hold of on that for now.
 

tindel

Joined Sep 16, 2012
936
With opamp removed, the voltage divider has 2.5V in the center as it should with the opamp installed. But with it installed, the center of the voltage divider is approx 1.8V.
(5-1.8)V/15k=213uA
1.8V/15k=120uA
213uA-120uA=93uA going into a CMOS input stage!

The datasheet says a typical bias current of 1.1uA typical at 125degC. Something is wrong! With that kind of loading and you trying other parts - I still think your pinouts are wrong.

I have seen datasheets show the pinouts both from the bottom and top of the part - verify that you are looking at the part from the correct direction.
 

Thread Starter

mikekehrli

Joined Oct 2, 2012
24
Thanks for your comments, guys. I really appreciate the help here.

I just received my comparators from DigiKey today. I popped in the MCP6542E/SN and the circuit is now working perfectly.

The opamp was an MCP6241-E/SN. Sorry, I thought I'd said what it was. If you can see what I missed from that part number, I would be interested to know what it was. As a note, the voltage divider that should have given me 2.5V on the non-inverting input, was 1.8V with the MCP6241 installed, but shows the correct 2.5V when the comparator is installed. I really don't understand how that other chip was pulling down the voltage divider like that.

But anyway, I am considering this issue closed. The comparator chip does everything I wanted the original chip to do. It only costs .18 more.

Again, thanks for all the comments. This is a great forum.
 

WBahn

Joined Mar 31, 2012
30,058
Well, was the previous opamp a 6242 (as in Post #1) or a 6241 (as in Post #16)?

The schematic is correct for a 6242. It is NOT correct for a 6241, which only has ONE opamp in the package.



It makes a HUGE difference!
 

Attachments

tindel

Joined Sep 16, 2012
936
I bet that there is the problem - it was loading badly - something was wrong. I guessed it was the pinouts and ah-ha - it's the pinouts!

FYI - the part will probably still work just fine if you want to use it for something else.

Congrats getting things to work!
 

Thread Starter

mikekehrli

Joined Oct 2, 2012
24
OMG! Yes, guys you are exactly right. And yes, it was the pinouts! I checked them against the schematic about 5 times, never realizing I had the wrong part.

It was a typo in my order for proto parts! Wow, wow, how embarrassing. But at least the mystery is solved.
 

WBahn

Joined Mar 31, 2012
30,058
Live and learn!

When you start having problems you can't get a handle on, take a step back and verify everything. Check the part numbers of the parts you are physically using. Check the pinouts on your schematic against the datasheet. Check whether the pinout diagrams are looking down on the part or looking up. Check that the physical part is inserted the correct way. While a bit tedious, these are all easy checks to make and, when you have a problem that doesn't make sense, it is very possible that these will reveal why saving you lots of time chasing ghosts.
 
Top