Library: Voltage Sensor Proteus

The source code reads the scaled analog voltage from the sensor and mathematical reconstructs the original voltage value.

void zeroCross() // Delay for phase control delayMicroseconds(calculatedDelay); digitalWrite(TRIAC_PIN, HIGH); delayMicroseconds(50); digitalWrite(TRIAC_PIN, LOW); voltage sensor proteus library

If you do not wish to install a third‑party library or you want to understand the underlying principles more deeply, you can create your own “virtual voltage sensor” using basic components. This approach is also useful when a dedicated library for a particular sensor is unavailable. The source code reads the scaled analog voltage

Apply the test voltage to the input terminals of the sensor model. Example Arduino Code for Simulation Apply the test voltage to the input terminals

) to an analog pin on your simulated microcontroller, such as A0 on an Arduino Uno. Connect the module's ground pin to the Arduino's ground. Sample Arduino Code for Simulation

It reduces higher input voltages (up to 25V) to a range (0–5V) that a microcontroller like an Arduino can safely read through its analog pins.

Close all instances of Proteus and reopen the software to ensure the new components load. 5. Search and Use Open (Press 'P').