Using a voltage sensor with Arduino is a straightforward process. Voltage sensors are commonly used to measure the voltage of a power source or a specific circuit. Here are the general steps to connect and use a voltage sensor with Arduino:
Materials Needed:
Arduino board (e.g., Arduino Uno)
Voltage sensor module
Jumper wires
Power source (battery or power supply)
Jumper wires
Power source (battery or power supply)
Steps:
Understand Your Voltage Sensor: The Voltage Detection Sensor Module is a handy device that makes it easy to measure voltages higher than what your microcontroller can handle. It does this by using a potential divider to reduce the input voltage by a factor of 5. This means, with a microcontroller having a 0V — 5V Analog input range, you can effectively measure voltages up to 25V.
Connection:
- Connect the VCC pin of the voltage sensor to the positive terminal of the voltage to be measured (0-25V).
- Connect the GND pin of the voltage sensor to the negative terminal of the voltage to be measured.
- Connect the S (Signal) pin of the voltage sensor to the analog input pin on the Arduino (e.g., A0).
- Connect the – (minus) pin of the voltage sensor to the GND pin on the Arduino.
Write Arduino Code:
Open the Arduino IDE on your computer.
Write a simple code to read the analog voltage from the sensor.
Write a simple code to read the analog voltage from the sensor.
const int voltageSensorPin = A0; // Analog pin connected to the sensorfloat voltageValue = 0.0; // Variable to store voltage value
void setup() { Serial.begin(9600); // Initialize serial communication}
void loop() { // Read the voltage from the sensor int sensorValue = analogRead(voltageSensorPin);
// Convert the sensor value to voltage (assuming 5V reference and 0-25V input) voltageValue = (sensorValue * 25.0) / 1023.0;
// Print the voltage value to the serial monitor Serial.print("Voltage: "); Serial.print(voltageValue, 2); // Print with 2 decimal places Serial.println(" V");
delay(1000); // Delay for 1 second}
Upload the Code:
Connect your Arduino board to your computer using a USB cable.
Select the correct board and port in the Arduino IDE.
Upload the code to your Arduino.
Select the correct board and port in the Arduino IDE.
Upload the code to your Arduino.
Monitor the Output:
Open the Serial Monitor in the Arduino IDE to see the voltage readings.
The sensor will continuously read the voltage and display it on the Serial Monitor.
The sensor will continuously read the voltage and display it on the Serial Monitor.
To smoothly bring the Voltage Sensor into your Proteus simulations, just follow these easy steps to download and install the library. The download link is right below for a quick start. Integrating the Voltage Sensor is a breeze, and you only need a few clicks to include it in your circuit, allowing you to observe how it behaves alongside other components during your simulation.
1. Click on the provided link to download the Voltage Sensor Library .zip file.
2. Once you've unzipped the contents, you'll see two folders:
- LIB
- MODELS
3. Now, find your Proteus library folder on your computer. The default location might vary depending on your Proteus software version. If you're using Proteus 8 Professional, you'll likely find it here:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\LIBRARY
4. Open the Proteus Library Folder and simply paste the files from the LIB Folder (these are the ones you extracted from the Voltage Sensor Library Zip file).
5. Head over to the Proteus Model folder, usually hanging out in the same place as the Library Folder:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\MODELS
6. Within the Proteus Model Folder, copy-paste the files from the MODELS folder (these are also from the Voltage Sensor Library Zip file).
7. Once you've added these files, give Proteus a quick restart. And there you have it! The Voltage Sensor is now waiting for you in the Pick Device Window, all set for easy selection and integration into your simulation projects.
NOTE....⚠⚠⚠
For certain versions of Proteus, you might locate the DATA folder here:C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\DATA
Keep in mind that sometimes this folder (ProgramData) is hidden, so you may need to unhide it to access the specified location.
![]() |
Proteus DATA Folder Location |
Once you've added these files, restart Proteus. You'll now find the ASC712 Current Sensor right there in the Pick Device Window. It's ready for easy selection and integration into your simulation projects.
Download the Library: The ACS712 Modules Library for Proteus is available for download here.
Proteus Library : Voltage Sensor Module
ZIP Password : ArduinoMagix
ZIP Password : ArduinoMagix