Measure Voltage using Voltage Sensor Module

Measure Voltage using Voltage Sensor Module

Objective

Learn how to measure voltage using a voltage sensor module and display the readings on the Arduino serial monitor.

Required Components

Working Principle

The voltage sensor module scales down the input voltage using a voltage divider, making it safe for the Arduino to read.

Circuit Diagram

Voltage Sensor Circuit Diagram

Arduino Code


const int voltagePin = A0;  // Voltage sensor connected to analog pin A0
float voltage = 0;

void setup() {
    Serial.begin(9600);  // Initialize serial communication
}

void loop() {
    voltage = analogRead(voltagePin) * (5.0 / 1023.0);  // Convert analog reading to voltage
    Serial.print("Voltage: ");
    Serial.print(voltage);
    Serial.println(" V");
    delay(1000);  // Delay 1 second
}
            

Results

The Arduino serial monitor displays the voltage values measured by the sensor.

Applications

Conclusion

Voltage sensor modules are ideal for measuring voltage in electronic circuits and projects.