LM358P Light Comparator

Discussion in 'General Electronics Chat' started by tracecom, Dec 26, 2012.

  1. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I am attempting to duplicate the comparator portion of the circuit shown here under question 17: http://www.allaboutcircuits.com/worksheets/opamp2.html .

    The schematic of my breadboard is attached. I have double checked my wiring and believe it to be correct, however the circuit does not operate as expected. I can see the voltage at the LDR junction change as vary the amount of light varies on each LDR, but I have not been able to light either LED. I have tried varying both pots at both extremes, and currently have them set at mid range. I know the op-amp is good, the power is properly connected, the LED's are good. What could be wrong?

    Thanks.

    ETA: Never mind. It was a pot in wrong. I have corrected the attached schematic to show the pots in the correct orientation. Rotating the pots clockwise will produce maximum sensitivity.
     
    Last edited: Dec 26, 2012
  2. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    The original design is to driving the motor, the LDR1 and LDR2 can't face to the same brightness.
    So if you want to test your circuit when you connected to a LED, you have to make anyone of LDR1 or LDR2 to get more brightness or darkness.
     
  3. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Thanks Scott. I have it working now.
     
  4. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I completed breadboard construction of the circuit identified in post 1 of this thread; my schematic is attached.

    The circuit works reasonably well, but I have some questions.

    1. At very low light levels, the circuit performs erratically. I need to disable it when available light falls below a certain level. Should I use another LDR to do this, or is there a better way?

    2. As I built the breadboard with 2N3904 and 2N3906 transistors, I must limit the size of the motor being controlled. I am thinking of 100 mA; is that correct?

    3. What would be a good choice for transistors to control up to 3 A? And do only the PNP's have to handle increased current or do all four transistors need to be replaced?

    Thanks.
     
  5. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    I'm just thinking that you may separate the Op amp and LDR to two sections, became two independent light detectors, only the output of two op amp is the same.
     
    Last edited: Dec 27, 2012
  6. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    I turned the PNP transistors around so that they have the positive pin up.
    I cropped your schematic so it is not as big as my neighbourhood.

    Maybe the lousy old LM358 has too much noise. Use a low noise audio dual opamp.

    Those transistors work poorly above 50mA. A motor that runs at only 100mA is pretty small and might draw 1A when starting or when stalled that might burn out the little low current transistors.

    All the transistors drive the motor forward or reverse. The base current from the opamps must be 1/10th the collector current but the max opamp output current is only 20ma so replacing the transistors will not help. darlington transistors can be used but they have a 1V or more voltage loss. Mosfets can be used instead of transistors.
     
    tracecom likes this.
  7. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    I plugged in a TL072 and it didn't work at all. The pinout seems the same.
     
  8. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The lousy old noisy LM358 dual opamp has inputs that work when their voltage is at ground in this circuit.
    But the low noise TL072 dual opamp inputs DO NOT WORK when their voltage is within a few volts from ground in this circuit. It needs a negative supply in addition to the positive supply.
     
    tracecom likes this.
  9. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    For the sake of future searchers who might land on this thread, I am posting a rearranged schematic as per AG's suggestion, and a photo of the working solderless breadboard. Thanks for the help.
     
    absf likes this.
  10. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    If you using this circuit to control the motor, then you should separate the LDR to two sides, as left side and right side.
     
  11. tracecom

    Thread Starter AAC Fanatic!

    Apr 16, 2010
    3,869
    1,393
    Yes, I think you are correct. However, the circuit is quite responsive as I have it laid out on the breadboard. I have seen videos where the LDRs are separated by several inches, and I have also seen them side by side, but with a thin divider between them. Both methods seem to work. I intend to experiment and see which works best.
     
  12. ScottWang

    Moderator

    Aug 23, 2012
    4,854
    767
    Long time ago, I got an idea is to use four LDRs to control two motors, two LDRs for the horizontal motor and another two LDRs for the vertical motor, the idea is for chasing the sunlight - sunlight tracer, but I didn't really to make it, several years ago that I heard someone made the similar product and applied the Patent and passed.
     
Loading...