Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: 14,5 V voltage divider

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    2

    14,5 V voltage divider

    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

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,365
    AFAIK, max voltage for Teensies ADC is 3.3 V if external reference set or 1.2 V if internal reference chosen.
    All voltage above 5 V will kill at least analog port of TLC and T3.6.

  3. #3
    Junior Member
    Join Date
    Mar 2019
    Posts
    2
    Thx...Then I have to recalculate voltage divisor to 3,3 volt Vin,..to assure no damage will be,...isnt??
    R1=100 kOhm R2= 29,72 kOhms Vin= 3,3 Multiplicator =4,33 3.3V / 1023 = 0,003225806452
    //
    int x=0;
    float voltios;
    void setup(){
    Serial.begin(9600);
    }
    void loop(){
    voltios = (analogRead(A0))*0,00322581*4,33;//Convierte lectura analogica en voltios
    x=voltios; //Guarda valor de voltios como entero
    if (voltios<=6,6)
    {
    digitalWrite(6, HIGH); //Si el valor de voltios es menor de 6,6 se enciende el led
    Serial.println(x); //Imprime el valor en el puerto serie
    }
    }
    Thx.
    Last edited by inigohe; 03-11-2019 at 09:07 AM. Reason: Replace data...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •