Re: how to measure voltage / current using PIC microcontroll
You can measure the voltage using a built-in Analog-to-Digital converver (ADC). As it measures the voltage relatively to the reference voltage, so you need a stable +5v supply (for example, using a L7805). ADC has has it's resolution (usually it is 1024), so the accuracy will be 5/1024.
To measure a current you just need to measure the voltage on the resistor, and calculate the current using the Ohm's law: I=U/R.