Go Down

Topic: home distillation project (Read 10995 times) previous topic - next topic


I can't tell from your code what your physical set up actually is, so I'm going to make some guesses.  You have a heating element that will raise the temperature of a fluid to the boiling point of alcohol and then hold it their until the temperature rises sharply (relatively) to indicate that you have distilled all the alcohol out.  For this, you only really need one thermometer in the column that measures the temperature of the distillate.  The fluid temperature will rise slowly to the BP of alcohol and then stay there for a while until the alcohol rises out of the fluid and through the condenser.  When the alcohol is gone, the temperature will rise sharply, at which point, shut it down and reload the boiling flask.

So, you only need to measure the temperature every second or so and you don't need to control the temperature as carefully as it would seem at first glance.  I would set up a timer at one or two second intervals (arduino time and TimeAlarm libraries) and check the temperature to control the power to a heating element.

Measuring temperature is a bit of an art, you usually have to smooth it out to prevent things like drafts or random conduction from causing erratic readings.  This is usually accomplished by reading the sensor several time and averaging the readings to get a single reading.  So it would be a series of analog reads in a row and then averaging them all into a single number.  Additionally, people keep a running average of these reading over time to smooth it even further; look for code that keeps a rolling or moving average over several readings.  This will smooth it out and give you a nicer temperature curve.

The timealarm library will help you with the complexity of the code because there will be no delays at all.  Set a timer to check, it will fire, you check and set a flag to do something in the loop code.  You will have a much simpler loop that will be easier to debug.
Something like:

Set a timer for every two seconds

if (flag)
  do something
  do nothing

  check temperature
  if (temperature < BP of alcohol)
     set flag for heater
     set flag for no heater

That kind of thing.


Thanks for the replies guys.

I did take a look at the 'brewtroller' ages ago, but I don't think it was really what I wanted. It's designed to control the process of kettle brewing
your own beer. I think I remember it having a temperature controlled flow valve of some sort though, so I will take another look at it.
My set-up is basically an urn with a small heating element which is switched on at the start with relay1 'HIGH'. It continues to heat throughout
the whole process until nearly all the alcohol has boiled out at about 93 degrees C, then relay1 will read 'LOW'. Temperature1 is a stainless steel
k-type probe which sits in the top of the still head to basically read the temperature of the distillate throughout the process. It is read by an Adafriut
max6675 breakout. Servo1 has a funnel attached and sits just under the outlet of the condenser. It pivots between three separate storage receptacles.The first is a 1 litre jug which has a float switch at about half way, when it (button) reads high, then servo1 pivots to the next (a 20 litre bucket) which stores the main body of the run until temperature1 reads 90' C, then servo1 goes to the next bucket to collect the tails end of the run until it shuts down. When temperature1 reads 65' C, relay2 reads 'HIGH' which turns on the cooling system, which consists of a large tub with a lid (about 60 litres), an old air-con condenser with a fan, a submersible aquarium pump and a servo controlled ball valve type tap (servo2). I made this tap out of a plastic garden irrigation tap which cost about $2 and mounted the servo to it. This system works perfectly. Hot coolant comes out  of the still at about 60' C and when it has flowed through the radiator it has cooled to about 15' C. I'm proud of that as you couldn't ask for much better. The aquarium pump provides a constant pressure.The servo tap (servo2) controls the flow of the coolant (water, or you could probably use glycol for better cooling). The position of servo2 is determined by temperature2 which is also a k-type probe and max6675 chip. Temperature2 probe is placed on the outside of the condenser at a position where I know that, at a certain temperature, the alcohol is condensing at an optimal rate. Each and every setup would be different for this part of the procedure and will have to be fine tuned, But that could be as simple as just moving the probe position a little. I know that some sort of PID  control would be best, but I have read that you cant do it with a servo unless you attach a potentiometer to it, and I don't want to have to do that if I can help it. I only want the servo to move in 5 degree intervals so I'm guessing
that it shouldn't be too jittery. You could also use a bilge pump type setup, but having a pump switching on & off to try & control the temperature I think would be harder to control. Same said for a solenoid tap, probably a little easier though but would require more wiring than my servo tap. As for switching the heating element on & off, I would prefer to avoid this also, as I think my small element would take too long to regain the heat and would slow the whole process down, which just isn't very efficient. Plus I don't like the thought of constantly toggling a high current device. I have a 16x 2 LCD to basically just monitor what is going on with temperature1 & temperature2. I can tell how the system is running from this. The arduino will control everything. I just want to be able to turn it on, then come back later and it's all done. At the moment I have to constantly check that its running ok, and that is a pain (long nights & lost sleep). Once this system is up and running, I have a pair of RF transmitter/receivers and a 'Nano' which I will use to make a small device with a 16x2 LCD, which with a quick button press whilst sitting inside, will tell me what the LCD on the master system is reading. I hope all this is enough to explain my setup so I can get some help with my code. Cheers for the help.


It is quite hard to read the long sequential list of if statements.
Try looking at the "case" statement, and consider nesting your if statements.
The structure of your program should make clear what you are trying to achieve, at the moment it does not. That is probably why people are reading but not responding.


Does anyone know if "Pioneer" was able to get the home distilling project automated with the arduino? I'm working on the same thing.

Go Up