Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] PIC18F4550 voltage measurement

Status
Not open for further replies.

vinctal

Newbie level 4
Joined
Oct 13, 2016
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
76
Hi ,

I've been trying to figure an easy circuit for battery's voltage measurement, then translating that voltage to an input 0-5v that could be read by a PIC18F4550 microcontroller.

My idea is to have the voltage from the battery divided, so that the voltge would come out to be less that 5V. After the voltage is divided, it will goes to the anlog input of the PIC18F4550..

Here's part of the schematic that I'm working on to give some visualization:
Battery Measurement.png

1) As I go through the datasheet of PIC18F4550, at section 22.9 Analog Input Connection Considerations it mention that "A maximum source impedance of 10 kΩ is recommended for the analog sources". What does it mean ? Anyone can help to explain ?

2) what's the input impedance of the analog input of PIC


3) I am using voltage divider.Would this be a good circuit for sensing battery voltage? Could I make any improvements ?


Thank you very much !


Best Regards
 

Hi,

1) in your case the source impedance is R1 || R2 = 7.5kOhms. It is OK.

2) you need to read the PIC datasheet (I´m not familiar with PICs)

3) your circuit is OK. You could improve the circuit by adding a 1uF capacitor in parallel to R2. This acts like a low pass filter. It reduces noise.

Klaus
 

Hi ,

I don't understand why in my case the source impedance R1 || R2 = 7.5kOhms. Can anyone explain to me ?

Thank you very much !

Vinctal
 

Hi,

Let´s assume you have 12V at the battery.
Then you get 3V at the voltage divider output.

At the voltage divider output there are two resistors. 30k and 10k. They act as if they are in parallel.
therefore R_s = 1 / ( 1/10k + 1/ 30k) = 7.5k

***
you can test this.

R = U / I.
U output = 3V
if you connect an amperemeter at the output to GND, then the voltage becomes zero. (at least close).
Now the current should show a value of about 0.4mA.

Now calcualte R_s: R_s = U / I = 3V / 0.4mA = 7.5kOhms

Klaus
 

The analog input impedance of the PIC is very high. The reason for the 10K "recommended" limit is because the pin goes through an analog switch matrix to route the pin to a sample and hold circuit. The S&H 'snapshots' the voltage so it can't change while the measurement is being taken. It uses a capacitor to hold the voltage sample and that implies it needs time to charge or discharge to the applied voltage. As the series resistance "the source impedance" increases, it becomes slower to change to the new voltage. You can still use higher source impedance but only if you allow longer for the voltage to settle (select slower acquisition rate). Microchip "recommend" the 10K maximum so the ADC can work at full rated speed.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top