Quote Originally Posted by Pic_User View Post
Excellent divide by three idea (10k 10k 10k) given by Dave (mackrackit).
How about this....? So far...
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1900&stc=1&d=118606737 9" />
The automotive environment can be very nasty, as someone has already said. Here is how I go about it:

First of all, put a diode in series with the 7805 regulator for reverse polarity protection. The one you have now will burn out the 10ohm resistor if you connect it up backwards.

It is always a good idea to use a Transorb (instead of the zener) - they are much better at catching nasty spikes. On a 12v system, an 18v Transorb should be ok.

I would also add some inductance before the 7805 - somewhere around 1mH works for me.

For maximum reliability, I always try and isolate or buffer the micro from the "real world" signals as much as possible. Try to make it and "island", if you like. For digital inputs, this means using opto-isolators. For analog inputs I buffer the signals with RRIO op-amps powered from the +5v rail. Doing this greatly reduces the chances of nasty spikes reaching your micro. Outputs are usually buffered anyway through drivers, transistors, fets, relays etc. Adding 1nF ceramic decoupling capacitors to every i/o on your pcb can also be worthwhile.

The other important point is to take care when joining the ground connections together on your pcb. Keep analog and digital grounds separate. Try to use a "star" type connection where all the grounds join at one place - usually at the filter capacitor/regulator. This point should have the lowest impedance path for noise/spikes.

There are many more "tricks" to combat the nasties found in the automotive environment. A a quick google using "automotive interference suppression" or similar will probably produce some worthwhile results.

Hope I was of some help.

Regards,

Andy