Voltage comparator circuit not working properly

Discussion in 'The Projects Forum' started by midnightblack, Feb 29, 2012.

  1. midnightblack

    Thread Starter Member

    Feb 29, 2012
    31
    0
    I am working on a line follower robot project.

    I am using light sensors and an op amp for the initial input stage of the complete circuit.

    Ideally, the op amp should switch to Vcc+ (4*1.5V batteries=6V) when the sensor is on the track and Vcc- (0v) when the sensor is off the track.

    In practice however this is not working and the op amp switches between ~1.2V and 1.6V :confused:.

    This is the circuit I have set up;

    [​IMG]

    The op amp I am using is the TL072CP op amp from Texas Instruments.
     
  2. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    The 1.6V high level is because you don't have a base current limiting resistor. The Darlington input looks like two diodes in series, so 1.6V is reasonable. You need to add a resistor in series with the base. I can't tell you the value without knowing the collector current.
    The low level should actually be around 180mV. See the VOL in the datasheet.
    LM393 would be a much better choice for a comparator. Most op amps make lousy comparators.
     
  3. midnightblack

    Thread Starter Member

    Feb 29, 2012
    31
    0
    Thank you very much for your reply.

    I looked at the data sheet for the transistor and it says collector current- continuous: 500mA.

    So if I understand correctly V=IR--> R=12ohms (V=6V and I=500mA)?

    But I still don't fully understand why this is so. Is it something along the lines that there needs to be a load on the output for it to work?

    EDIT: I also didn't understand why my low level is 1.2V rather than 180mV as you say.
     
  4. jimkeith

    Active Member

    Oct 26, 2011
    539
    99

    I also found this figure (Vol = 180mV) in the datasheet, but it does not agree with the graph of expected output voltage range--I wonder if it is in error because looking at the device schem, it looks like it would be hard put to pull the output much below 1V even with no load (PNP emitter follower driven by current source bias plus some common mode current to prevent crossover distortion).

    The relay driver output transistor stage is a darlington configuration--hFE is probably in the order of 5000, so it takes very little base drive to make it work--try putting in a 10K resistor and see what happens--regardless, the op amp should be able to turn off the darlington OK.
     
  5. midnightblack

    Thread Starter Member

    Feb 29, 2012
    31
    0
    Thank you for your reply. I have a few questions;

    1. Are you saying that the op amp will not output <1V?

    2. What relay driver output are you talking about?

    3. Are you suggesting that I should put the 10K resistor in series to the op amp output and the darlington pair? What exactly would this do? Drop the voltage to a more suitable one?

    4. Would the voltage output from the op amp still be switching from 1.2V-1.6V?

    EDIT: The opamp does switch the transistor ok (with some fiddling) but I am more interested in why this isn't switching from 0V to 6V because I may choose to use the op amp to input to a microcontroller which would need a digital input and also I want to know this simply as a matter of understanding.
     
    Last edited: Feb 29, 2012
  6. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    656
    For some reason, I pulled up the TLC072, which is not the same as TL072. I don't see VOL=180mV on the TL072 datasheet. They don't have a single-supply spec, but I'll bet that if you connected a 10k resistor from output to GND on your circuit, the output would go down to near GND.
    If that is an ammeter in the collector circuit - don't do that - you might burn out your transistor and/or your meter. You need a load of some sort, that is more than 12 ohms. I wouldn't push it to the limit, though. Derating by 50% is common practice. Keep in mind, though, that your Darlington saturation voltage will be around 0.8 - 1.2V, depending on collector current, so you really will only have around 5V across the load with a 6V supply.
     
  7. jimkeith

    Active Member

    Oct 26, 2011
    539
    99
    OK Ron, I think you have it pegged--I actually had both spec sheets up at the same time and thought that they were the same part--duh--honestly did not catch the difference between the CMOS and the JFET version part numbers.
     
Loading...