Hey guys. So I'm working on building a car which starts / stops moving when exposed to light. I've got the circuit set up to detect a voltage corresponding to the light intensity, compare it to a threshold voltage, and then toggle the flip-flop when it detects a pulse. The flip-flop (increased to 9V by op-amp) in turn controls whether or not current will flow across a transistor, which in theory should cause the RC transmitter to transmit a 'forward' signal.
However, there are a couple bugs in the circuit. First, the flip-flop does not properly transition between states each time it receives a pulse. Rather, it is currently acting as a normally-closed switch, transitioning to open (turning off the LED indicator) upon incident light, and back to closed when light is removed. In other words, it doesn't seem to be latching properly.
The flip-flop (CD4013) is wired as follows:
1: Q to LED / transistor base
2: Q bar to Data 1 (5)
3: Clock 1 from Comparator output
4: Reset 1 to Set (6) to Vss (7) to ground
14: Vdd to red (9V)
The second issue lies with the transistor controlling the transmitter. I can't seem to get it to be controlled directly by the flip-flop, so that the car runs when the LED comes on and stops when it goes off. Currently, the transistor either allows the transmitted to run in either toggle state or in neither toggle state (depending on how I wire it).
The transistor portion of the circuit is shown with Base coming in at 0/9V from the op-amp, +3V (two AAs enclosed in transmitter) feeding into the Collector, and the Emitter connecting to a 1k ohm resistor to the 0V end of the transmitter.
Here're a couple images of my circuit. The first shows the half of the circuit from the master power switch to the LED indicating flip-flop output. The green lead leaving at the top of the image is the same as the one in the second image.
And here's a schematic of what I'm trying to do. Now, I'm a mechanical engineer, so my theory might be a bit off -- correct me if I'm wrong, okay?
If you guys could help at all, it would be deeply appreciated.