Best regards from Spain...ç
Thx for let me take part into your community. I have a little question about voltage dividers and power supplies higher than 5 volts.
Im trying to make an script who reads the voltage of a 18650 battery pack, with a voltage divisor, but im not sure if will be posible ....if the Vin in more than 5 volts,...
I used two resistors 100 KOhm and 53 kOhm y serial
and the led of the teensy will be used then the idea is to show each lecture in serial port of TeensyDuino IDE.
The script I did is:
//
int x=0;
float voltios;
void setup(){
Serial.begin(9600);
}
void loop(){
voltios = (analogRead(A0))*0.004887585533*2.886;//Convierte lectura analogica en voltios
x=voltios; //Guarda valor de voltios como entero
if (voltios<=3)
{
digitalWrite(6, HIGH); //Si el valor de voltios es menor de 3 se enciende el led
Serial.println(x); //Imprime el valor en el puerto serie
}
}
//
Thx a lot for your response.
inigohe
Thx for let me take part into your community. I have a little question about voltage dividers and power supplies higher than 5 volts.
Im trying to make an script who reads the voltage of a 18650 battery pack, with a voltage divisor, but im not sure if will be posible ....if the Vin in more than 5 volts,...
I used two resistors 100 KOhm and 53 kOhm y serial
and the led of the teensy will be used then the idea is to show each lecture in serial port of TeensyDuino IDE.
The script I did is:
//
int x=0;
float voltios;
void setup(){
Serial.begin(9600);
}
void loop(){
voltios = (analogRead(A0))*0.004887585533*2.886;//Convierte lectura analogica en voltios
x=voltios; //Guarda valor de voltios como entero
if (voltios<=3)
{
digitalWrite(6, HIGH); //Si el valor de voltios es menor de 3 se enciende el led
Serial.println(x); //Imprime el valor en el puerto serie
}
}
//
Thx a lot for your response.
inigohe