sensor-experiments

Objective

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

Required Components

No Ads Available.

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

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.

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!