Ks0275 keyestudio Voltage Detection Module Voltage Sensor: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) |
||
Line 58: | Line 58: | ||
'''PDF File:''' <br> | '''PDF File:''' <br> | ||
https://drive.google.com/open?id=1c7K0bi70hBqNyDOZh2mJzq5P1EiH5a6X | https://drive.google.com/open?id=1c7K0bi70hBqNyDOZh2mJzq5P1EiH5a6X | ||
'''VIDEO:'''<br> | |||
http://www.keyestudio.com/wp/ks0275/ | |||
== Get One Now == | == Get One Now == |
Revision as of 14:04, 16 March 2018
Introduction
Since the current electronic products are various, the voltage of the power supply is also different. It is indeed necessary to detect it with a suitable voltage detection module and controller. The maximum detection input voltage of the controller analog interface is 5V, which means the voltage greater than 5V will not be detected. However, this voltage detecting module can achieve to detect the voltage greater than 5 V , designed on the basis of resistor voltage divider principle, which can make the input voltage of binding post interface narrow 5 times, and the analog input voltage is up to 5 V, thus the input voltage of voltage detection module is not greater than 5 V * 5 = 25 V (if using 3.3 V system, the input voltage is not greater than 3.3 V*5 = 16.5 V).
Since the AVR chip is 10-bit AD, the analog resolution of this module is 0.00489 V (5V / 1023), and the minimum input voltage of the voltage detection module is 0.00489 V * 5 = 0.02445 V. When 3P sensor connection cable plugs into sensor expansion board, it can not only easily detect the magnitude of the voltage power and monitor the battery-powered electricity of interactive media works or robot, but also can display the voltage and make a voltage monitor through IICLCD1602 LCD module.
Specification
- Working voltage :0V-25V DC
- Signal type: analog signal
Connection Diagram
Sample Code
int analogpin=0; // Define analogpin as analog port 0 int val,val5; //Define variables val,val5 int val2=0; //Define variables val2 int val3=0; //Define variables val3 int val4=0; //Define variables val4 void setup() { Serial.begin(9600); //Set baud rate of 9600 } void loop() { int val,val5; float val1; val=analogRead(analogpin); //Read the value of the analog port and assign it to the variable val val1=val/3.9; val5=(int)val1; val3=val5/100; val2=(val5%100)/10; val4=val5%10; Serial.print("$CLEAR\r\n"); //clear the screen Serial.print("$GO 1 1\r\n"); Serial.print("$PRINT Voltage:\r\n"); Serial.print("$GO 1 9\r\n"); Serial.print("$PRINT "); Serial.print(val3); //The serial port prints the value of the variable val3 Serial.print(val2); //The serial port prints the value of the variable val2 Serial.print("."); //The serial port prints out a point"." Serial.print(val4); //The serial port prints the value of the variable val4 Serial.println("V"); //The serial port prints out capital “ V” delay(100); //delay 0.1 second }
Result
Done as the above wiring, compile and upload the code, powered-on, then open the serial port monitor, it will print out the current detected voltage value shown below.
Resources
PDF File:
https://drive.google.com/open?id=1c7K0bi70hBqNyDOZh2mJzq5P1EiH5a6X
VIDEO:
http://www.keyestudio.com/wp/ks0275/
Get One Now
Official Website
http://www.keyestudio.com/keyestudio-voltage-detection-module-voltage-sensor.html