blog

Real-Time Voltage Monitoring with Arduino and a Voltage Detection Module

ykjmlmjp 4.3

Module Introduction

This module is designed based on the principle of resistance voltage division, which can reduce the input voltage of the terminal interface by 5 times. The maximum analog input voltage is 5V. Due to the use of an AVR chip, the analog resolution of the module is 0.00489V, and the minimum input voltage that can be detected by the voltage detection module is 0.02445V.

Why Use a Voltage Detection Module?

We usually use a multimeter to measure voltage, but it can only be used for temporary measurement and is not suitable for real-time voltage monitoring. The voltage detection module can work with an MCU to realize real-time voltage monitoring. At the same time, when the voltage is abnormal, it can report the abnormal status remotely. The cost of the voltage detection module is very low. A voltage detection module using the voltage division method only needs two resistors and necessary protective components to map a high voltage to the full range of the ADC.

Brief Introduction to Voltage Division Circuit

Voltage divider

Basic Voltage Division Formula for Ideal Resistors


Output voltage:
Vout = Vin · R2 R1 + R2

Product Parameters

Product Parameters
Parameter Specification
Voltage Input Range DC 0–25 V
Voltage Detection Range DC 0.02445–25 V
Voltage Analog Resolution 0.00489 V
DC Input Interface The positive terminal connects to VCC, and the negative terminal connects to GND.
Output Interface “+” connects to 5/3.3 V, “−” connects to GND, and “S” connects to the AD pin.

Pinout Introduction

Voltage Sensor Module 7

Output Interface → MCU
Module Pin MCU / Power
S <-> A1
+ <-> 3.3 V
<-> GND
DC Input Interface → Measured Voltage
Module Pin Measured Side
VCC <-> Measured Voltage Positive Terminal <25 V
GND <-> Measured Voltage Negative Terminal

Precautions

ADC acquisition requires code calibration. Because the hardware has inherent errors such as offset and gain, there are individual differences due to process influences. The reference voltage fluctuations of the external circuit and the tolerances of the voltage divider elements introduce system deviations. Changes in environmental temperature can also cause errors.

Hardware Connection

ykjmlmjp

Arduino code

				
					#include <Wire.h>

// Variables
int sensorValue;
float voltage;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  Serial.println("Voltage Monitoring System - A1 pin input");
  Serial.println("---------------------------");
}

void loop() {
  // Read analog value from A1 pin (0-1023)
  sensorValue = analogRead(A1);
  
  // Calculate actual voltage (assume 5x voltage divider, 5V reference)
  voltage = sensorValue * (5.0 / 1023.0) * 5.0;
  
  // Print full voltage value (2 decimal places)
  Serial.print("A1 pin voltage: ");
  Serial.print(voltage, 2);
  Serial.println(" V");
  
  // Delay 1 second
  delay(1000);
}

				
			

FAQ

The larger the voltage-dividing resistance, the more power-saving it is, but why is the reading unstable instead?

The source impedance is too large, so the ADC sample-and-hold capacitor can’t be fully charged within the sampling window, leading to low or fluctuating readings. You can either reduce the resistance, extend the sampling time, or connect a 10–100 nF small capacitor to the midpoint of the voltage divider.

The larger the voltage-dividing resistance, the more power-saving it is, but why is the reading unstable instead?

The source impedance is too large, so the ADC sample-and-hold capacitor can’t be fully charged within the sampling window, leading to low or fluctuating readings. You can either reduce the resistance, extend the sampling time, or connect a 10–100 nF small capacitor to the midpoint of the voltage divider.

Can it measure AC or pulsating voltage?

The voltage division itself is okay, but the ADC reads the instantaneous value. To read the "effective value", you need to add rectification and filtering, or use a dedicated RMS/power measurement chip. Remember to ensure isolation and safe spacing when directly sampling AC.

Video Presentation

Purchase Here

Leave a Reply

Your email address will not be published. Required fields are marked *