Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Monitoring electrical consumption is crucial for understanding energy usage and identifying opportunities for energy savings. Arduino, with its versatility and ease of use, provides an excellent platform for building a simple and effective electrical consumption monitor. This article will guide you through the process of creating a basic energy monitoring system using an Arduino board and a current sensor.
Examples:
To monitor electrical consumption with Arduino, you will need the following components:
Step 1: Set Up the Hardware
Connect the ACS712 current sensor to the Arduino:
If using a voltage sensor, connect it similarly to another analog input pin on the Arduino.
Step 2: Write the Arduino Code
Below is a simple Arduino sketch to read the current values from the ACS712 sensor:
const int sensorPin = A0; // Analog pin connected to OUT pin of ACS712
const float sensitivity = 0.185; // Sensitivity for ACS712 5A module (in V/A)
const float Vref = 2.5; // Reference voltage for ACS712
void setup() {
Serial.begin(9600); // Start serial communication
}
void loop() {
int sensorValue = analogRead(sensorPin); // Read the analog value
float voltage = (sensorValue / 1024.0) * 5.0; // Convert to voltage
float current = (voltage - Vref) / sensitivity; // Calculate current in Amperes
Serial.print("Current: ");
Serial.print(current);
Serial.println(" A");
delay(1000); // Wait for a second before next reading
}
Step 3: Upload and Test the Code
Step 4: Analyze the Data
The Serial Monitor will display the current values in amperes. To calculate power consumption, you can multiply the current by the voltage (Power = Voltage x Current). If you have connected a voltage sensor, you can read the voltage values similarly and use them for more accurate calculations.
Conclusion
By following these steps, you can create a basic electrical consumption monitor using Arduino. This project can be expanded by adding features like data logging, wireless communication, or integration with home automation systems for more advanced applications.