TOP Contributors

  1. MIKROE (2760 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139226 times)
  2. FAT32 Library (71732 times)
  3. Network Ethernet Library (57114 times)
  4. USB Device Library (47426 times)
  5. Network WiFi Library (43051 times)
  6. FT800 Library (42401 times)
  7. GSM click (29832 times)
  8. mikroSDK (28050 times)
  9. PID Library (26881 times)
  10. microSD click (26197 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Project

WattMeter (Power meter)

Rating:

5

Author: dany

Last Updated: 2016-02-18

Package Version: 1.0.0.0

Category: Measurement

Downloaded: 3366 times

Followed by: 4 users

License: MIT license  

This project is a power meter (Wattmeter).
It is made for 230V~ (nominal, rms), 2.5A~ (max, 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.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "WattMeter (Power meter)" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "WattMeter (Power meter)" changes.

Do you want to report abuse regarding "WattMeter (Power meter)".

  • Information
  • Comments (14)

Project Blog

This project is a Wattmeter (Power meter). Documentation.

Important Warnings! Safety issue. (Only for the non mains isolated versions)
All electrical parts of the meter are connected to the live mains supply. Do NOT touch any of those parts when the Watt meter is connected to the mains outlet.

Danger for Electrocution!


The wattmeter itself should be put in a well isolated encasement that will not allow
any touching of any part of it. Mind the LCD metal parts and switches/pushbuttons!


Do NOT connect the circuit to e.g. a PC (via Rs232 or USB or...) because it will lead to a
short circuit.


Do not use an external mains adapter to feed the Wattmeter (e.g. a mains adapter for
a USB device or mobile telephone). There is a danger of touching live mains supply
when touching the adapter or adapter cable.


The only safe choices to feed the wattmeter are
-  batteries inside the (isolated) wattmeter housing (mind the on/off switch!!).
-  a separate power supply (trafo, rectifier, stabilizer) fed from the mains supply,
   also inside the wattmeter housing (mind the on/off switch!!).

[end of Important warnings]

 

The power meter (Wattmeter) is made for 230V~ (nominal, rms), 2.5A~ (max, 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). 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). Same as cos phi for sinusoidal V and A.


All values are shown on an LCD, except for the Apparent (Complex) power.


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.

Have fun!

---------------------------------------------------------------------------------------------------------------------------------------------

2013-07-22:

- Changed the resistors in the 2 level shifters from 10K to 4.7K. This is done to keep the series resistor of the ADC inputs within specifications (<= 2.5K). Also R1 has changed due to the resistor change of the shifters.

- Added in the documentation how to adapt the meter for other voltages, currents, etc...

-------------------------------------------------------------------------------------------------------------------------------------------

2013-07-27: Change in the circuit diagram: added overvoltage protection diodes to the PIC inputs.

---------------------------------------------------------------------------------------------------------------------------------------------

2013-07-29: Added the "Vdd' constant in the code to make PIC voltage changes easier. Updated also the documentation.

--------------------------------------------------------------------------------------------------------------------------------------------

2013-07-30: Added the mB for PIC version.

---------------------------------------------------------------------------------------------------------------------------------------------

2013-08-07: Added documentation about modifications needed for higher currents than 2.5A~rms:

- The method with a dedicated current sensor IC

- The method with a series resistor and an extra amplifier

---------------------------------------------------------------------------------------------------------------------------------------

2013-08-08: added the "Mains Isolation" expansion in the documentation.

---------------------------------------------------------------------------------------------------------------------------------------
2013-08-10: Made some small corrections to the documentation .pdf file.

-------------------------------------------------------------------------------------------------------------------------------------------

2013-08-12: Changed the LCD declarations from "RB2_bit..." to "LatB2_bit...".
 Thanks Helmut! (http:'www.mikroe.com/forum/viewtopic.php?f=97&t=55669&start=13)


2014-09-04: Corrected an error in the eeprom storage of the current offset. Sorry for the inconvenience.     

EeProm_write(3, Hi(VOffset)); // <----- should be "EeProm_write(3, Hi(AOffset));"


2014-09-09: added a version with measurements (ADC readings) under timer interrupt. The accuracy of the measurement timing is no longer influenced by the main loop speed or the ADC conversion time here.  

 

ALSO FROM THIS AUTHOR

PID Library

25

PID library with fixed calculation time interval. A PID Usage example is added. Octal delivered the mB and an mC version.

[Learn More]

Seven Segment

5

Library to drive 4 seven segment digits with common anode. High level routines are provided, next to the low (raw) level ones. Nothing fancy...

[Learn More]

Schedulers

11

Scheduler (in a broad sense) related libs:
"Timebase"
"Timers"
"COS"
"COS_TimedOnly"
"StateMachine"
"StateMachine_2"

[Learn More]