-
Scale down 12V
Hi,
Just wondering what is the best way to scale 12VDC (up to 13.6VDC... automotive application) down to the 5V input for ADCIN. I have a 12 segment bargraph display, and created a "Driver chip" out of one of my pics to display blank @ 0V and all 12 LED's on at 5VDC. So far so good, now I just need some guidance as to how to get automotive signals (say, a Fuel level for instance) from its 0 to 12V down to 0 to 5V.
Thanks in advance.
-
A little search on the forum, pls.
Come on.
-------------------------------
-
Voltage divider.
Hi,
A simple voltage divider will do it.
Take a 1.8k resistor, connect one end to your 12V and the other end to a 1k resistor. Take the other end of the 1k resistor to ground. Now connect the PIC's analog in to the juction of the two resistors. Both grounds must be connected together (battery/car and the PIC)
13.6V over the total resistance of 2.8k will give you a current of ~4.86mA. (Ohm's Law, I=U/R or 13.6 / 2800). Those 4.86mA will 'produce' a voltage across the lower resistor of 4.86V. (Again, Ohm's Law, U=I*R or 0.00486 * 1000 = 4.86V). You may need a small cap in parallel with the lower resistor or do some low pass filtering in your code. That's it.
/Henrik Olsson.