Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

Arduino based Wattmeter

By Ajish Alfred

This is a project based on Arduino board which can measure the power consumption of the devices. When we connect this wattmeter on to a device which is in operation, the 16*2 LCD displays its power consumption value in Watts. The project uses an Arduino pro mini board whose ADC feature is used along with the concept of Ohm’s law and Voltage Divider circuit to develop this Wattmeter.

Prototype of Arduino based Watt Meter

Fig. 1: Prototype of Arduino based Watt Meter 

Description

The entire project can be divided into three basic blocks;

1)      Power Sensor Unit

2)      Processor Unit

3)      Display Unit

Block Diagram of Arduino based Watt Meter

Fig. 2: Block Diagram of Arduino based Watt Meter

The Power Sensor Unit allows the current to flow through a device whose power consumption needs to be measured. The Sensor Unit produces two voltages, one is the Voltage output from the power supply and another one is a voltage which ranges from 0 to 5V. The difference between these two voltages is proportional to the amount of Current flowing through the Sensor unit.

The Processor Unit can take two input voltages both in the range of 0 to 5V. This unit takes the Sensor Unit’s output as input voltages and uses the ADC to read these voltages. An Algorithm is then applied to calculate the Power consumption of the device. The unit then sends a 4bit data to the Display Unit to display the power consumption in Watts.

The Display Unit takes the 4bit data from the Processor Unit and produces a 16*2 display for the current consumption of the device.

1)      Power Sensor Unit

The Power Sensor in this project is a single low valued resistor through which the current flows to the load device. The Voltage across the resistor and the current flow through the resistor are measured to calculate the Power consumption of the device.

In our project we implement resistor ‘R’ in the current flowing path whose resistance value is known. Then we measure the voltage at both the ends of the resistor to calculate the current flow with the help of the following equation.

I = (V2 – V1) / R

Circuit Diagram of Power Sensing Circuitry

Fig. 3: Circuit Diagram of Power Sensing Circuitry

We have selected  a value of R = 10 ohms, now the equation for calculating the power becomes;

I = V2 – V1 / 10

Once we obtain the value of current ‘I’, the power consumed by the device ‘P’ can be calculated using the following equation;

                                                                                               P = V2 * I                                                             

2)      Processor Unit

The processor unit in this project is the Arduino board and it uses the ADC module to read the output voltages V1 and V2 from the Sensor Unit. In the Arduino board we are using an 8 channel, 10 bit ADC with the reference voltage pin connected to 5 V. The ADC reads the voltage V1, V2 and generates an equivalent value ‘ValueADC‘at the ADC register. From this value the algorithmcalculates the voltages V1 and V2 and then the Power consumption.

Once the values of V1 and V2 are obtained the value of the current flow ‘I’ is calculated using the known values of R = 10 ohms, with the help of equation;

I = (V2 – V1) / 10

The Power consumption is then calculated using the equation;

P = V2 * I

The following piece of code calculates the power and displays it on the LCD.

dc_power = dc_current_I0 * dc_voltage_V1;

lcd.clear();

lcd.setCursor(0, 0);

lcd.print(dc_power);

lcd.print(” mW DC”);

 Display Unit & Code Explanation

3)      Display Unit

The Display Unit uses a standard 16*2 LCD on which the Arduino displays the Power consumption value. The LCD has been wired in four bit mode to reduce the number of output pins of the Arduino board to be used.

Image showing LCD Module used for displaying Resistance

Fig. 4: Image showing LCD Module used for displaying Resistance

Code Description

The code continuously read the ADC channels A0 and A2 one after the other, each time calculating the values of V1 and V2.When both the values of V1 and V2 are obtained,  the code then calculates the value of Power consumption of the device and that value is displayed on the 16*2 LCD.

The code running in the Arduino used the library function analogRead() to obtain the ADC value and lcd.print() to display the data on 16*2 LCD.

Flow Diagram of Arduino Code for Power Measurement

Fig. 5: Flow Diagram of Arduino Code for Power Measurement

Limitations:

The 10 ohm resistor is a high value compared to 0.05 ohm precision resistor inside a multi-meter.  More current flow more voltage get drop across the resistor, and that voltage drop is proportional to value of resistance. For current values above 500mA measurement, create a low resistance by connecting as many resistances in parallel as possible. Since the ADC of Arduinocan read a maximum of 5V only, don’t use a current source with voltage more than 5V.

Project Source Code

###


// include the library code:

#include

 

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

 

int adc_value = 0;

int voltage_peak_value = 0;

float voltage_average_value = 0;

float dc_voltage_V0 = 0;

float ac_voltage_V0 = 0;

float dc_voltage_V1 = 0;

float ac_voltage_V1 = 0;

float dc_current_I0 = 0;

float ac_current_I0 = 0;

float dc_power = 0;

float ac_power = 0;

unsigned long resistance;

unsigned long sample_count = 0;

 

void setup()

{

  // set up the LCD's number of columns and rows:

  lcd.begin(16, 2);

  // Print a message to the LCD.

  lcd.print("    EG LABS    ");

  pinMode(13, OUTPUT);

}

 

void loop()

{

 

//  Serial.println("=============================== VOLTAGE ========================================");

 

  voltage_peak_value = 0;

  for(sample_count = 0; sample_count < 5000; sample_count ++)

  {

      adc_value = analogRead(A0);

      if(voltage_peak_value < adc_value)

          voltage_peak_value = adc_value;

      else;

      delayMicroseconds(10);

  }

 

  dc_voltage_V0 = voltage_peak_value * 0.00488;

  ac_voltage_V0 = dc_voltage_V0 / 1.414;

 

   

//  Serial.println("================================ CURRENT ========================================");

 

  voltage_peak_value = 0;

  for(sample_count = 0; sample_count < 5000; sample_count ++)

  {

      adc_value = analogRead(A2);

      if(voltage_peak_value < adc_value)

          voltage_peak_value = adc_value;

      else;

      delayMicroseconds(10);

  }

 

  dc_voltage_V1 = voltage_peak_value * 0.00488;

  ac_voltage_V1 = dc_voltage_V1 / 1.414;

 

  dc_current_I0 = (dc_voltage_V1 - dc_voltage_V0) * 100;

  ac_current_I0 = (ac_voltage_V1 - ac_voltage_V0) * 100;

 

  //================================= POWER =========================================

 

  dc_power = dc_current_I0 * dc_voltage_V1;

  ac_power = ac_current_I0 * ac_voltage_V1; 

 

  lcd.clear();

  lcd.setCursor(0, 0);

  lcd.print(dc_power);

  lcd.print(" mW"); 

 

 //=================================================================================

 

  delay(1000);   

}

###

 


Circuit Diagrams

Circuit-Diagram-Arduino-Watt-Meter

Project Video


Filed Under: Electronic Projects

 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Renesas delivers intelligent sensor solutions for IoT applications
  • Microchip Technology releases AVR-IoT Cellular Mini Development Board
  • Qualcomm acquires Cellwize to accelerate 5G adoption and spur infrastructure innovation
  • MediaTek’s chipset offers high-performance option for 5G smartphones
  • Nexperia’s new level translators support legacy and future mobile SIM cards

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Tuning the antenna to be conjugately matched to input impedance of the die
  • about ATmega328 ADC pins
  • Netlist physical name update
  • nt1065_USB3 gnss receiver
  • LLC HB with synchronous rectifiers can be very dodgy?

RSS Electro-Tech-Online.com Discussions

  • PC/laptop working and processing so much harder when data is low quality
  • undefined reference header file in proteus
  • Capacitor to eliminate speaker hum
  • Decapped Chip On Board
  • Sony KV-A2913E (chassis AE1C) auto shuts off after one minute
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering