Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Comparator not giving Vdd Output

Status
Not open for further replies.

hariharan_engineer

Newbie level 4
Joined
Dec 2, 2020
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
82
Hello All!
I am currently working on a Visible Light Communication Project. Following are the components that I am using at the Receiver Side:
  • BPW34, Osram PhotoDiode (Datasheet)
  • MCP602, Single Supply Dual CMOS Op-Amp from Microchip (Datasheet)
  • Passive Components: Resistors (Fixed and Variable), Capacitors
  • Arduino Uno
Requirements: Whatever the waveform/data transmitting, I need to decode the pattern at the receiver side. Good Precision is my priority than detecting at high speeds. I need my design to work up to a few kHz of Square Wave frequencies.

My Transmitter is a 5mm Red LED, connected to a 1kHz, 2.2V Square Wave(0V as reference) and is kept 4ft away from the receiver. I connected the photodiode, first to an Op-Amp, which I configured as a Transimpedance Amplifier(TIA, Current-to-Voltage Converter). Currently, the TIA works like a charm. (I referred to the design document from Texas Instruments) i.e., At 4 feet distance, the photodiode generates about 7.38uA of Photocurrent, which after passing via TIA converts into 2V (as per my calculation). Kindly refer to the circuit below,

1632741808889.png


Now, I am facing the issue with the MCP602 configured as Comparator.

I want my output like this,

PhotoDiode OutputTIA OutputComparator Output
7.38uA2V5V
0A0V0V

But, the comparator outputs square wave (as expected), but it’s only 1V in Amplitude. After revisiting the theory, I found out that one parameter was limiting the output voltage of my comparator, but, being a newbie to circuit designs, I wasn't able to find a solution to my problem. I kindly request someone to help me out to fix this issue.

Note:
  1. I came across MCP6022, which seems like it will solve my comparator issue. But, I was a bit sceptical and wasn't able to justify myself.
  2. 5V supply to this Op-Amp was provided from a 5V pin of Arduino.
  3. I want my TIA + Comparator within a single IC, so that I could develop a shield kind of thing. I got inspired by OpenVLC.
THANKS IN ADVANCE!!!
 

Hi hariharan,

FWIW, here are some options to look at, if yout have the time or interest to try them - I cannot guarantee that any of them will solve your 1V out of the comparator issue, they are just suggestions that were done as simulations (so let the buyer beware...). As you say you want precision over high speed, the hysteresis option shouldn't be a problem in that way because it only really affects the speed - but with a whole millisecond to play with, I think you have lots of time to use within that for acceptable delays. The offset trip threshold of e.g. 100mV slows down the initial response time, but again... with a whole millisecond to play with that shouldn't matter for your application.

If you plan to use higher frequencies than 1 kHz, which you said in the first post, you'll have to accept that the TIA output magnitude is (far) less important than the comparator tripping/responding to the original input signal in a timely fashion (the TIA is only the go-between, IMO what actually matters is faithful representation of in at out, not the size of the middle bit). I would care less about 2V out of the TIA and just aim for anything that triggers the comparator over the frequency range you need.

Note that the TI design note calculation for the capacitor means equal to or less than so I personally feel you should choose a smaller capacitor than 3nF.

tia comp circuit options.JPG



Apart, I have a puzzle for you (and me): How could you do the same circuit using a humble 555 as the input to the photodiode signal, and with no capacitor for the 555 timing? I think it's maybe possible: Using a resistor divider to generate a voltage from the photodiode current that sits between pins threshold and trigger and using discharge (unconnected to trigger and threshold) as one output and the output pin as an additional output if needed. Haven't thought about it much but if it isn't lots of components on the photodiode side, might be another way of doing this. Although I'd stick to the op amp version you're doing, the thought about the 555 just got my curiosity last night as to how easy or annoying it would be to make functional.
 
Hi hariharan,

FWIW, here are some options to look at, if yout have the time or interest to try them - I cannot guarantee that any of them will solve your 1V out of the comparator issue, they are just suggestions that were done as simulations (so let the buyer beware...). As you say you want precision over high speed, the hysteresis option shouldn't be a problem in that way because it only really affects the speed - but with a whole millisecond to play with, I think you have lots of time to use within that for acceptable delays. The offset trip threshold of e.g. 100mV slows down the initial response time, but again... with a whole millisecond to play with that shouldn't matter for your application.

If you plan to use higher frequencies than 1 kHz, which you said in the first post, you'll have to accept that the TIA output magnitude is (far) less important than the comparator tripping/responding to the original input signal in a timely fashion (the TIA is only the go-between, IMO what actually matters is faithful representation of in at out, not the size of the middle bit). I would care less about 2V out of the TIA and just aim for anything that triggers the comparator over the frequency range you need.

Note that the TI design note calculation for the capacitor means equal to or less than so I personally feel you should choose a smaller capacitor than 3nF.

View attachment 172130


Apart, I have a puzzle for you (and me): How could you do the same circuit using a humble 555 as the input to the photodiode signal, and with no capacitor for the 555 timing? I think it's maybe possible: Using a resistor divider to generate a voltage from the photodiode current that sits between pins threshold and trigger and using discharge (unconnected to trigger and threshold) as one output and the output pin as an additional output if needed. Haven't thought about it much but if it isn't lots of components on the photodiode side, might be another way of doing this. Although I'd stick to the op amp version you're doing, the thought about the 555 just got my curiosity last night as to how easy or annoying it would be to make functional.
Thank you sir! I will look into this and will give a try. Thanks once again...
 

Hi,

Circuits of post#21:
* The "Comparator with hysteresis" circuit is wrong. Hysteresis needs positve feedback, but it has negative.
* I see no use in buffering the signal of the TIA output, but not wrong either.

Klaus
 

Hi,

Circuits of post#21:
* The "Comparator with hysteresis" circuit is wrong. Hysteresis needs positve feedback, but it has negative.
* I see no use in buffering the signal of the TIA output, but not wrong either.

Klaus

Hi Klaus,

Groan...

- Yes, but look at the simulation (that's all I'm working from), and (if it actually works outside of a simulation, which I mentioned to the thread poster...) do you think it really matters whether it's positive or negative in this circuit? How likely is a predictable signal going to make the op amp 'comparator' oscillate? I'd have chosen the circuit with the higher gain out of all three choices.
- Nor do I but it's better than wasting the second op amp since it's already there.

MCP602 negative and positive feedback simulations.JPG
 

The schematic annotation is incorrect.
First schematic has feedback to pin1 In+: positive feedback.
Second schematic has feedback to pin2 In-: negative feedback.

Provided comparator with hysteresis is intended function, the first schematic is basically the right feedback topology. But it needs a positive threshold (e.g. 0.6 - 1.0 V) at In- pin to allow the comparator output ever return to low level.
 

Hi Klaus,

Groan...

- Yes, but look at the simulation (that's all I'm working from), and (if it actually works outside of a simulation, which I mentioned to the thread poster...) do you think it really matters whether it's positive or negative in this circuit? How likely is a predictable signal going to make the op amp 'comparator' oscillate? I'd have chosen the circuit with the higher gain out of all three choices.
- Nor do I but it's better than wasting the second op amp since it's already there.

View attachment 172145

A comparator (most) have no loop compensation, so operating it with - fdbk is
an excellent method of creating an oscillator, and your sim does not in-
clude the parasitics that love to contribute to oscillation. And of course
the concept of hysteresis goes out the window as it does not exist with
- fdbk.

Regards, Dana.
 

Hi,
do you think it really matters whether it's positive or negative in this circuit?
You talk about hysteresis, you say it´s about 450mV and it can be changed by changing RB value.
This all is wrong.
There simply is no hysteresis.
It´s just a (saturating) amplifier with gain of 11.
And changing Rb changes the gain. Nothing else.

All I want is that the OP doesn´t get confused by wrong informations.

***
The non biased TIA causes problems in timing and nonlinearity.
The non biased hysteresis circuit also has it´s problems, lke LvM mentioned.

Personally I don´t like those analog circuits that work at the "edge" when inputs and/or outputs are at the supply rails. They call for problems.

Proper bias results in proper TIA operation and proper hysteresis operation. Fast, reliable, good design.

***
better than wasting the second op amp since it's already there.
I can´t see in which way it´s better to use a buffer. Please explain.
Either use just a single OPAMP, or use the second OPAMP anyhow useful. As gain stage, as comparator with or without hysteresis.
But as a "gain=1" buffer....I see no benefit. It won´t improve a signal, it just adds new erros like offset, drift, distortion....

Klaus
 

Hi,

That's all very well and understandable. And it is good to clarify things for the thread poster and correct people's mistakes. We all know my level of ability and knowledge, etc. I hadn't thought about the fact that it is just an amplifier as I also used this picture from a datasheet as a general idea, I was just looking for a solution to the person's problem:

LMC6464 datasheet photo detector and comparator circuits.JPG


Voltage follower: 'Better' only in the sense of: because it's a dual op amp, may as well make use of it rather than leave it doing nothing. I doubt that 3mV offset will be catastrophic for 0V or 5V output range... Timing is not a major concern according to the thread poster. I think sometimes it's important to see the requirements and solutions through the thread poster's eyes because what one person may see as vital, well that level of knowledge and ability, and precision design, may be out of the other person's current skill set and/or requirements.

I was waiting for the old chestnut about parasitics. The last thing I will say in this thread: I really must say that it's a shame that the same enthusiasm applied to picking faults in my suggestions and correcting any mistakes wasn't applied to offering any solutions at all to the thread poster or genuinely trying to understand what the issue he was trying to relate may be caused by. Bickering about Arduino inputs amongst yourselves - yes. Offering him solutions or genuinely trying to understand his problem - where? Quite unbelievable. Not a happy kitten right now.
 

Hi,
I really must say that it's a shame that the same enthusiasm applied to picking faults in my suggestions and correcting any mistakes wasn't applied to offering any solutions at all to the thread poster or genuinely trying to understand what the issue he was trying to relate may be caused by.
This simply is not true.

The OP referred to a good application note. Telling what to do.
But - with unknown reason - he modified the circuit to death.

In my first post#3 I pointed out what he did wrong.
Indeed all he needs to do: keep on the information of the application note he was referring to.

Later I asked how he measured the 1V, since 1V amplitude makes no sense at all ... with the given circuit. So I guess it´s either a measurement problem or the circuit he shows differs or at least is not complete.

I asked for informations. ... I did not get. So I saw no reason to go deeper.

In post#16 you asked about Arduinos and schmitt trigger.
I answered it as good as I can ... but now you say it´s "bickering".
BTW: In my eyes a "comparator with hysteresis" is different to a schmitt rigger.
A schmitt trigger mainly is used for "digital signals with slow edges" for edge shaping. No need for precise voltage levels.
A comapartor with hysteresis has precise voltage thresholds. made to detect levles of analog signals.
(but there is no black and white. There always will be applications that may use a schmitt rigger insteead of an comparator and vice versa)

Klaus
 

Hi,

today I came across an OPAMP datasheet (TC913A) which specifies the time it needs to come back from saturated output sate.
It is called "overload recovery time".
Many OPAMPs datasheets don´t specify this value. But the recovery time always exists. For some OPAMPs it´s a higher value for others a lower value.

Here what it says:
3.3 Overload Recovery
The TC913 recovers quickly from output saturation.
Typical recovery time from positive output saturation is
20 msec. Negative output saturation recovery time is
typically 5 msec.


Now they call 20ms as "quickly". I call it rather slow, but on the other side I´ve seen OPAMPs with more than 100ms.

Generally comparators are much faster with this, because they are designed for saturated outputs. Typically it´s in the range of low microseconds to low nanoseconds.
OPAMPs are not generally designed for output saturation.

Also mind: Even if you designed an Opamp circuit to not saturate the output at normal conditions it may happen during power up. (until a capacitor is charged, or the bias voltage is stable). So it´s not unusual they the go to normal operation after many milliseconds.

This is one point why I often say it´s no good idea to "mistreat" an OPAMP as comparator.
It may work. But not generally. It depends on several things like: OPAMP type, supply voltage, saturation polarity...

Klaus

BTW: I doubt that every OPAMP simulation model includes proper output saturation behaviour.
 
TC913 is an autozero (chopper stabilized) OP. Long recovery times are caused by overload behavior of the autozero circuit. It's not in the range of regular OP where recovery is mainly determined by slew rate and possibly some additional time for discharging the miller capacitor to normal bias point.
 
Sorry for the late reply...

I am yet to receive few other components, shipment is getting delayed.
While you are waiting , you ought to have completed your own model in simulation with parasitics included ( or excluded if Simulation is too slow)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top