B25 Voltage Sensor DC0~25V [B125]




https://www.youtube.com/watch?v=cOpQqT2XffQ


* GitHubhttps://github.com/rdiot/rdiot-b125.git

* Specs

Voltage input: DC0-25V

Voltage detection range:DC0.02445V-25V

Voltage analog resolution:0.00489V


* Contents

- Connect

GND ----- GND

VCC ----- X

S ----- A1 


- Key Code

#include <Wire.h>

float val11; 

float 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;       

 Serial.print("analog:"+(String)val11+", "+(String)val11+"/4.092="+(String)temp);

 val11=temp;

 val2=((val11)*10)/100;       

 Serial.println(" =====> "+(String)val2+" V");          

 delay(1000); 

}

Posted by RDIoT
|