PDA

View Full Version : Need Help in Measurement of Voltage



apache
- 4th June 2005, 08:34
Dear All.
I am new in the PIC project and currently working with a project that requires to measure battery voltagr from 10 to 18 volts.As i have read nearly all the post in this forum i have notice that the only way to read voltages into a PIC is to limit the voltage between 0 to 5 volts.

Many have recomended to use resistors but is there any way to get muct better reading as resistors will change when it is subjected to heat.

Basically i want to read the voltages of a car battery and also the fuel indicator and change all of this to a digital read out.One way i found out via the internet is to use OBD (Onboard dignostic) codes where we could use the PIC16F84 to conver the manufactures code to display the values comming out of the car ECU (Electronic Control Unit) on all injectors car before 1996.

Has anyone done such a project before that can give me a helping hand on a better way to read voltages using at least an op-amp or an isocoupler.Or has anyone built a OBD system before?

Thank you

mister_e
- 4th June 2005, 11:37
the OBD is a good idea, just do a serach on this forum with OBD-II, as i remind, some thread provide some already mad OBD-II ics.

That's true, you have to limit your voltage to 5 volt as PIC work on 5 volt too, once it's done some maths to convert into a readable value.

If you want to read voltage from battery with a range of 10-18Volts, you can use simple voltage divider resistor or using an op-amp with a gain of 5/18. One or another will give the same result. Wich can be the most accurate... i can't say as i never compare both but i guess that KISS engineering with the 2 cents resistors and, for sure, a capacitor to filter the noise (coming from car alternator and many much more source) going to the PIC adc pin will be the most efficient one. Don't worry too much about the temperature stuff, the PIC result will also differe by using one method or another. It's still to give an idea, if you're out of 0.1 or 0.2 volt it would'nt harm anybody. In fact it will always be more accurate than those analog in your car cluster ;o]

If you plan to do some OBD-II stuff, please choose something else than PIC16F84, there's a lot more efficient and cheap than this one.

Melanie
- 4th June 2005, 13:04
>>Many have recomended to use resistors but is there any way to get muct better reading as resistors will change when it is subjected to heat.

What do you think will happen to your Power Supply +5v line when you subject it to heat?

Resistors come in all shapes and sizes down to 0.01% tollerance (or better). If you really want to go mad, try TANTALUM RESISTORS... that's assuming you can afford the price tag of several Dollars EACH (yes a whole heap of those green crinkly drinking vouchers PER Resistor!!).

apache
- 5th June 2005, 13:50
Hi Steave and Melanie.

Thanyou foe the feedback.Just let you know that i will be starting of the project next week and i have just purchase the MEL LAB "X1" board.
Just wondering if you guys have any schematic drawings of the opamp where we can scale down the voltages from 10 - 18 volts dc to 0 to 5 volts dc.

i have printed out all the foulars anf also the comments given in this forum and i remember clearly reading and artical by Melanie and also Steave.

If you could help me get the schematic diagram or even an url that will show how to scale down the voltages this will be much help.

Currently i have manage to read temperatues from the "X1" for and this will help me get the project running as i will be using it to measure cabin and outside temperature of the car.

As for the obd codes there isn't any site that will show the conversion of the obd codes so this will be a problem as i am very new in the PIC system and also programming.

Thanks for the advice and hope to hear from you on the schematic diagrams.

thank you & God Bless

eddyh
- 5th June 2005, 16:04
HELLO TO ALL, HOW I CAN WITH THE 16F84 TO NAME THE PORT OF 0 TO 12, AND I KNOW portb.0 to portb.8 and porta.0 to porta.4 EDDY.

NavMicroSystems
- 5th June 2005, 16:39
apache,

for a start I would recommend to use a 10 turn precision trimmer (10k) as a voltage divider.
(they are about 50 cent)

You don't have to worry about the temperature range.
The overall resistance of the trimmer may change with with the temperature, but this value does not really matter, the only thing that does matter is the ratio (R1:R2)
and that does not change.



+10-18 V -----------
|
-
\| |
|\|
| |\______ to PIC ADC
-
|
Ground -----------