Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Hardware
    4. Hardware Vorschläge für gewichte messen <---versuch mit Mysensor

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Hardware Vorschläge für gewichte messen <---versuch mit Mysensor

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

      Hallo,

      ich möchte gerne ein Gewicht bis zu 5 KG mit dem IObroker messen, bzw darstellen. Hat einer von euch eine Idee welche Hardware ich dafür nehmen kann?

      Ich möchte eine Flasche befüllen aber diese halt unterschiedlich nach Gewicht.

      Gruß

      1 Reply Last reply Reply Quote 0
      • M
        mischaka last edited by

        Beliebige Waage umbauen
        Die Sensoren an HX711 Modul anschließen
        Arduino Bibliothek
        https://github.com/bogde/HX711

        Mit ESP8266 oder ESP32 per MQTT und WLAN an IObroker Daten senden

        Meine Arduino Beispiele für MQTT
        MQTT Taster ESP8266
        MQTT Bluetooth ESP32

        1 Reply Last reply Reply Quote 0
        • L
          ludino last edited by

          Hallo Mischaka,

          danke für deine Antwort, das ist schonmal ein guter Lösungsansatz. Besteht auch die Möglichkeit das HX711 Modul direkt an den PI anzuschließen wo IOBroker drauf läuft und die Werte in "Echtzeit" ohne MQTT abzufragen?

          Danke

          Ludino

          1 Reply Last reply Reply Quote 0
          • M
            mischaka last edited by

            @ludino said in Hardware Vorschläge für gewichte messen:

            HX711

            Hallo,
            Das hat Google als erstes gezeigt
            https://tutorials-raspberrypi.de/raspberry-pi-waage-bauen-gewichtssensor-hx711/

            1 Reply Last reply Reply Quote 0
            • L
              ludino last edited by

              Super danke, jetzt habe ich es so mal getestet,

              unter der PI Konsole kommen auch schon werte rein....!

              Jetzt ist nur die Frage wie bekomme ich sie in den Broker!
              Habe es nun mit dem RPI.adapter versucht nur da kommen nur true und false werte.

              Hat da jemand auch eine idee?

              Gruß

              1 Reply Last reply Reply Quote 0
              • L
                ludino last edited by ludino

                Hi,

                ich glaube ich bin nun etwas weiter gekommen.
                ich habe mysensor installiert.

                Im Log kommen auch daten rein aber diese als Warnung

                mysensors.0	2019-02-17 19:32:46.392	warn	Wrong serial data: Load_cell output val: 76.64
                mysensors.0	2019-02-17 19:32:46.141	warn	Wrong serial data: Load_cell output val: 76.64
                

                Aber unter Objekte kommen leider keine Werte rein, weiß da jemand rat?

                Gruß

                1 Reply Last reply Reply Quote 0
                • L
                  ludino last edited by ludino

                  Hat denn keiner Wirklich eine Idee dazu?

                  Ich es mittlerweile soweit verstanden das mein Sketch wahrscheinlich schuld ist, ich weiß aber nicht wieso. Ich habe den Sketch nun soweit geändert das ich die Fehler meldung im Log finde:
                  In den Objekten wird der wert unter den Namen angezeigt
                  objekt.PNG

                  ```
                  mysensors.0 2019-02-18 17:52:27.931 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.10\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:27.679 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.07\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:27.427 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.04\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:27.177 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.03\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:26.926 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.05\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:26.676 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.15\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:26.424 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.05\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:26.174 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.17\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:25.923 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.24\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:25.673 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.24\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 17:52:25.421 warn ID not found. Inclusion mode OFF: {"id":"Arduino_Nano","childId":"HX711","type":"presentation","ack":false,"payload":"0.16\r","subType":"S_WEIGHT"}
                  mysensors.0 2019-02-18 18:51:31.009 info Add new object: Arduino_Nano.HX711_WEIGHT - 0.00
                  mysensors.0 2019-02-18 18:51:30.989 info Connected
                  mysensors.0 2019-02-18 18:51:25.424 info Serial port opened
                  mysensors.0 2019-02-18 18:51:25.351 info starting. Version 1.2.2 in /opt/iobroker/node_modules/iobroker.mysensors, node: v8.15.0

                  
                  
                  [s=]![objekt.PNG](/assets/uploads/files/1550512466432-objekt.png)[/s] 
                  
                  Hier noch mein Arduino Sketch
                  
                  [s=]```//-------------------------------------------------------------------------------------
                  // HX711_ADC.h
                  // Arduino master library for HX711 24-Bit Analog-to-Digital Converter for Weigh Scales
                  // Olav Kallhovd sept2017
                  // Tested with      : HX711 asian module on channel A and YZC-133 3kg load cell
                  // Tested with MCU  : Arduino Nano, ESP8266
                  //-------------------------------------------------------------------------------------
                  // This is an example sketch on how to use this library
                  // Settling time (number of samples) and data filtering can be adjusted in the config.h file
                  
                  #include <HX711_ADC.h>
                  #include <EEPROM.h>
                  
                  //HX711 constructor (dout pin, sck pin):
                  HX711_ADC LoadCell(4, 5);
                  
                  const int eepromAdress = 0;
                  
                  long t;
                  
                  void setup() {
                    
                    float calValue; // calibration value
                    calValue = 696.0; // uncomment this if you want to set this value in the sketch 
                    #if defined(ESP8266) 
                    //EEPROM.begin(512); // uncomment this if you use ESP8266 and want to fetch the value from eeprom
                    #endif
                    //EEPROM.get(eepromAdress, calValue); // uncomment this if you want to fetch the value from eeprom
                    
                    Serial.begin(9600); delay(10);
                    //Serial.println();
                    //Serial.println("Starting...");
                    LoadCell.begin();
                    long stabilisingtime = 2000; // tare preciscion can be improved by adding a few seconds of stabilising time
                    LoadCell.start(stabilisingtime);
                    if(LoadCell.getTareTimeoutFlag()) {
                      Serial.println("Tare timeout, check MCU>HX711 wiring and pin designations");
                    }
                    else {
                      LoadCell.setCalFactor(calValue); // set calibration value (float)
                      //Serial.println("Startup + tare is complete");
                    }
                  }
                  
                  void loop() {
                    //update() should be called at least as often as HX711 sample rate; >10Hz@10SPS, >80Hz@80SPS
                    //use of delay in sketch will reduce effective sample rate (be carefull with use of delay() in the loop)
                    LoadCell.update();
                  
                    //get smoothed value from data set
                    if (millis() > t + 250) {
                      float i = LoadCell.getData();
                      Serial.print("Arduino_Nano;HX711;0;0;12;");
                      Serial.println(i);
                      t = millis();
                    }
                  
                    //receive from serial terminal
                    if (Serial.available() > 0) {
                      float i;
                      char inByte = Serial.read();
                      if (inByte == 't') LoadCell.tareNoDelay();
                    }
                  
                    //check if last tare operation is complete
                    if (LoadCell.getTareStatus() == true) {
                      //Serial.println("Tare complete");
                    }
                  
                  }
                  code_text
                  ```[/s]
                  
                  Vielen Dank im Vorraus für eure Mühen
                  1 Reply Last reply Reply Quote 0
                  • L
                    ludino last edited by ludino

                    Hi ich noch mal,

                    Ich habe ein neuen Sketch geschrieben, zurecht Kopiert:
                    Unten im Spoiler der Sketch, jetzt zu meiner Frage den arduino über Serial an einem Pi3 angeschlossen keine werte im Iobroker.

                    Auf einen Windows Rechner IObroker installiert angeschlossen und gleiche Sketch und zack es läuft.

                    Kann mir das jemand erklären?

                    ```#define MY_DEBUG
                    #define MY_GATEWAY_SERIAL
                    #define MY_BAUD_RATE (9600)
                    //#define MY_RADIO_NRF24
                    #define MY_NODE_ID 10
                    //#define MY_RX_MESSAGE_BUFFER_FEATURE

                    #include <MySensors.h>
                    #include <SPI.h>

                    #include "HX711.h"

                    #define DOUT 4
                    #define CLK 5

                    HX711 scale(DOUT, CLK);

                    float calibration_factor = -465000; //calcuated by trial and error; goal was to ensure Zero weight reading when no weight on the load cell

                    #define CHILD_ID_WEIGHT 1

                    unsigned long waitTime = 150; // delay in milliseconds to set time between data readings
                    float weight_read;

                    MyMessage msgVolume(CHILD_ID_WEIGHT, V_LEVEL);

                    void setup() {

                    scale.set_scale();
                    scale.tare();

                    }

                    void presentation() {

                    sendSketchInfo("Weight Sensor", "1.0");
                    present(CHILD_ID_WEIGHT, S_DUST,"Weight");

                    }

                    void loop()
                    {

                    data_calc();

                    {
                    send(msgVolume.set(weight_read, 3));

                    }

                    wait(waitTime); //Wait then back to loop

                    }

                    void data_calc() {
                    scale.set_scale(calibration_factor);

                    #ifdef MY_DEBUG

                    Serial.print("Reading: ");
                    Serial.print(scale.get_units(), 3);
                    Serial.print(" kg");

                    weight_read = scale.get_units();

                    Serial.print(" Weight Read by sensor: ");
                    Serial.print(weight_read, 3);
                    Serial.println();

                    #endif
                    }
                    code_text

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

                    Support us

                    ioBroker
                    Community Adapters
                    Donate

                    470
                    Online

                    31.7k
                    Users

                    79.8k
                    Topics

                    1.3m
                    Posts

                    hardware
                    2
                    8
                    907
                    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