Level sensing methods

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

armstrong529

Member
Joined
Jan 14, 2014
Messages
8
Reaction score
0
Hi,

I'm in the process of building a electric brewing system. I will be running with an Arduino. I was just wondering what is the best method for measuring water levels. I want to be able to measure and set how much water is pumped from the HLT to the mash tank and so on. But for different recipes this may change so I don't want to just use float switches.
Thanks
 
Install 2 parallel stainless electrodes to your HLT tank (from top to bottom) and measure resistant. Higher water level gives you lesser resistance.
 
Install 2 parallel stainless electrodes to your HLT tank (from top to bottom) and measure resistant. Higher water level gives you lesser resistance.

Does that actually work? I would expect that the "resitance" of the fluid between the electrodes would be many times greater than that of the electrodes themselves - meaning the total resistance of the probes will not vary significantly with differing levels. I have seen this approach do for level switching at a set point but never level sensing for continous level monitoring.
 
Does that actually work? I would expect that the "resistance" of the fluid between the electrodes would be many times greater than that of the electrodes themselves - meaning the total resistance of the probes will not vary significantly with differing levels. I have seen this approach do for level switching at a set point but never level sensing for continuous level monitoring.

The conductivity (inverse of resistance) of the liquid will definitely change much, much more than the height of the liquid. You could probably "calibrate" this gauge by filling it to a known height, taking a measurement, then filling or draining from there. You'd have to do some serious math or do a bunch more tests from there to see how much the resistance drops as you fill. Still, the amount of dissolved solids will have a big effect on the conductivity of the solution so you'd have to adjust your setup every batch - and as you boil off water, the conductivity will change along with the level.

The resistance from two 1-foot sections of stainless rod will be very close to zero in relation to the water/mash/wort in between them. Even "poorly conducting" metals conduct well compared to sugar water.

There are capacitive level probes (typically switches, sometimes continuous transmitters) out there but they're tricky to work with even in industrial settings.

You may be better off with multiple level switches (say, one every gallon or so) and in that case, you could use conductivity. Otherwise, volume is the integration of flow rate over time so you could calibrate your pump (or get a positive displacement pump), or install a flowmeter (a gear type flow meter may not be *that* expensive - haven't tried to price them out for brewing applications).
 
If you are trying to use it for volume measurements. I have seen where people with the Brewtroller use a bubbler somehow to measure volume in the kettle.

A float works well as a safety to prevent the element from firing while the element is exposed. It won't work at telling you the volume of water though.
 
or install a flowmeter (a gear type flow meter may not be *that* expensive - haven't tried to price them out for brewing applications).

I have seen these used for the Kegbot project. I want to say a food safe flow meter was in the $40-60 range. Of course this won't help if there are any leaks in the system and won't tell you what is in the vessel following loss from boiling or general evaporation.
 
The conductivity (inverse of resistance) of the liquid will definitely change much, much more than the height of the liquid. You could probably "calibrate" this gauge by filling it to a known height, taking a measurement, then filling or draining from there. You'd have to do some serious math or do a bunch more tests from there to see how much the resistance drops as you fill. Still, the amount of dissolved solids will have a big effect on the conductivity of the solution so you'd have to adjust your setup every batch - and as you boil off water, the conductivity will change along with the level.

The resistance from two 1-foot sections of stainless rod will be very close to zero in relation to the water/mash/wort in between them. Even "poorly conducting" metals conduct well compared to sugar water.

There are capacitive level probes (typically switches, sometimes continuous transmitters) out there but they're tricky to work with even in industrial settings.

You may be better off with multiple level switches (say, one every gallon or so) and in that case, you could use conductivity. Otherwise, volume is the integration of flow rate over time so you could calibrate your pump (or get a positive displacement pump), or install a flowmeter (a gear type flow meter may not be *that* expensive - haven't tried to price them out for brewing applications).

Sorry you may have confused me, are you saying it won't work or it could work. Would the conductivity change depending on the amount of probe in the water?
But as (I think) you are saying theoretically it "would" work but practically it's not going to due to other variable changes that will effect the reading - wort composition, etc.

I have actually bough a cheap turbine flow meter that I am looking to trial to see if I can first measure flows and then if I can calculate volumes from that. I also want to see if I can preform flow control by PWM of my pump.
 
If you are trying to use it for volume measurements. I have seen where people with the Brewtroller use a bubbler somehow to measure volume in the kettle.

A float works well as a safety to prevent the element from firing while the element is exposed. It won't work at telling you the volume of water though.

I should really check for myself but...
Is the bubbler type affected by wort density?
Since the bubbler method is actually sensing a pressure and converting that to a level/volume then I would expect it to change. In fact for a 1.050 og beer the error would be just under 5%, for a big beer (1.100+) you would be over 9% error.
 
Sorry you may have confused me, are you saying it won't work or it could work. Would the conductivity change depending on the amount of probe in the water?
But as (I think) you are saying theoretically it "would" work but practically it's not going to due to other variable changes that will effect the reading - wort composition, etc.

I have actually bough a cheap turbine flow meter that I am looking to trial to see if I can first measure flows and then if I can calculate volumes from that. I also want to see if I can preform flow control by PWM of my pump.

I think that what he is saying that it would work but the biggest hurdle would be what is held in solution which could throw off readings. That said if you had a consistent water profile it could work in the HLT. Might not be very usable in other vessels. Too many variables which would impact the conductivity (resistance).
 
I should really check for myself but...
Is the bubbler type affected by wort density?
Since the bubbler method is actually sensing a pressure and converting that to a level/volume then I would expect it to change. In fact for a 1.050 og beer the error would be just under 5%, for a big beer (1.100+) you would be over 9% error.

Honestly I don't know much about it but I do know some people use them here and it is something mainly done over on the Brewtroller side. If you want more info on it take a look at this.

https://www.oscsys.com/projects/brewtroller/system-design/volume-measurement
 
Sorry you may have confused me, are you saying it won't work or it could work. Would the conductivity change depending on the amount of probe in the water?
But as (I think) you are saying theoretically it "would" work but practically it's not going to due to other variable changes that will effect the reading - wort composition, etc.

I have actually bough a cheap turbine flow meter that I am looking to trial to see if I can first measure flows and then if I can calculate volumes from that. I also want to see if I can preform flow control by PWM of my pump.

You interpreted me correctly. It might work, but probably won't be as accurate as you want. Turbine flow meter, assuming it doesn't plug from grain or hop bits, will probably work better. Good luck!
 
Thanks for replies. Yes I think a flow meter is the way to go. The lines between the tanks are well filtered, so hopefully clogging won't be an issue. I will just need to do some testing with flow rates etc.

Thanks again
 
I've a flow meter in my setup (an Arduino), but the problem is that the flow sensor gives different readings depending how fast or slow the flow is. I replaced it with a scale and that's been working very well. So, my vote goes to a scale, if you can fit it in your system.

There's a ready made library and AD-card for the Arduino: http://store.fut-electronics.com/SEN-W-03.html I used only the A-input and took the load cells from a cheap weight scale (Wheatstone bridge).

If you use kilograms and liters it's very easy to measure the grains with it too as 1L of water is 1kg.
 
I've a flow meter in my setup (an Arduino), but the problem is that the flow sensor gives different readings depending how fast or slow the flow is. I replaced it with a scale and that's been working very well. So, my vote goes to a scale, if you can fit it in your system.

There's a ready made library and AD-card for the Arduino: http://store.fut-electronics.com/SEN-W-03.html I used only the A-input and took the load cells from a cheap weight scale (Wheatstone bridge).

If you use kilograms and liters it's very easy to measure the grains with it too as 1L of water is 1kg.

Vesku, haven't seen anything from you since you left NZ! Good to see you are still brewing.
I did see yhat the cheap flowsensors are non-linear, was hoping that a little calibrating and post-script adjustment will get me right... well at least enough for the flow control if it works out.
 
...I was planning to go low tech with the new setup, but it all got out of my hands again...
Hahaha, yeah it's funny how hard it is to stop that happening, it almost kind of sneaks up on you :D
 
What Sennister said. Don't reinvent the wheel. Since you're using arduino, brewtroller already has the source code for using a pressure sensor.
 
I should really check for myself but...
Is the bubbler type affected by wort density?
Since the bubbler method is actually sensing a pressure and converting that to a level/volume then I would expect it to change. In fact for a 1.050 og beer the error would be just under 5%, for a big beer (1.100+) you would be over 9% error.

Yeah, the bubbler will be affected by gravity. If you know the gravity of whatever you are sensing, you can program that in, whether a user input, or edit the program and then reload it after measuring gravity. For strike water you can just use an approximation for water gravity at whatever temperature you are measuring it at.

Sent from my SAMSUNG-SM-G730A using Home Brew mobile app
 
I have seen people use load cells to measure weight and thus volume of the vessel. Use a cheap digital scale for the load cells.

If you have a well controlled water pressure and/or pump flow rate you could approximate volume based on time.
 
I will order a cheap digital scale. I think that the flow from my pumps may fluctuate to much. The control will be a lot more accurate with weight.
Thanks
 
Hahaha, yeah it's funny how hard it is to stop that happening, it almost kind of sneaks up on you :D

You can blame the Hamilton guys (MegunoLinkPro) for that, they made the PC-interface with the Arduino + touchscreen so easy to do that the rest of it sort of followed it... Sure would be nice to be there now, it's -30 degC here at the moment :ban:
 
Here's another way you might consider...I gravity feed my MLT into a 2qt grant. The MLT drain rate is set by a ball valve and it's a PITA to match the rate on the pump that pulls from the grant so I built a level sensing circuit that turns the pump on when the grant is almost full, then turns it off when the grant is almost empty.

I think your situation is even easier since you are not trying to maintain a level. You know your MLT geometry (assuming it's a uniform shape of a cylinder or rectangle). pi * r-squared * h will give you volume, so determine how high to set your sensor in the MLT by just solving for h. Now we know the height of the sensor.

My sensors are simple...two bare wires attached to a length of plastic to hold them. One wire goes to ground, the other is connected to an Arduino pin using a 1M ohm pull-up resistor and a 100nF cap between ground and the pin.

Here's the sketch:
Code:
/*******************************************************************
** This program will utilize a high and low level sensor system to *
** cycle a pump in order to maintain a specific volume range within*
** a vessel. The level sensors are comprised of a pair of wire ends*
** that will be shorted by the fluid to activate. The pump will be *
** operated by a relay. Version 1, 01/21/2014 by Mike Murphy       *
*******************************************************************/

/*******************************************************************
* METHODS                                                          *
* checkHighLevel()                                                 *
* checkLowLevel()                                                  *
* pumpStatus()                                                     *
*                                                                  *
* INPUTS                                                           *
* High Level Sensor -- Active = LOW (sensor shorted)              *
* Low Level Sensor -- Active = HIGH (sensor open)                   *
*                                                                  *
* OUTPUTS -- Active = HIGH                                         *
* Pump (via relay)                                                 *
* Status LED(s)                                                    *
*******************************************************************/

/********************************************************************
* OPERATION                                                         *
* At initialization the pump will be set to off (LOW). The          *
* checkHighLevel() method will determine whether fluid is in        *
* contact with the high sensor leads. If the sensor is wet (logic   *
* LOW), the pumpStatus is set HIGH, turning the pump ON. If         *
* fluid is not in contact with the sensor the method will end       * 
* and the checkLowLevel() method will be called. If the low sensor  * 
* is wet (logic LOW), the pump continues to run. If the low sensor  * 
* is dry (logic HIGH), the pump is shut off by setting the          *   
* pumpStatus to off(LOW). A delay will be initiated then the loop   * 
* start over.                                                       *
********************************************************************/
const int HighSensor = 2;     // High sensor assigned to pin 2
const int LowSensor = 3;      // Low sensor assigned to pin 3
const int Pump = 4;           // Pump assigned to pin 4
const int pumpLED = 5;        // Pump status LED assigned to pin 5

// Pull-up resistors keep the sensors HIGH (Normally Open Configuration)
int highSensorState = 0;      // status of high sensor (LOW is active)
int lowSensorState = 0;       // status of low sensor (HIGH is active)

void setup()
{
  Serial.begin(115200);
  pinMode(HighSensor, INPUT);
  pinMode(LowSensor, INPUT);
  pinMode(Pump, OUTPUT);
  pinMode(pumpLED, OUTPUT);
  Serial.print("Pin modes set....");
  digitalWrite(Pump, LOW);    // Initialize pump OFF
  digitalWrite(pumpLED, LOW); // pump status light OFF
}

void checkHighLevel()
{
  highSensorState = digitalRead(HighSensor);
  // if the sensor is wet, turn the pump on
  if (highSensorState == LOW)
  {
    digitalWrite(Pump, HIGH);
    digitalWrite(pumpLED, HIGH);
  }
}

void checkLowLevel()
{
  lowSensorState = digitalRead(LowSensor);
  // if the sensor is dry, turn the pump off
  if (lowSensorState == HIGH)
  {
    digitalWrite(Pump, LOW);
    digitalWrite(pumpLED, LOW);
  }
}

void loop()
{
  
  checkHighLevel();
  checkLowLevel();
  delay(2000);
}

In your case you would only need one pair of wires for a sensor since you are only interested in stopping the flow at a particular level. Because we use a pull-UP resistor, logic HIGH is the "open" condition for the sensor wire pair.
 
Back
Top