Creating an IoT Power Meter (Voltage/Current/Power)

If you don’t want to miss my updates, remember to check the public account in the upper right corner and mark it as a star, take a star and give it to me.

Creating an IoT Power Meter (Voltage/Current/Power)
Creating an IoT Power Meter (Voltage/Current/Power)

Power is an important parameter of power supply characteristics, and a power meter is an instrument for measuring active power. This is often encountered in hardware design work and in power supply questions in electrical competitions.

Speaking of power supply issues, with the increasing complexity and decreasing size of various electronic devices, power supply has become a major challenge on circuit boards. I would like to ask everyone, what is the biggest challenge you have encountered in your work? Scan the QR code in the picture below or click here to tell us >>>
Creating an IoT Power Meter (Voltage/Current/Power)

Long press to identify or scan to fill out

Back to this project, the project uses the INA219 current sensor to measure current, power, and energy, and displays it on an OLED display. It is transmitted over the network and displayed in the Blynk application. In the Blynk application, you can visually see the readings of voltage, current, power, and energy on a graphical display interface.

Components needed for the project:
  • Arduino Pro Mini 328 – 5V/16MHz

  • EPS8266 development board

  • INA219 current sensor, a zero-drift bidirectional current/power monitor with I2C interface from TI

  • 450mAh battery

Circuit diagram connection:
Creating an IoT Power Meter (Voltage/Current/Power)
The main project code has two parts: one for Arduino and one for ESP8266
First, the Arduino MCU is used to measure voltage, current, power, and energy data, and then display it on the OLED.
Then, the data is sent to the ESP8266 via serial communication. The ESP8266 receives the data and sends it to the Blynk server using its unique authentication code, and the data can be viewed and visualized graphically using the Blynk application.
The Arduino code is as follows:
#include <SoftwareSerial.h>#include <Wire.h>SoftwareSerial nodemcu(2,3);#include <Adafruit_INA219.h>#include <Adafruit_SSD1306.h>#include <SPI.h>long int data; 
#define OLED_RESET 4Adafruit_SSD1306 display(OLED_RESET);Adafruit_INA219 ina219;
unsigned long previousMillis = 0;unsigned long interval = 100;float shuntvoltage = 0;float busvoltage = 0;float current_mA = 0;float loadvoltage = 0;float energy = 0;
float sdata1 = 0; float sdata2 = 0; float sdata3 = 0;float sdata4 = 0; 
String cdata; 
void setup(){Serial.begin(9600); nodemcu.begin(9600);  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  ina219.begin();}
void loop(){  unsigned long currentMillis = millis();  if (currentMillis - previousMillis >= interval)  {    previousMillis = currentMillis;    ina219values();    displaydata();  }  if(nodemcu.available() == 0 )  {    sdata1 = loadvoltage;    sdata2 = current_mA;    sdata3 = loadvoltage * current_mA;    sdata4 = energy;

   cdata = cdata + sdata1+","+sdata2+","+sdata3+","+sdata4;    Serial.println(cdata);    nodemcu.println(cdata);   delay(1000);    cdata = "";   }}
void displaydata() {  display.clearDisplay();  display.setTextColor(WHITE);  display.setTextSize(1);  display.setCursor(0, 0);  display.println(loadvoltage);  display.setCursor(31, 0);  display.println("V");  display.setCursor(62, 0);    display.setCursor(75, 0);  display.println(current_mA);  display.setCursor(110, 0);  display.println("mA");  display.setCursor(0, 6);  display.println("--------------------"); 
  display.setCursor(101, 14);  display.println("A");  display.setCursor(108, 17);  display.println("b");  display.setCursor(114, 20);  display.println("i");  display.setCursor(120, 23);  display.println("d");   display.setCursor(0, 13);  display.println(loadvoltage * current_mA);  display.setCursor(57, 13);  display.println("mW");  display.setCursor(0, 23);  display.println(energy);  display.setCursor(57, 23);  display.println("mWh");  display.display();}
void ina219values() {  shuntvoltage = ina219.getShuntVoltage_mV();  busvoltage = ina219.getBusVoltage_V();  current_mA = ina219.getCurrent_mA();  loadvoltage = busvoltage + (shuntvoltage / 1000);  energy = energy + loadvoltage * current_mA / 3600;}
Blynk APP Setup
Blynk is a hardware-agnostic IoT platform with customizable mobile applications, private cloud, rule engine, and device management analytics dashboard. On the Blynk platform, you can create an application that can be published to Google Play or the App Store through visual drag-and-drop. Blynk has open-sourced several projects and supports over 400 hardware devices by default, many of which are open-source hardware.

To use Blynk, you need to register for an account, and then you can set it up.

Creating an IoT Power Meter (Voltage/Current/Power)

The project principle is simple, and the implementation difficulty is low, making it easy to measure parameters such as current, voltage, and power.

Creating an IoT Power Meter (Voltage/Current/Power)

Measuring power supply characteristic parameters sounds complex, but with a current sensor, everything becomes easy. Similarly, many power supply design challenges can be solved by choosing the right chip and design method. Regarding power supply courses, Darwin collaborates with TI to launch the [Power EMI Special Series Trilogy]

Part 1: EMI Basics: How much do you know about power supply EMI (already online, click here to watch the video >>>)

Part 2: Full record of the evaluation experiment of the power board LM25149-Q1 (coming soon)

Part 3: Step-by-step guide to creating a controllable digital power supply project (coming soon)

Project source: hackster.io
Creator: abid_hossain
END
Creating an IoT Power Meter (Voltage/Current/Power)
More practical project recommendations:
STM32 IoT Smart Home Project
Project sharing | Step by step using MATLAB + Raspberry Pi for face recognition
Raspberry Pi + Compute Stick 2 completes real-time face recognition project
Building a cloud computing platform for embedded development boards
STM32 achieves the simplest air mouse
Arduino Rubik’s Cube Robot
STM32 version of “AI Soul Painter”
STM32 electronic photo album production
STM32 + DDS homemade signal generator
Using Raspberry Pi and web interface to remotely control home appliances
STM32 “Cloud” Music Player
Raspberry Pi remote monitoring
Based on STM32 to achieve glow tube clock design
Homemade FPGA minimum system board (PCB can be directly made)
Raspberry Pi 4 builds NAS, making hard disks easy to connect to the network
ESP32 car software and hardware practical sharing
Only 79 lines of code to complete creative gesture recognition
IoT + electronic ink screen can create a custom display screen
Creating a road robot worth thousands for just a few dozen yuan
Glasses with naked-eye 3D holographic display, visual persistence POV project
DIY gesture recognition module
Practical small design that can be DIYed with zero foundation
Raspberry Pi builds a smart doorbell + smart door lock that can video
Strange! My development board can play games automatically
Homemade ventilator
ESP8266 + Zigbee networking to transform wall switches
Wireless home monitoring system
DIY bionic arm, a tool to free your hands
Purely handmade air purifier, all design materials are open source
Tech toy: Bluetooth artillery that can be remotely controlled
Using ST sensors to create the LittleBee monitoring system, making bees “talk”
Homemade cat teasing device
STM32 + Raspberry Pi achieve 6s Rubik’s Cube robot
Blindly modified drone controller, DIY “foam” drone

Make a smart relay without an arc using STM32

Make a practical new type necklace with just 5 components

The simplest method for heart rate measurement (suitable for secondary development)

Crack the magnetic levitation globe

The magical light can transmit video? Reveal the production process

STM32 homemade smart watch 60FPS animation

Salute to classic radios, watch the production process

DIY third eye: “special” glasses with Bluetooth/OLED/lens functions

Homemade solar charger that tracks the maximum power point

No MCU night vision goggles, just need to connect wires

The correct way to DIY a flow meter, an interest transformer

Homemade high-difficulty racing timer (lap/thermal printing)

DIY phone WIFI control LED dice

Gas burning power bank

Homemade simple Raspberry Pi security system

Using microcontroller + ESP8266 to build a small weather station

Ultra-mini & highly extensible palm machine car

Dream linkage, use Raspberry Pi to remotely develop microcontrollers

Automatic tracking + identifying pests and diseases plant protection robot

uECG realizes heartbeat LED light ring

Wireless smart high-power switch

Make an ESP8266 smart health watch from scratch

Gathering waste MCUs, turning waste into treasure

Pi Pico + Edge Impulse deployment of intruder detection system

DIY wifi signal strength detector

Complete real-time face recognition with Raspberry Pi in seven steps

Ultrasonic ranging disguised as radar

Recommended reading:
Project sharing | Electric competition series | Artificial Intelligence | Postgraduate entrance examination
Must-know knowledge points | Graduation design | Switch power supply | Job hunting
We are Nimo, the founder of Darwin, a girl who only talks about technology and not flirting. The Darwin online education platform aims to serve professionals in the electronics industry, providing skill training videos covering popular topics in various subfields, such as embedded systems, FPGA, artificial intelligence, etc. It also customizes layered learning content tailored to different groups, such as common knowledge points, disassembly evaluations, electric competitions/intelligent vehicles/postgraduate entrance examinations, etc. Welcome to follow.
Official website: www.darwinlearns.com
Bilibili: Darwin
QQ group: Group 1: 786258064 (full)
Group 2: 1057755357 (full)
Group 3: 871373286
Creating an IoT Power Meter (Voltage/Current/Power)

Leave a Comment

×