Level sensing methods - Page 3 - Home Brew Forums
Register Now For Free!

Home Brew Forums > Home Brewing Beer > Automated Brewing Forum > Level sensing methods

Thread Tools
Old 01-16-2014, 12:35 AM   #21
Feb 2011
Lievala, Kuusumu
Posts: 109
Liked 20 Times on 14 Posts

Originally Posted by mattd2 View Post
Hahaha, yeah it's funny how hard it is to stop that happening, it almost kind of sneaks up on you
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

Reply With Quote
Old 01-24-2014, 08:52 PM   #22
helibrewer's Avatar
Nov 2011
Santa Rosa, CA
Posts: 3,813
Liked 326 Times on 275 Posts

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:
** 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()
  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()
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.
Something is always fermenting....
"It's Bahl Hornin'"

Kegged: Bourbon Barrel Imperial Stout
On Deck: German Lager

Reason: spelling

Reply With Quote
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated volume sensing idea/help MrNatural Automated Brewing Forum 64 08-26-2015 01:34 PM
Capacititative sensing of liquid level alien Automated Brewing Forum 35 02-04-2014 01:57 AM
Low Cost, High Accuracy Temperature Sensing with a Thermistor alien Electric Brewing 5 04-30-2013 03:42 PM
BCS Level Sensing OneHoppyGuy Automated Brewing Forum 9 06-22-2012 09:27 PM
Electricians: help me swap out an arc sensing circuit breaker Coastarine Kegerators & Keezers 14 08-16-2009 12:25 AM

Forum Jump