# how to measure voltage / current using PIC microcontroller?

1. ## how to measure voltage / current using PIC microcontroller?

I am trying to build a project that is able to detect the amount of voltage and current from a electrical appliance and then it will send a signal to the micro controller to decide whether or not to cut the power supply.

But I am struck at the part of how to detect/measure current and voltage using PIC .

Please show me how to do it if possible.

Thank you:D

•

2. ## 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.

3. ## Re: how to measure voltage / current using PIC microcontroll

Use ADC available in PIC to measure voltage. Current can be measured by measuring the voltage across a resistor. The practical issues can be different based on how much voltage and current you plan to measure. Usually PIC ADC can measure up to rail voltage (when using VDD as reference), so you will have to make sure that the voltage to be measured is always between 0 - VDD volts. If the original signal is too small, use an amplifier otherwise use a voltage divider. The shunt resistor used for current measurement should have enough wattage to stand the power dissipation.

•

4. ## how to measure voltage / current using PIC microcontroller?

Any programming example? Pls write a program for atmega8.

5. ## Re: how to measure voltage / current using PIC microcontroll

thanks guys but how to program the thing?

•

7. ## Re: how to measure voltage / current using PIC microcontroller?

i have made the project about solar monitoring system. solar is the supply to the load. from solar, i connect it to the boost converter (DC to DC voltage) and then output of inverter will connect to the inverter. which is 12v to 230v. my problem is, i don't know how to connect the PIC 16F877A to my circuit. can you please explain to me. at the same time, can you please give me the coding of PIC.

--[[ ]]--