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
3. S: This connects to your Arduino analog input.
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
Make your Own Voltage Sensor
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.
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()
{
pinMode(analogInput, INPUT);
Serial.begin(9600);
Serial.print("DC VOLTMETER");
}
void loop()
{
// read the value at analog input
value = analogRead(analogInput);
vout = (value * 5.0) / 1024.0; // see text
vin = vout / (R2/(R1+R2));
Serial.print("INPUT V= ");
Serial.println(vin,2);
delay(500);
}