Campinggas/Gasflasche zum Kochen

Moin, gibt es hier mittlwerweile Umsetzungen, die zuverlässig funktionieren ?
So ein IPS-Gadget wäre echt charmant.

Ich habe das Thema bis auf weiteres aufgeschoben. Eine geeignete Lösung habe ich bisher nicht gefunden.

Ich finde das hier machbar:

http://www.waagen-online.de/waegezellen/plattform-waegezellen/plattformwaegezelle-h10a.html?gclid=CjwKEAiA_NmkBRCe3ubC1aWAtEcSJACxkkbqJGGtS9WA9oW9w3BwBUUBkzfk_U7XN3GRXj8Ys9VakhoCmCnw_wcB

da 2 Aluplatten drauf, Signal scheint analog zu sein - das machts eigentlich einfach. Weiß aber nicht, wie zuverlässig die sind und ob die mit Tara auf 0 gesetzt werden müssen (was es unbrauchbar machen würde, es sei denn, IPS schiebt die Flasche mit nem Motor hoch…)

Hm, ganz so einfach isses wohl auch nicht - aber damit:

http://www.dfrobot.com/wiki/index.php/Weight_Sensor_Module_V1

müsste es eigentlich gehen, für etwa 20€ auch bezahlbar. Alternativ schwebt mir eine Kofferwage vor, dessen Zeiger ich durch ein Poti ersetze …

Weil ich jetzt auch Gas-Griller bin hatte ich mir nochmal gedanken gemacht… zwar nichts richtig praktisches gefunden, aber ein Gedankenspiel wollte ich teilen, weil ich es mechanisch interessant fand:

Gasflasche wird über einen Hebel mit einer Behältnis als Gegengewicht verbunden. Dieses Behältnis wird mit Wasser befüllt, so das es genauso schwer ist wie die Flasche im vollen Zustand. Wenn jetzt Gas entnommen wird senkt sich die Flasche und das Behältnis hebt sich. Eine Mechanik wird so angebracht, das ein Ventil immer so lange geöffnet wird bis das Gewicht wieder ausgeglichen ist (Behältnis senkt sich wieder). Mit einem Pegel-Standsanzeiger im Behältnis kann man jetzt die Füllmenge ablesen und damit das Gewicht der Flasche samt Inhalt ermitteln…

ich weiß, unpraktisch, aber ich fand es witzig… :smiley:

Es gibt Neuigkeiten!

Was braucht man:

[ol]
[li]eine Personenwaage[/li][li]einen HX711 [/li][li]einen ESP-8266 (ich nutze einen WEMOS D1 mini[/li][/ol]
inspiriert von diesem Projekt habe ich mich nochmals mit dem Thema beschäftigt. Leider funktioniert das genannte Projekt nicht (mehr) … Code lässt sich nicht kompilieren und ich bin kein Profil im debuggen. Ich habe mich daher für dieses Projekt entschieden. Hier wird das Gewicht kontinuierlich gewogen und per MQTT an meinen Broker übermittelt.
Auch hier war der Code zu beginn verbuggt … das ging mir aber leicht von der Hand.

#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include "HX711.h" 

//Wifi Settings
const char* ssid = "my_WLAN";
const char* password = "*****";

//MQTT Settings
const char* mqtt_server = "10.10.10.10";
WiFiClient espClient;
PubSubClient client(espClient);

//Hardware Settings
#define DOUT  D2
#define CLK  D3
char msg_buff[50];


int switchPin = D5;
int switchValue;
HX711 scale(DOUT, CLK);
//Change this calibration factor as per your load cell once it is found you many need to vary it in thousands
float calibration_factor = 28.20; //28.20 worked for my scale 

//=============================================================================================
//                         SETUP
//=============================================================================================
void setup() {
  delay(100);
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(switchPin, INPUT_PULLUP);
  Serial.begin(115200);
  scale.begin(DOUT,CLK); //esp specific statment 
  Serial.println("HX711 Calibration");
  setup_wifi();
  client.setServer(mqtt_server, 1883);
  client.setCallback(callback);
  scale_setup();

  
}
void scale_setup() {
  client.subscribe("HX711cal"); 
  Serial.println("HX711 Calibration");
  Serial.println("Remove all weight from scale");
  Serial.println("After readings begin, place known weight on scale");
  Serial.println("Press a,s,d,f to increase calibration factor by 10,100,1000,10000 respectively");
  Serial.println("Press z,x,c,v to decrease calibration factor by 10,100,1000,10000 respectively");
  Serial.println("Press t for tare");
  scale.tare(); //Reset the scale to 0
  Serial.println("1. Tare erledigt! Warte 5 Sekunden.");
  delay(5000);
  scale.tare();
  Serial.println("2. Tare erledigt! Warte 2 Sekunden.");
  delay(2000);
  scale.tare();
  Serial.println("3. Tare erledigt!");
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
}

void setup_wifi(){
  delay(10);
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
}

void reconnect() {
  while(!client.connected()) {
    Serial.print("Attempting MQTT connection...");
    if (client.connect("ESP8266Client")) {
      Serial.println("connected");
      client.subscribe("HX711cal");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      Serial.println(" try again in 5 seconds");
      delay(5000);
      
    }
  }
}

void callback(char* topic, byte* payload, unsigned int length) {
   int i = 0;
  Serial.println("Message arrived:  topic: " + String(topic));
  Serial.println("Length: " + String(length,DEC));
  for(i=0; i<length; i++) {
    msg_buff[i] = payload[i];
  }
  msg_buff[i] = '\0';
  
  String msgString = String(msg_buff);
  
  Serial.println("Payload: " + msgString);
  if (msgString == "tare"){    // if there is a "1" published to any topic (#) on the broker then:
    digitalWrite(LED_BUILTIN, LOW);     // set pin to the opposite state 
    Serial.println("Switching LED");
    scale.tare(5);
    digitalWrite(LED_BUILTIN, HIGH);
  }
  else if (msgString == "+0.1")
     calibration_factor += 0.1;
  else if(msgString == "-0.1")
      calibration_factor -= 0.1;
  else if(msgString == "+1")
      calibration_factor += 1;  
  else if(msgString == "-1")
      calibration_factor -= 1;  
  else if(msgString == "+10")
      calibration_factor += 10;  
  else if(msgString == "-10")
      calibration_factor -= 10;
  else if(msgString == "+100")
      calibration_factor += 100;  
  else if(msgString == "-100")
      calibration_factor -= 100;  
}

//=============================================================================================
//                         LOOP
//=============================================================================================
void loop() {
  if (!client.connected()) {
    reconnect();
  }
  client.loop();

  float weight = scale.get_units(15);
  float rounded = round(weight) ;

  scale.set_scale(calibration_factor); //Adjust to this calibration factor
  switchValue = digitalRead(switchPin);
  Serial.print("Reading: ");
  Serial.print(weight);
  Serial.print(" g"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
  Serial.print(" calibration_factor: ");
  Serial.print(calibration_factor);
  Serial.println();
  Serial.println(switchValue);
  client.publish("Scale1",String(rounded).c_str(),true);
  client.publish("Debug",String(weight).c_str(),true);
  client.publish("HX711calfactor",String(calibration_factor).c_str(),true);
  if(switchValue == 0){
    digitalWrite(LED_BUILTIN, LOW);
    scale.tare(5);
    digitalWrite(LED_BUILTIN, HIGH);
  }
  
  
  

  if(Serial.available())
  {
    char temp = Serial.read();
    if(temp == '+' || temp == 'a')
      calibration_factor += 0.1;
    else if(temp == '-' || temp == 'y')
      calibration_factor -= 0.1;
    else if(temp == 's')
      calibration_factor += 1;  
    else if(temp == 'x')
      calibration_factor -= 1;  
    else if(temp == 'd')
      calibration_factor += 10;  
    else if(temp == 'c')
      calibration_factor -= 10;
    else if(temp == 'f')
      calibration_factor += 100;  
    else if(temp == 'v')
      calibration_factor -= 100;
    else if(temp == 't')
      scale.tare(5); //Reset the scale to zero    
    else if(switchValue == '0')
      scale.tare(5);  //Reset the scale to zero
  }
}
//=============================================================================================

Das Resultat kann sich sehen (und loggen, ich weiß nur noch nicht wie) lassen.

TXT: 02.02.2019 15:48:10.00 | RECEIVED | 0<FF><NUL><ACK>Scale10.00
HEX: 02.02.2019 15:48:10.00 | RECEIVED | 30 0C 00 06 53 63 61 6C 65 31 30 2E 30 30
TXT: 02.02.2019 15:48:11.00 | RECEIVED | 0<FF><NUL><ENQ>Debug-0.11
HEX: 02.02.2019 15:48:11.00 | RECEIVED | 30 0C 00 05 44 65 62 75 67 2D 30 2E 31 31
TXT: 02.02.2019 15:48:11.00 | RECEIVED | 0<NAK><NUL><SO>HX711calfactor28.20
HEX: 02.02.2019 15:48:11.00 | RECEIVED | 30 15 00 0E 48 58 37 31 31 63 61 6C 66 61 63 74 6F 72 32 38 2E 32 30
TXT: 02.02.2019 15:48:12.00 | RECEIVED | 0<FF><NUL><ACK>Scale10.00
HEX: 02.02.2019 15:48:12.00 | RECEIVED | 30 0C 00 06 53 63 61 6C 65 31 30 2E 30 30
TXT: 02.02.2019 15:48:12.00 | RECEIVED | 0<FF><NUL><ENQ>Debug-0.50
HEX: 02.02.2019 15:48:12.00 | RECEIVED | 30 0C 00 05 44 65 62 75 67 2D 30 2E 35 30
TXT: 02.02.2019 15:48:12.00 | RECEIVED | 0<NAK><NUL><SO>HX711calfactor28.20
HEX: 02.02.2019 15:48:12.00 | RECEIVED | 30 15 00 0E 48 58 37 31 31 63 61 6C 66 61 63 74 6F 72 32 38 2E 32 30
TXT: 02.02.2019 15:48:13.00 | RECEIVED | 0<CR><NUL><ACK>Scale1-1.00
HEX: 02.02.2019 15:48:13.00 | RECEIVED | 30 0D 00 06 53 63 61 6C 65 31 2D 31 2E 30 30
TXT: 02.02.2019 15:48:13.00 | RECEIVED | 0<FF><NUL><ENQ>Debug-0.96
HEX: 02.02.2019 15:48:13.00 | RECEIVED | 30 0C 00 05 44 65 62 75 67 2D 30 2E 39 36
TXT: 02.02.2019 15:48:13.00 | RECEIVED | 0<NAK><NUL><SO>HX711calfactor28.20
HEX: 02.02.2019 15:48:13.00 | RECEIVED | 30 15 00 0E 48 58 37 31 31 63 61 6C 66 61 63 74 6F 72 32 38 2E 32 30
TXT: 02.02.2019 15:48:15.00 | RECEIVED | 0<FF><NUL><ACK>Scale10.00
HEX: 02.02.2019 15:48:15.00 | RECEIVED | 30 0C 00 06 53 63 61 6C 65 31 30 2E 30 30
TXT: 02.02.2019 15:48:15.00 | RECEIVED | 0<VT><NUL><ENQ>Debug0.07
HEX: 02.02.2019 15:48:15.00 | RECEIVED | 30 0B 00 05 44 65 62 75 67 30 2E 30 37
TXT: 02.02.2019 15:48:15.00 | RECEIVED | 0<NAK><NUL><SO>HX711calfactor28.20
HEX: 02.02.2019 15:48:15.00 | RECEIVED | 30 15 00 0E 48 58 37 31 31 63 61 6C 66 61 63 74 6F 72 32 38 2E 32 30
TXT: 02.02.2019 15:48:16.00 | RECEIVED | 0<CR><NUL><ACK>Scale1-1.00
HEX: 02.02.2019 15:48:16.00 | RECEIVED | 30 0D 00 06 53 63 61 6C 65 31 2D 31 2E 30 30
TXT: 02.02.2019 15:48:16.00 | RECEIVED | 0<FF><NUL><ENQ>Debug-0.53