Quote Originally Posted by mister_e View Post
Few observations.

Diode should go in parallel with your Relay coil (pin 86/85). Something like
http://terpconnect.umd.edu/~toh/ElectroSim/Relay.GIF

It's a good idea to keep the relay as far as possible of the PIC, and not a bad idea to place a 0.1uF + something like 22-47uF close to your relay +12V line. Some also place a small capacitor across the relay coil, and some suggest to install a capacitor across the relay contact (kinda snubber), worth a try.

There's something funky on your design about NPN-PNP connection (at pin 10)

How do you supply the Pos sensor? From your voltage regulator or from the 12V line?

I would suggest you to tie all unused pin to gnd, and set them as input.

Mode switch... i find the resistor setting a bit non standard.

1000uF at the regulator output may screw up most 7805 regulator. You want to keep this value lower than this. Check the datasheet for the brand you're using. Usually 10 - 22uF tantalum + 0.1 uF ceramic do the trick.

HTH
Thanks for the help!!! The diode, I mis-drew in the picture I posted. The circuit was build on-the-fly, with only the basic IO drawn up before hand. I drew that in haste to post here and that is not correct. The diode is actually connected with banded end to B+, and other end to the coil neg terminal. Then I found out, there is a second diode built into the relay its self! The relay is at least 18" from the control module, in a socket that is part of the harness.

The NPN - PNP connection allows the PIC to switch +12V on the high side, to keep the power to the circuit on, after the power path from ignition switched 12V throuth the indicator lamp is no longer available. I use the signal through the light bulb to tell it when the ignition is turned ON, as well as being able to ground the lightbulb and cause it to illuminate. It looks odd but it works, and was buildable with components I had here.

The reason I have such large input capacitor (before regulator) is that the circuit needs to stay up during engine cranking (possible B+ pulling down to less than 6V during starter inrush). I learned that trick on my headlights controllers I built for my other 2 cars! The large cap on the 5V side is only because.... that is what I had on hand.

The position sensor is a throttle position sensor from a Rochester MPFI throttle body. It is a potentiometer only and requires clean regulated 5V supply and "clean ground" to give any sort of accuracy.

It has a 3 wire sheilded cable in the harness, with ground coming off the board near the CPU ground, and +5V coming off near the CPU's +5V pin. The sensor is actually very accurate and does not vary significantly when the car's voltage changes or the CPU actuates outputs. I'm actually really happy with that part of the system!

The mode switch resistors are that way because - once again they are what I had on-hand. It's just a pull-up resistor and a resistor to help protect the CPU if somehow +12V gets on the switch circuit.

I've not had any resets since the choke was put on the harness, but I really like your idea of the snubber cap on the relay. Motor is supposedly internally suppressed, but it couldn't hurt to add a freewheeling diode to the motor too. If there is any reason to go into the system again, that will get done!

Thanks again,
David