Module introduction:
This module is designed based on the principle of resistive voltage division, which can reduce the voltage input by the terminal interface by 5 times. The Arduino analog input voltage is greater than 5V, so the input voltage of the voltage detection module cannot be greater than 5V×5=25V (if 3.3V is used system, the input voltage cannot be greater than 3.3Vx5=16.5V). Because the AVR chip used by Arduino is 10-bit AD, the analog resolution of this module is 0.00489V (5V/1023), so the voltage detection module detects the input minimum voltage of 0.00489V×5=0.02445V.
Parameters:
Voltage Input Range: DC0-25V
Voltage Detection Range: DC0.02445V-25V
Voltage Analog Resolution: 0.00489V
DC Input Interface: The positive pole of the terminal is connected to VCC, and the negative pole is connected to GND
Output interface: "+" to 5/3.3V, " -"Connect to GND, "s" connect to Arduino's AD pin
reference code:
#include <Wire.h>
int val11;
int val2;
void setup()
{
pinMode(LED1,OUTPUT);
Serial.begin(9600);
Serial .println("Emartee.Com");
Serial.println("Voltage: ");
Serial.print("V");
}
void loop()
{
float temp;
val11=analogRead(1);
temp=val11/4.092;
val11=(int)temp;//
val2=((val11%100)/10);
Serial.println(val2);
delay(1000);
}