TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139566 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57255 times)
  4. USB Device Library (47615 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42566 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26933 times)
  10. microSD click (26309 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: 3370 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

Keypad_I2c

10

Library for a 4x4 keypad connected to the PIC via an PCF8574 I2c expander (Two I2c lines in stead of 8 I/O pins). This saves a lot of PIC I/O pins. Permits also small PIC's (with low pin count) to control a keypad.

[Learn More]

Article: the mP for PIC "Make" process.

5

Describes relations between the Project Manager, Library Manager, Uses Clauses, Package Manager etc... important to build a project successfully.

[Learn More]

Utilities

26

Several utility libraries: - String Utilities, - SDMMC Utilities, - Bit Utilities, - (standard) Pascal Funtions, - Assert functions, - UartUtils, - Button utilities. - CRC routines

[Learn More]