Considering next project (update: 7-14-09, new pics pg. 4)
Reply #34 –
Well, I finally figured it out and got it working, but first let me say...OH MY GOD, WHAT A PAIN IN THE A**. This is NOT for the faint-of-heart. If I knew how hard this would be, I never would have started it.
The key signals to read are pins 21 and 22 from the chip. When the cruise is on and active, each pin sends PWM (pulse width modulated) signals to transistors Q2 and Q1, respectively. The signals have only a 1V amplitude (varying between ground and +1V), so you can't use standard TTL digital logic chips out of the box. Nevertheless, the idea here is, if EITHER line is producing ANY pulses, you want to turn on a light. Pulses only happen when the module is actively managing your speed. If you tap the brakes, turn it off, hold coast, or go significantly over the set speed (either by jumping on the gas or going down a hill), the pulses stop.
How did I find that out? I bought a two-channel USB oscilloscope that I could plug into my laptop. I connected the probes to the naked board (two test points at a time), put the laptop on the passenger seat next to me, and did some driving. Every few miles I'd pull over somewhere, switch to new test points, and drive some more. Eventually I tested pins 21 and 22 and saw what they did when the cruise was managing my speed.
Knowing what to read and actually doing it are NOT the same thing, especially for someone who isn't an electrical engineer. I've had two electronics courses as part of the Physics course load, but I'm trained to approach electronics from first principles, not from a higher-level circuit design standpoint. On the one hand, this was a real learning experience for me, but on the other hand it was a really painful week.
I have pictures to post, but the short of it is that I'm using an op-amp as a comparator, where I combine the two signals and compare them to a reference 0.5V. To keep the light from flickering I use a capacitor to make the op-amp find the peak signal, and I use a 555 timer and a pair of transistors to periodically discharge the capacitor (otherwise, as I found, once the light goes on it stays on, to the point that if I shut the car off, go inside for an hour and start it again, the light immediately comes back on since the capacitor is still charged).
Once again, let me say that this is NOT for the faint-of-heart. I went with a daughterboard design that fits inside the speed control amplifier module. It's a very tight fit, with a thin piece of cardboard insulating the two boards. Nevertheless, here are some tips for the adventurous (or suicidal):
1. Watch for short-circuits! There's a lot to fit in a small space on your board, and when you try to squeeze everything in the amplifier casing things can bend and touch other components (resistors, capacitors, transistors, etc.) Be very diligent in looking for any potential for shorts.
2. Check and recheck your solder joins, then check them again. I would have finished a day early had it not been for a flaky ground to the op-amp chip. If you're using any solid (rather than braided) wire, be especially careful as solder won't want to adhere well.
3. Use braided wire to connect to the main board. I lost count of how many times the solid wire would break when I manipulated the two boards. Only four wires connect the two boards: power, ground, and the two signal wires from Q1-base and Q2-base. It's harder to poke braided wires through the holes alongside the components, but worth it.
4. Come up with a bench-testing strategy. A 9V battery will do for a power source to a point, but the boards will drain it quickly. I eventually switched to a power pack to a CD player that gives me 9V. The speed control circuit will run on only 9V, that's all you need. The major things to test are power points, grounds, the 555 output, the +0.5V reference voltage, transistor outputs, the op-amp output, etc. At least you'll have a working circuit design.
5. BE PATIENT!!! I can't stress this enough. It's a PITA to put the speed control amp in the car, road test, take it back out again, make a change, bench test, and then repeat over and over again. You can bench-test this. Make sure that if you provide 1.5V to Q1-base or Q2-base you get a high output from the op-amp, and low output in all other cases. If it fails that test, don't bother testing in the car, assuming that you have a decent bench power supply (read: not a dead 9V battery). Test as much as you can before road testing, then do static testing with the amp in the car and the key on. Take your time, whether it's soldering or any other part of the process. You'll go insane if you don't and you find that you can't get it working.
6. USE AT YOUR OWN RISK. Gee whiz, do I even need to say this?
7. Most op-amp chips require +Vcc and -Vcc to operate, NOT, repeat, NOT, simply power and ground!!! That said, I used an LM324N quad op-amp chip, and I was VERY lucky to have it handy. I only needed one of the four op-amps on the chip and could leave the other three unconnected, but the MAJOR benefit is that this chip operates off standard power and ground. The moral is: make SURE to check your op-amp chip's power requirements. As for the other components, I deliberately chose resistors with high impedance to make this a low-current design, but for reference, the PNP transistor is a 2N3906, the NPN transistor is a 2N3904, and the two diodes are both 1N914. They're standard parts that you'll have zero trouble obtaining.
Okay, I have six pictures. They were taken at various stages in development, so don't pay much attention to the filenames. This was a painful, trial-and-error process over the better part of the week. I'm still not "finished", but the electronic part is. The only thing left for me is making the green light aesthetically pleasing. The white LED I have in the dash is WAY too bright, and standard bulbs are giving me a light that looks more amber than green. I have some green acrylic to play with, but the hard part is definitely finished. I'm just glad that I don't have to do this again.