Continue to Site

Welcome to

Welcome to our site! 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.

AC Wattmeter with P18F2550

Not open for further replies.


Member level 3
Aug 23, 2015
Reaction score
Trophy points
Nieuwpoort, Belgium
Activity points
This is a small project of mine: a single phase AC wattmeter.

This meter is built with as less as components possible. It is of course a little limited in range, accuracy and stability.
It is made for 230V~ (rms), max 2.5A~ (rms) and 50Hz, but is rather easily adaptable to other voltages, currents and frequencies. It can handle both sinusoidal and non sinusoidal voltages and currents, both with and without
DC component.

It measures:
the Rms voltage (unit: Volt)
the Rms current (unit: Ampère)
the apparent power consumption (unit: VoltAmpère: VA, the product of both the rms Voltage and the Rms current). This value is also called “Complex power”.
the real power consumption (unit: Watt) (= the one that you are going to pay for)
the power factor (no unit, ratio of real power to the apparent power), is the same as “cosΦ” (cos phi) for sinusoidal voltages and currents.
All values are shown on an LCD, except for the Apparent (Complex) power. The meter measures once per second.
Additionally there is one push button to set the “zero” point for the AD convertors. The values of these zero points are stored in Eeprom and recalled after startup of the PIC.

Important: A number of versions of the circuit diagram are presented in the .pdf file. A number of them are NOT MAINS ISOLATED. Be carefull!

View attachment WattMeter.pdf

Two versions of the software are added:
- one with simple 'delays' between measurements, and
- one with measurements in an interrupt routine.

View attachment
View attachment

The software is in Pascal, the compiler I use is the mikroPascal compiler.

I you have comments, please let me know.

Have fun!

Last edited:

Can you provide the complete circuit ?
No, I can not provide it.
I did power the PIC and LCD from batteries for my tests: 4 x 1.5V with an 1N4148 diode in series. This is the easiest method and recommended method with the non mains isolated version.
Of course a separate transformer with a rectifier, buffer condensator and stabiliser circuit will also do the job... If you want to achieve mains isolation with a transformer in the voltage measuring circuit, then do no use this one to feed the PIC/LCD also (see section 3.4.3 in the .pdf document).

The LCD connections (4 bits mode) can easilty be derived from the LCD connections stated in the code.

I have to come back on this:
This is the easiest method and recommended method with the non mains isolated version.
It is perhaps easy, but not recommended, because the stabilisation of the PIC power supply will not be good, the voltage will decrease over time. This will decrease the accuracy of the measurements...

Not open for further replies.

Part and Inventory Search

Welcome to