# Voltage sensor FZ0430

## Introduction

In this post we will show you how the voltage sensor FZ0430 works and how to use it to read the input voltage. This sensor can be useful for measuring the status of a battery or checking the power of a 12 or 24 V device.

## Specifications:

 Voltage Input Range DC (V) 0 - 25 V Max Input Voltage (V) 25 (Vcc = 5), 16.5 (Vcc = 3.3) V Voltage Detection Rang 0.02445 - 25 V Voltage Analog Resolution 0.00489 V

Connection

 INPUTS OUTPUTS GND. This is where you connect the low side of the voltage you are measuring. This is the same point as your Arduino ground. S. This connects to your Arduino analog Input. VCC. This is where you connect the high side of the voltage you are measuring +. Not connected (NC). -. This connects to your Arduino ground.

Example of use

## ```#define FZ0430 A1 //Define an analog input where we read V_out from the FZ0430 #define R1 30000.0 //Define the two resistors of the voltage divider #define R2 7500.0 float v_out, v_in; //Define variables v_out and v_in as a float void setup() { pinMode(FZ0430, INPUT); //Set pin A1 as Input to read the values from V_out Serial.begin(115200); //Set baud rate speed for the serial } void loop() { calculate_voltage(analogRead(FZ0430)); //Calculate voltage from de analog value of A1 Serial.println("Voltatge: " + String(v_in)); //Print de Input Voltage } void calculate_voltage(int16_t adc_v_out) { v_out = adc_v_out * (5.0/1024);//v = ADC_V_OUT * (Vcc/1024) v_in = v_out * ((R1 + R2) / R2); //Get the input voltage dividing by the voltage divider } ```

### Do you want more information?

Open Source technology allows you to develop your installations.

Just fill the form and we will contact you as soon as we can.