Voltage Sensor interfacing with Arduino
The Voltage Sensor is a simple module that can used with Arduino (or any other microcontroller with input tolerance of 5V) to measure external voltages that are greater than its maximum acceptable value i.e. 5V in case of Arduino. It is fundamentally a 5:1 voltage divider using a 30K and a 7.5K Ohm resistor. Voltage Sensor PINOUT
Schematic Diagram of Voltage sensor
Calculations Involved in the measurement are as follows:
Vout = (analogvalue * 5 / 1024).
Vin = Vout / (R2/(R1+R2)) or VCC
Here, R1 = 30000, R2 = 7500 ohm
Keep in mind; you are restricted to voltages that are less than 25 volts i.e VCC<25V. More than that and you will exceed the voltage limit of your Arduino input.
PINOUT DESCRIPTION PINOUT of voltage sensor
1. GND – This is where you connect the low side of the voltage you are measuring.
2. VCC: The is where you connect the high side of the voltage you are measuring
4. – (or minus): This connects to your Arduino ground.
5. + (or Plus): This is not connected. (It is an N/C Pin).

APPLICATIONS
1. DC measurement
2. Power measurement
3. Power quality measurement

Using a pre-built voltage sensor module is very easy and if you don’t have one then you can easily build one yourself. All you need are two resistors. If you want to make your own voltage sensor that can measure voltages up to 25V like this Voltage Sensor Module, then you have to get a 30KΩ and a 7.5KΩ resistor.
Voltage sensor connection with arduino How to interfacing Voltage Sensor With Arduino

``````int analogInput = A1;
float vout = 0.0;
float vin = 0.0;
float R1 = 30000.0;
float R2 = 7500.0;
int value = 0;
void setup()
{
Serial.begin(9600);
Serial.print("DC VOLTMETER");
}
void loop()
{