Skip to content

Liquid Filling Machine – Liquid Filler Part 2

Now by using digitalWrite(RelayPin, LOW);
we set the relay to low
and by using the command digitalWrite(RelayPin, HIGH);
we are setting relay to high.

Now at the end we have added this self documented code :

  if (IsAutofilling == true){ //Autofill

    Weight = GetCurrentWeight();
    WeightTared = (Weight-Tare);
    TempString = WeightTared;
    TempString=TempString + "/";
    TempString=TempString + WeightLimit;
    TempString=TempString + "gr";

    if (WeightTared<WeightLimit){
      digitalWrite(RelayPin, HIGH);
    } else {
      digitalWrite(RelayPin, LOW);
      IsAutofilling = false;

  } else if (IsWeighting == true){ //Show Weight and tared weight

    Weight = GetCurrentWeight();
    WeightTared = Weight - Tare;
    TempString = Weight;
    TempString = TempString + "/tared";
    TempString = TempString + WeightTared;
    TempString = TempString + "gr";


The code can be downloaded from here: LiquidFillerPart2

Below you can watch a demonstration video.

Notice that the load cell works only one way. If you try to flip the load cell it is not sensible anymore.

So you have to find the working side of the load cell.

That's all for now.
In the next liquid filler article we will cover the kicad schematic and we will make the PCB.

Stay tuned !!!

1 thought on “Liquid Filling Machine – Liquid Filler Part 2

  1. Pingback: How To Connect Load Cell To Arduino? | Click & Find Answer !

Comments are closed.