Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Gerät kallibrierung

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Gerät kallibrierung

    This topic has been deleted. Only users with topic management privileges can see it.
    • Aphofis
      Aphofis last edited by Aphofis

      @paul53
      Da kannst du mir bestimmt auch helfen!?
      Da die ADS1115 Karte am ESP leider nicht so funktioniert wie ich es mir erwünscht hatte, habe ich die Karte am Pi angeschlossen und die nötigen Programme im Pi installiert und über den i2c Adapter in Iobroker eingestellt und siehe da es funktioniert. Nur muss das ganze von Volt in TDS ppm umgerechnet werden.
      Ich habe einen Analog Datenpunkt über den i2c Adapter der eine Angabe von 0,003 Volt ausgibt.
      Kallibriert ist es ein Wert von 1 ppm (parts per million)
      Dann habe ich einen Datenpunkt erstellt wo der kallibrierte Wert eingetragen werden soll.
      Jetzt soll in der Steuerung 0,003 volt auf den Wert 1 gesetzt werden und anhand der Volt Zahl dann auch hoch gesetzt werden also muss ich testen wenn dann zb 0,006 volt ein Wert von 2 wäre das dann in der Steuerung die angleichung stattfindet. Das was ich mir erstellt hatte, triggert den Wert alle 10 sek nur denke ich das der Wert nicht hochgerechnet wird. Wie man das genau macht weiß ich nicht.

      Osmose Wasser 1 ppm mit TDS Handgerät gemessen
      TDS am Analog Anschluß 0,001825 Volt

      Cola 516 ppm mit TDS Handgerät gemessen
      TDS am analog Anschluß 1,164874 Volt

      Meerwasser 7158 ppm mit TDS Handgerät gemessen
      TDS Meter am analog Anschluß 2,443 Volt an

      Daraus lässt sich sicherlich eine Gleichung in der Steuerung erstellen.
      Dann hatt ich noch einen datenpunkt erstellt in dem millivolt errechnet wird da das dann vielleicht genauer ist aber ob das nötig ist weiß ich nicht.

      var Volt, kallibrierung;
      
      
      schedule("*/10 * * * * *", function () {
        Volt = getState("i2c.0.0x48.0").val;
        kallibrierung = 0.003 == 1;
        on({id: "i2c.0.0x48.0"/*0x48 Channel 0*/, change: "any"}, function (obj) {
          var value = obj.state.val;
          var oldValue = obj.oldState.val;
          kallibrierung = 1;
          if (Volt) {
            setState("Aqua_Control.0.Sensoren.TDS_Meter"/*TDS_Meter*/, kallibrierung, true);
          }
        });
      });
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @Aphofis last edited by paul53

        @Aphofis sagte:

        Daraus lässt sich sicherlich eine Gleichung in der Steuerung erstellen.

        Es wird lediglich ein Umrechnungsfaktor ppm/V gebraucht. Je nach Referenz:
        Osmose: 1 / 0.001825
        Cola: 516 / 1.164874
        Meerwasser: 7158 / 2.443

        Blockly_temp.JPG

        Aphofis 2 Replies Last reply Reply Quote 0
        • Aphofis
          Aphofis @paul53 last edited by

          @paul53
          Danke
          Das teste ich mal

          1 Reply Last reply Reply Quote 0
          • Aphofis
            Aphofis @paul53 last edited by

            @paul53 sagte in Gerät kallibrierung:

            @Aphofis sagte:

            Daraus lässt sich sicherlich eine Gleichung in der Steuerung erstellen.

            Es wird lediglich ein Umrechnungsfaktor ppm/V gebraucht. Je nach Referenz:
            Osmose: 1 / 0.001825
            Cola: 516 / 1.164874
            Meerwasser: 7158 / 2.443

            Blockly_temp.JPG

            Hab den Ausgabewert auf eine nachkomma stelle gesetzt bei 1 ppm zeigt der kalibrierte wert dan 1 ppm an
            tauche ich den sensor in salzwasser steht der wert auf 2,444 volt aber der kalibrierte wert bleibt bei 1 ppm stehen.

            paul53 1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @Aphofis last edited by paul53

              @Aphofis sagte:

              steht der wert auf 2,444 volt aber der kalibrierte wert bleibt bei 1 ppm stehen.

              Ist der Wert von 2.444 als Zahl im Trigger-Datenpunkt vorhanden ? Bau mal einen Debug-Block Wert in den Trigger ein.

              Aphofis 1 Reply Last reply Reply Quote 0
              • Aphofis
                Aphofis @paul53 last edited by

                @paul53
                Debug eingebaut
                Bildschirmfoto 2019-09-17 um 00.11.13.png
                Datenpunkt der geschrieben werden soll
                Bildschirmfoto 2019-09-17 um 00.06.45.png
                Datenpunkt vom i2c TDS Sensor Channel 0
                Bildschirmfoto 2019-09-17 um 00.06.06.png

                Aphofis paul53 2 Replies Last reply Reply Quote 0
                • Aphofis
                  Aphofis @Aphofis last edited by

                  Bei der Volt Zahl müsste der ppm Wert über 6000 ppm liegen.

                  paul53 1 Reply Last reply Reply Quote 0
                  • paul53
                    paul53 @Aphofis last edited by

                    @Aphofis sagte:

                    Datenpunkt vom i2c TDS Sensor Channel 0

                    Das sind 4 unterschiedliche Datenpunkte !

                    Aphofis 1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @Aphofis last edited by paul53

                      @Aphofis sagte:

                      Bei der Volt Zahl müsste der ppm Wert über 6000 ppm liegen.

                      Getriggert wird nur bei einer Änderung des Wertes. 2,444 / 0,003 = 815.

                      Aphofis 1 Reply Last reply Reply Quote 0
                      • Aphofis
                        Aphofis @paul53 last edited by

                        @paul53
                        nein nur Channel 0 ist ein TDS Meter angeschlossen die anderen schweigen still hatte ich nur einmal aktiviert dann haben die gleich werte angezeigt.

                        1 Reply Last reply Reply Quote 0
                        • Aphofis
                          Aphofis @paul53 last edited by

                          @paul53 sagte in Gerät kallibrierung:

                          @Aphofis sagte:

                          Bei der Volt Zahl müsste der ppm Wert über 6000 ppm liegen.

                          Getriggert wird nur bei einer Änderung des Wertes.

                          Der Wert ändert in den Komma zahlen ab und an nur ein Wert über 100 ist ja nicht korrekt ich glaube da ist irgendwie eine andere rechnung nötig. Das Modul bekommt 5 Volt und der Datenpunkt wird glaube ich gegen 3,3 Volt gemessen nur wie viel ppm 3,3 volt sind weiß ich nicht.

                          paul53 1 Reply Last reply Reply Quote 0
                          • paul53
                            paul53 @Aphofis last edited by

                            @Aphofis sagte:

                            wie viel ppm 3,3 volt sind

                            Mit dem Faktor 1 / 0,003 sind es 1000 ppm.

                            Aphofis 1 Reply Last reply Reply Quote 0
                            • Aphofis
                              Aphofis last edited by

                              Also debug Ausgabe sagt den Volt Wert des Channels null an wenn Wert ausgegeben werden soll im debug

                              1 Reply Last reply Reply Quote 0
                              • Aphofis
                                Aphofis @paul53 last edited by

                                @paul53 sagte in Gerät kallibrierung:

                                @Aphofis sagte:

                                wie viel ppm 3,3 volt sind

                                Mit dem Faktor 1 / 0,003 sind es 1000 ppm.

                                Wert steht bei 152 ppm mit 2,444 Volt

                                paul53 1 Reply Last reply Reply Quote 0
                                • paul53
                                  paul53 @Aphofis last edited by

                                  @Aphofis sagte :

                                  Wert steht bei 152 ppm mit 2,444 Volt

                                  Anderer Faktor ?

                                  Aphofis 1 Reply Last reply Reply Quote 0
                                  • Aphofis
                                    Aphofis @paul53 last edited by

                                    @paul53
                                    Naja die Werte habe ich ja aber einen korrekten Faktor finden ist wohl dabei nicht möglich
                                    wenn 1,16 volt einen wert von ca 500 ppm hat
                                    kann per rechnung ja nicht durch einen Faktor dann auf
                                    über 6000 ppm kommen bei 2,44 Volt
                                    Ich suche noch mal im Netz wie das zu errechnen ist.

                                    1 Reply Last reply Reply Quote 0
                                    • Aphofis
                                      Aphofis last edited by Aphofis

                                      @paul53
                                      vielleicht magst du mir dabei noch mal helfen.

                                      :-)
                                      

                                      Ich habe die Sensoren jetzt mal über den ADS1115 direkt am Pi4 angeschlossen Adress mit Gnd verbunden. den TDS Meter mit 5 volt versorgt und am Analog 0 am ADS1115 den Analog Sensor per i2c wird nun auch der ADS erkannt und angezeigtund siehe da die werte sind stabil.
                                      Nur muss ich jetzt die werte umrechnen und da ein wert viele nach komma stellen hat weiß ich nicht genau wie ich das realisieren kann.
                                      getestet und mit einem TDS Handgerät nachgemessen.
                                      2,435 Volt aind gegengemessen 5947 ppm
                                      0,5 volt sind 773 ppm und 0,0019 volt sind 0 ppm nur wie bekomme ich es jetzt hin das bei 0,0019 volt in dem Datenpunkt TDS kalibrierung dann der Wert 0 bei einer Volt Zahl von 0,0019 angezeigt wird da der Wert ja mehrere nachkommastellen hat. genau so wie der wert dann auf 1 sprint bei der jeweils höheren volt zahl.
                                      dh die Rechnung muss alles was unter 0,002 volt mist als 0 ppm anzeigen und alles was drüber ist muss errechnet werden.

                                      paul53 1 Reply Last reply Reply Quote 0
                                      • paul53
                                        paul53 @Aphofis last edited by

                                        @Aphofis sagte:

                                        bei 0,0019 volt in dem Datenpunkt TDS kalibrierung dann der Wert 0 bei einer Volt Zahl von 0,0019 angezeigt

                                        var ppm = Math.round(faktor * (spannung - 0,0019));
                                        if(ppm < 0) ppm = 0;
                                        
                                        Aphofis 1 Reply Last reply Reply Quote 0
                                        • Aphofis
                                          Aphofis @paul53 last edited by Aphofis

                                          @paul53
                                          Ich habe nun nach langem suchen im Internet herausgefunden das
                                          0,001 volt sollen 1 ppm sein also alles was unter 0,001 ist, ist dann ein ppm von 0 alles was drüber ist wäre dann zb 0,002 = ein ppm von 2 usw...
                                          Ist es auch möglich, das in ein Blockly zu verfassen!? ich schnalle es nicht. Ich hab versucht das nach zu bauen als Blockly nur ich scheitere irgendwie imme an diesem Javascript.

                                          Das ist bis jetzt mein Blockly und es sieht irgendwie unvollständig aus.

                                          <xml xmlns="http://www.w3.org/1999/xhtml">
                                            <variables>
                                              <variable type="" id=":Cq6B{~q8H[(J`mNBYDb">spannung</variable>
                                              <variable type="" id="np_ESNEK^(|%pWm2/+]g">ppm</variable>
                                              <variable type="" id="V=8^)5!TN`mJYTZyK?}/">faktor</variable>
                                            </variables>
                                            <block type="schedule" id="g0YOJMLZmMB,(4:F3OP;" x="-987" y="-312">
                                              <field name="SCHEDULE">*/5 * * * * *</field>
                                              <statement name="STATEMENT">
                                                <block type="variables_set" id="OF@^B`**2-LnK%m(Vjyt">
                                                  <field name="VAR" id=":Cq6B{~q8H[(J`mNBYDb" variabletype="">spannung</field>
                                                  <value name="VALUE">
                                                    <block type="get_value" id="#u^x(i~D};)XRQF_W}RN">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">i2c.0.0x48.0</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="gU]EFQoDCq7pZ_gXgsBV">
                                                      <field name="VAR" id="np_ESNEK^(|%pWm2/+]g" variabletype="">ppm</field>
                                                      <value name="VALUE">
                                                        <block type="math_arithmetic" id="`EtdUInhrJzLU5hYt.ni">
                                                          <field name="OP">MINUS</field>
                                                          <value name="A">
                                                            <shadow type="math_number" id="Sv!4Jvf@;/5af-4#^zd3">
                                                              <field name="NUM">1</field>
                                                            </shadow>
                                                            <block type="math_arithmetic" id="z+2C/OkD|}uE3=6MdUCz">
                                                              <field name="OP">MULTIPLY</field>
                                                              <value name="A">
                                                                <shadow type="math_number" id="hLvmB6l:PJjs[Z^6U6Lk">
                                                                  <field name="NUM">1</field>
                                                                </shadow>
                                                                <block type="math_round" id="tfFn8b$DIcK6UgYUQLE!">
                                                                  <field name="OP">ROUND</field>
                                                                  <value name="NUM">
                                                                    <shadow type="math_number" id="1rQ^liVvpA`qyoY-R+U0">
                                                                      <field name="NUM">3.1</field>
                                                                    </shadow>
                                                                    <block type="variables_get" id="ZTxPi1?TDqNx2q)2dc@[">
                                                                      <field name="VAR" id="V=8^)5!TN`mJYTZyK?}/" variabletype="">faktor</field>
                                                                    </block>
                                                                  </value>
                                                                </block>
                                                              </value>
                                                              <value name="B">
                                                                <shadow type="math_number" id="DJOGrbHj}ZjVO7X_N$%{">
                                                                  <field name="NUM">1</field>
                                                                </shadow>
                                                                <block type="variables_get" id="eAUxBI-D_8XA_6ZH7.RZ">
                                                                  <field name="VAR" id=":Cq6B{~q8H[(J`mNBYDb" variabletype="">spannung</field>
                                                                </block>
                                                              </value>
                                                            </block>
                                                          </value>
                                                          <value name="B">
                                                            <shadow type="math_number" id="ctchP~,SwZ)pZgY[TVQX">
                                                              <field name="NUM">0.0019</field>
                                                            </shadow>
                                                          </value>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="on_ext" id="avox)=chmrxdaDFRG-dy">
                                                          <mutation items="1"></mutation>
                                                          <field name="CONDITION">ne</field>
                                                          <field name="ACK_CONDITION"></field>
                                                          <value name="OID0">
                                                            <shadow type="field_oid" id=",C$d.ocnGPCx/k`IpXX8">
                                                              <field name="oid">i2c.0.0x48.0</field>
                                                            </shadow>
                                                          </value>
                                                          <statement name="STATEMENT">
                                                            <block type="controls_if" id="VF:wqhFGoKV@BQ$M#q/$">
                                                              <value name="IF0">
                                                                <block type="on_source" id="bLi3*73^M%Mwj2r{6A,t">
                                                                  <field name="ATTR">state.val</field>
                                                                </block>
                                                              </value>
                                                              <statement name="DO0">
                                                                <block type="variables_set" id="Wyc(F6WE.RunEojHKezU">
                                                                  <field name="VAR" id="V=8^)5!TN`mJYTZyK?}/" variabletype="">faktor</field>
                                                                  <value name="VALUE">
                                                                    <block type="variables_get" id="08@R%~?^RV-!rIklWyO-">
                                                                      <field name="VAR" id="np_ESNEK^(|%pWm2/+]g" variabletype="">ppm</field>
                                                                    </block>
                                                                  </value>
                                                                  <next>
                                                                    <block type="update" id="x4.IV.iv.PVA1(!0yqW8">
                                                                      <mutation delay_input="false"></mutation>
                                                                      <field name="OID">Aqua_Control.0.Sensoren.TDS_Meter</field>
                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                      <value name="VALUE">
                                                                        <block type="variables_get" id="pzGHpFx[]`e,Vi~G[dgB">
                                                                          <field name="VAR" id="V=8^)5!TN`mJYTZyK?}/" variabletype="">faktor</field>
                                                                        </block>
                                                                      </value>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </statement>
                                                            </block>
                                                          </statement>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </statement>
                                            </block>
                                          </xml>
                                          

                                          Bildschirmfoto 2019-12-30 um 02.11.57.png

                                          paul53 1 Reply Last reply Reply Quote 0
                                          • paul53
                                            paul53 @Aphofis last edited by

                                            @Aphofis sagte:

                                            0,001 volt sollen 1 ppm

                                            Dann wäre der Faktor 1000.

                                            Blockly_temp.JPG

                                            <xml xmlns="http://www.w3.org/1999/xhtml">
                                             <variables>
                                               <variable type="" id="V=8^)5!TN`mJYTZyK?}/">faktor</variable>
                                               <variable type="" id="np_ESNEK^(|%pWm2/+]g">ppm</variable>
                                             </variables>
                                             <block type="variables_set" id="Wyc(F6WE.RunEojHKezU" x="-913" y="-438">
                                               <field name="VAR" id="V=8^)5!TN`mJYTZyK?}/" variabletype="">faktor</field>
                                               <value name="VALUE">
                                                 <block type="math_number" id="0m(OXeOCW9rO-30mkfwz">
                                                   <field name="NUM">1000</field>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="on_ext" id="avox)=chmrxdaDFRG-dy">
                                                   <mutation items="1"></mutation>
                                                   <field name="CONDITION">ne</field>
                                                   <field name="ACK_CONDITION"></field>
                                                   <value name="OID0">
                                                     <shadow type="field_oid" id=",C$d.ocnGPCx/k`IpXX8">
                                                       <field name="oid">i2c.0.0x48.0</field>
                                                     </shadow>
                                                   </value>
                                                   <statement name="STATEMENT">
                                                     <block type="variables_set" id="gU]EFQoDCq7pZ_gXgsBV">
                                                       <field name="VAR" id="np_ESNEK^(|%pWm2/+]g" variabletype="">ppm</field>
                                                       <value name="VALUE">
                                                         <block type="math_round" id="tfFn8b$DIcK6UgYUQLE!">
                                                           <field name="OP">ROUND</field>
                                                           <value name="NUM">
                                                             <shadow type="math_number" id="1rQ^liVvpA`qyoY-R+U0">
                                                               <field name="NUM">3.1</field>
                                                             </shadow>
                                                             <block type="math_arithmetic" id="z+2C/OkD|}uE3=6MdUCz">
                                                               <field name="OP">MULTIPLY</field>
                                                               <value name="A">
                                                                 <shadow type="math_number" id="hLvmB6l:PJjs[Z^6U6Lk">
                                                                   <field name="NUM">1</field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="ZTxPi1?TDqNx2q)2dc@[">
                                                                   <field name="VAR" id="V=8^)5!TN`mJYTZyK?}/" variabletype="">faktor</field>
                                                                 </block>
                                                               </value>
                                                               <value name="B">
                                                                 <shadow type="math_number" id="DJOGrbHj}ZjVO7X_N$%{">
                                                                   <field name="NUM">1</field>
                                                                 </shadow>
                                                                 <block type="math_arithmetic" id="`EtdUInhrJzLU5hYt.ni">
                                                                   <field name="OP">MINUS</field>
                                                                   <value name="A">
                                                                     <shadow type="math_number" id="Sv!4Jvf@;/5af-4#^zd3">
                                                                       <field name="NUM">1</field>
                                                                     </shadow>
                                                                     <block type="on_source" id="bLi3*73^M%Mwj2r{6A,t">
                                                                       <field name="ATTR">state.val</field>
                                                                     </block>
                                                                   </value>
                                                                   <value name="B">
                                                                     <shadow type="math_number" id="ctchP~,SwZ)pZgY[TVQX">
                                                                       <field name="NUM">0.0019</field>
                                                                     </shadow>
                                                                   </value>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </value>
                                                       <next>
                                                         <block type="controls_if" id="VF:wqhFGoKV@BQ$M#q/$">
                                                           <value name="IF0">
                                                             <block type="logic_compare" id="}c[xQ`sZe/aF{]@BYlJW">
                                                               <field name="OP">LT</field>
                                                               <value name="A">
                                                                 <block type="variables_get" id="fPA|hiRl}%,`7Em[IH6w">
                                                                   <field name="VAR" id="np_ESNEK^(|%pWm2/+]g" variabletype="">ppm</field>
                                                                 </block>
                                                               </value>
                                                               <value name="B">
                                                                 <block type="math_number" id="??b[r*Ec(=X9.6H4ZUr[">
                                                                   <field name="NUM">0</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                           <statement name="DO0">
                                                             <block type="variables_set" id="mBUB~[vPgUW8@?SY3w=~">
                                                               <field name="VAR" id="np_ESNEK^(|%pWm2/+]g" variabletype="">ppm</field>
                                                               <value name="VALUE">
                                                                 <block type="math_number" id="XeuqyxxtJ%,$vqa0xu[F">
                                                                   <field name="NUM">0</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </statement>
                                                           <next>
                                                             <block type="update" id="x4.IV.iv.PVA1(!0yqW8">
                                                               <mutation delay_input="false"></mutation>
                                                               <field name="OID">Aqua_Control.0.Sensoren.TDS_Meter</field>
                                                               <field name="WITH_DELAY">FALSE</field>
                                                               <value name="VALUE">
                                                                 <block type="variables_get" id="08@R%~?^RV-!rIklWyO-">
                                                                   <field name="VAR" id="np_ESNEK^(|%pWm2/+]g" variabletype="">ppm</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </next>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </statement>
                                                 </block>
                                               </next>
                                             </block>
                                            </xml>
                                            

                                            Aphofis 1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            679
                                            Online

                                            31.9k
                                            Users

                                            80.3k
                                            Topics

                                            1.3m
                                            Posts

                                            2
                                            25
                                            1127
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo