The Gravity I2C Digital Wattmeter (SKU: SEN0291) by DFRobot is a versatile and precise electronic module designed to measure electrical power in watts. It communicates using the I2C protocol, making it easy to integrate with microcontrollers, such as Arduino, Raspberry Pi, and other digital systems. This wattmeter is ideal for applications requiring real-time power monitoring, such as energy management systems, battery-powered devices, and IoT projects.
The following table outlines the key technical details of the Gravity I2C Digital Wattmeter:
Parameter | Specification |
---|---|
Operating Voltage | 3.3V - 5V DC |
Communication Protocol | I2C |
Measurement Range | 0 - 26V DC (Voltage), 0 - 3.2A (Current) |
Power Measurement Range | 0 - 83W |
Accuracy | ±1% |
I2C Address (Default) | 0x40 |
Dimensions | 42mm x 32mm |
Weight | 10g |
The Gravity I2C Digital Wattmeter has a 4-pin interface. The pinout is as follows:
Pin | Label | Description |
---|---|---|
1 | VCC | Power supply input (3.3V - 5V DC) |
2 | GND | Ground connection |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
Connect the Wattmeter to a Microcontroller:
VCC
pin to the 3.3V or 5V power supply of your microcontroller.GND
pin to the ground of your microcontroller.SDA
pin to the I2C data line of your microcontroller.SCL
pin to the I2C clock line of your microcontroller.Place the Wattmeter in the Circuit:
Configure the I2C Address:
0x40
. Ensure no other devices on the I2C bus share this address. If needed, refer to the DFRobot documentation for instructions on changing the address.Install Required Libraries:
Below is an example Arduino sketch to read voltage, current, and power data from the Gravity I2C Digital Wattmeter:
#include <Wire.h>
#include "DFRobot_Wattmeter.h"
// Create a DFRobot_Wattmeter object
DFRobot_Wattmeter wattmeter;
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
// Initialize the wattmeter
if (!wattmeter.begin()) {
Serial.println("Failed to initialize wattmeter. Check connections!");
while (1); // Halt execution if initialization fails
}
Serial.println("Wattmeter initialized successfully.");
}
void loop() {
// Read voltage, current, and power
float voltage = wattmeter.getVoltage(); // Voltage in volts
float current = wattmeter.getCurrent(); // Current in amps
float power = wattmeter.getPower(); // Power in watts
// Print the measurements to the Serial Monitor
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println(" V");
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
Serial.print("Power: ");
Serial.print(power);
Serial.println(" W");
delay(1000); // Wait for 1 second before the next reading
}
No Data Output:
SDA
and SCL
connections. Ensure no other devices on the I2C bus share the same address (0x40
by default).Inaccurate Measurements:
Wattmeter Not Detected:
Can the wattmeter measure AC power?
How do I change the I2C address?
What happens if the input exceeds the measurement range?
By following this documentation, you can effectively integrate and use the Gravity I2C Digital Wattmeter in your projects. For further assistance, refer to the official DFRobot resources.