Hello, I am having a problem with a LM324N (quad op amp) as a comparator with no feedback. I'm going to attach a schematic below. I'm going to provide a quick description for the system as a whole, this problematic piece is just a small portion of the whole circuit. Looking at the diagram from left to right you will see
A) Voltage divider feeding the base of a 2N222A NPN.
B) This creates a constant current to charge the capacitor at the collector of the 2N222A.
C) A 2N2907 PNP transistor is connected in parallel with the capacitor. A 555 timer sinks current through the base of the PNP transistor essentially shorting out the capacitor.
D) Point is the 555 timer
E) A third connection runs from the Emitter/Capacitor/Collector to an LM324N to the inverting input.
D) A pot with a wiper runs to the non inverting input. (0V-9v)
E) A PWM signal leaves the op amp and goes through a 100 ohm resistor, this feeds a NPN power transistor which is controlling a 24V DC motor.
This all works great. Now let's get to what I can't understand.
I have an Arduino and I'm using the Ping)) sensor. I have the software running an If and Else If statement. I can see the pin reacting by going high and low based on distance. I proceed to send that signal to the non inverting input of the op amp (totally separate of the PWM op amp as I previosuly spoke of). A pot feeds the inverting input. I am using a single power supply (0V-9V). When the non inverting input excedes the inverting inputs voltage ( which I have set at 1V) the output should go high to 9 volts. The high 9 volts turns on a NPN which controls the power for a SPST relay. It is only working when I have the oscilloscope connected to two inputs of the op-amp. Why does the oscilloscope change anything? Are they not high impedance? Why does it only work when the probes become involved. All grounds are tied together and I am not seeing any interference in the power supply.
CRO? Im not familiar with that term. Does it mean comparator? If so then no, one input is 1V from the pot and the other is the signal from the Ping sensor.
I want to be able to enable the motor when motion is detected. I picked the power to the 555 timer, If I don't short the cap I will not achieve the sawtooth wave, essentially cutting out PWM running the motor. Logically speaking I want the movement to enable the 555 timer.
I've used the arduino to achieve the PWM, I want to use as many electronics components as possible and minimal Arduino board. It is a project for education.
When the Ping sensor goes high it should exceed the voltage set from pot, this should cause the output of the amp to swing to 9V closing the relay and allowing the 555 timer to turn on. The circuit is built exactly as shown.
I have it there because after this I will need to add another comparator in the collector of that NPN. I am looking for a constant speed and torque from the motor when the motor becomes loaded I wish to use negative feedback and another pot to adjust gain values. I have achieved a constant smooth speed. I need to add current control, I have it drawn out on a different schematic. I need to solve this problem first.
Undert9281:
I have it there because after this I will need to add another comparator in the collector of that NPN. I am looking for a constant speed and torque from the motor when the motor becomes loaded I wish to use negative feedback and another pot to adjust gain values. I have achieved a constant smooth speed. I need to add current control, I have it drawn out on a different schematic. I need to solve this problem first.
The motor goes in the collector circuit. To monitor the motor current, you put a resistor from the emitter to ground, and measure the voltage across that resistor.
Your circuit shows no decoupling - until you fix that anything could be happening.
The symptoms you describe are typical of an unintended oscillation.
Rule for comparators:
Decouple well
Use positive feedback.
for high speed comparators use a ground plane.
All three rules are to prevent unintended oscillation / jitters.
[ An opamp in normal modes uses negative feedback to tame the gain to a small
value like 10 or 50. Without negative feedback you get gains of 100,000 to 1,000,000,
so issues of instability and oscillation are suddenly very common!]
[ Also - why not use a comparator to do a comparator's job? ]
What do you mean by decouple? Shall I put a small capacitor say .1uf to the power pin?
What is the ground plane, true 0 volts? What do you mean by using a comparator to do a comparators job?
P.S why not put the motor at the bottom where the negative lead can truly be grounded? It will be drawing 8 amps at 24 volts...that will all sit at the collector no? I would rather have it go directly to ground from the emitters side? A new schematic is provided. The op amp with the A is for current control.