- Akku Tests und Balkonkraftwerk Speicher         
Ergebnis 1 bis 10 von 25

Thema: ADC-Werte von 535 bis 550. ist das normal??

Baum-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #17
    Benutzer Stammmitglied Avatar von igelstein
    Registriert seit
    08.02.2011
    Ort
    pinnenhöfen 3
    Alter
    77
    Beiträge
    38
    Zitat Zitat von Richard Beitrag anzeigen
    Hast Du in simulations Code ganz oben en $SIM stehen?Gruß Richard
    nein, hab ich - noch - nicht. probier ich.
    für Tobika:
    Code:
    $regfile = "m32def.dat"
    $crystal = 8000000
    $baud = 9600
    $hwstack = 32
    $swstack = 10
    $framesize = 40
     Config Lcd = 16 * 2
     Config Lcdbus = 4
     Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.6 , Rs = Portc.4
       'Konfiguration entspricht der hardware vom evalboard Deltawave Atmega32
    Dim W As Word                                               'ADC-wert, zwischen 0 und 1023
    Dim Temp_ausgabe As Single
    Dim V_an_adc As Single
       'Messbereich ca 10°-90°
       '=>kalibrierung für ca 40°, Spannungsteiler R1(NTC R25=5k)[20°]: 6.247k, R2: 2,18k,
      Const Prescale_value = 0.0048828                            '5V/1024
    Dim Formel As Single
    Dim A As Single                                             'A, B, C: parameter für steinhart-hart-gleichung
    Dim B As Single
    Dim C As Single
    Dim R As Single
    Dim Lnr3 As Single
    Dim Blnr3 As Single
    Dim Widerstand As Single
     Led1 Alias Portb.0
     Led2 Alias Portb.1
     Led3 Alias Portb.2
     Led4 Alias Portb.3
     Led5 Alias Portb.4
     Led6 Alias Portb.5
     Led7 Alias Portb.6
     Led8 Alias Portb.7
     
     Config Led1 = Output
     Config Led2 = Output
     Config Led3 = Output
     Config Led4 = Output
     Config Led5 = Output
     Config Led6 = Output
     Config Led7 = Output
     Config Led8 = Output
      
    A = 0.002946983         'ABC-werte für 50° müssen erst in einer gleichung für 3 var berechnet werden (EXCEL-datei von mir)
    B = 0.000250322
    C = 0.000001374
    Config Adc = Single , Prescaler = Auto , Reference = Avcc
    Start Adc
    Do
       'Print "preScal = " ; Prescale_value
       W = Getadc(0)
                Locate 1 , 1 : Lcd "w =" ; W
                Print "w =" ; W
       V_an_adc = Prescale_value * W : Print "V_an_ADC= " ; V_an_adc       'Volt an ADC
                'Spannungsteiler:    Rx= R1*U / (U-U2) - R1 : Rx= 11 / (5 - U2) - 2,2
                'wobei U=Uges, R1=2,18k,  Rx gesucht, U2= w [aus Getadc(0)]
                   Widerstand = 5 - V_an_adc
                   Widerstand = 11 / Widerstand
                   R = Widerstand - 2.18 : Print "Widerstand (R)= " ; R
     
                                      'R1(NTC):R25=5k, R2 = 2,18k
                                      'Rx= R = 1 /{a + B * Log(R) + C *[log(R)] ^ 3} steinhart-gleichung (wiki), siehe unten
                                      'die ganzen prints waren kontrolle für UART
       Lnr3 = Log(r) : Print "log(R)= " ; Lnr3
       Formel = Lnr3 ^ 3 : Print "(log(R))^3= " ; Formel
       Formel = Formel * C : Print "(log(R))^3 * C= " ; Formel
       Blnr3 = B * Lnr3 : Print "b*log(R)= " ; Blnr3 : Print "A, B, C= " ; A , B , C
       Formel = Formel + Blnr3
       Formel = Formel + A : Print Formel
       Formel = 1 / Formel : Print Formel
       Temp_ausgabe = Formel - 273.15                           'Formel = Formel - 273.15
                                                                'Formel = Formel * 10
                                                                'Formel = Round(formel)
                                                                'Temp_ausgabe = Formel / 10
       Locate 2 , 1 : Lcd Temp_ausgabe ; ""
       If Temp_ausgabe > 10 Then
       Led1 = 1
    '...etc weitere LEDs
       Loop
    End
    hier jetzt einmal nur der code und die formel-links.
    bei bedarf EXCEL-berechnung für ABC-parameter (für andere widerstandswerte) anfordern.
    danke Euch und liebe grüße
    Marcel

    http://home.arcor.de/fuenfundachtzig/thermo/thermo.htm
    http://de.wikipedia.org/wiki/Hei%C3%9Fleiter
    http://www.elexs.de/kap2_4.htm
    Geändert von igelstein (20.03.2011 um 19:15 Uhr)

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

LiFePO4 Speicher Test