Build a controlled water flow system (includes temperature)

Howdy guys,

I've worked on a few arduino projects. Thus saying only within the coding department and not the actual physical side of things.

What I am looking to build (Physically) is:
If the temperature of the water in the project is... (lets say too hot) a program using an if/else statement opens a valve (by a certain amount), to let more cold water into the project.

Vice versa - If the water in the project is too cold, it closes the water valve.

How would you do this project (Using arduino boards)

I know i need

An Electronic Controllable Valve (Hopefully 12v ish)
Power Supply Unit (Hopefully 12v ish)
And Thermostat (Either digital or analogue. More than likely digital)

Constructive help would be great. Including designs and arduino board types

Cheers

James

EDIT


Set Temperature = 60 Degrees.

So if the Temperature on the Temperature Gauge shows 65 Degress (Hotter than the Set Temp). The valve would open by a certain amount.

If the temperature on the Temp Gauge shows 60 Degrees (Perfect Temp = Do Nothing)

If the temperature on the Temp Gauge shows 55 Degrees (Cooler than the Set Temp). The valve would close by a certain amount.

After an argument the script would re-run.

It all depends on the volume of water and wich temperatures you are planning to work with.
I would go for a slightly different design:

  • Have a PID regulator control the heating. The heating element is preferably controlled by a SSR with zero crossing detection. Something that is common is using a "slow" PWM with a cycle time of maybe 10s this way you can get good accuracy in translating the output from the PID and a resonable respnse time. Of course the cycle time depend on the time constant of the system which in turn depends on the volume of water and the heating power.
  • Is there really any need for cooling? That is, are there any other processes in your system other than the heating element that transfer energy to the water? Or is there need to rapidly decrease the water temperature? If there is consider using a heat exchanger either to ambient air or to a other water body either standstill or flowing. The flow through the heat exchanger can then be controlled by a pump with variable rpm.

Since these kind of systems normally have time constants in the range from 10ths of seconds up to hours there are little demands on cpu power. Also the number of i/o's is limited. 1 input for reading the temperature sensor. 1 output for controlling the SSR. 1 output for controlling the pump. 2 outputs for controlling filling and emptying valves. 1 input for level sensor. Totally 2 inputs and 4 outputs.

first I would not pretend that any amount of control will work on a cheap valve.

but if I wanted to use a cheap valve, I would buy the smallest port valve I could find.
then I would make a test stand and run the valve and flow, paying more attention to incoming pressure than flow.
then move the valve in the smallest steps possible. PID on a cheap valve may never work.

what many who have tried this do not understand is that the final control element, the valve is mechanical and a signal to run the motor will spin the tiny DC motor up to it's 1,200 or so RPM and the whole slow gear train will spin up. then when the signal is removed, the motor will start to slow down and coast to a stop.

the motor and gear train will always shoot right past the expected point and keep right on moving.

I pulsed a valve, from full open to full closed with a delay of 3. IIRC, it took about 13 minutes from full open to full closed.

to test, I put the valve on the bench and sent a pulse out. it was a pulse with a delay that was 3 times longer so that the motor could come to a stop. at less than 1 second, and the motor never moved. 2 seconds seemed to work 100% of the time, but I did not like riding the knife edge. if I was to do that again, I would use smaller time slices, to see where the actual cut-of point was.

with that said, I would only use a proportional fuzzy logic.

if the flow is off the setpoint by less than 10%
pulse HIGH in the desired direction, with a delay of 3
duration off for 20 this would allow for the reading to change and the calculation to re-evaluate.

if the flow if off the setpoint by less than 20%
pulse HIGH in the desired direction with a delay of 3
duration off for 6

if the setpoint were off by more than 25%
pulse HIGH for 10
duration off by 6

then develop flow characteristics for the valve and adjust the settings.
you could change the windows, maybe add another
change the duration OFF to change the speed of response.

a pulse of 3 could move the valve by x, a pulse of 4 could change the valve by 2x getting the motor to a high enough speed to move the gears takes 1 unit of time. time to move the gears after that would be a full movement in a fraction of the time. this goes back to the non-linear aspects of the final control element.

since temperate is a very slow process, the next step would be to test valve movement and the change of temperature in the process.

the bit about the smallest valve is because a valve is not linear and you can get 90% of the flow at 20% of the opening in a wrong selection.

nilton61:
Since these kind of systems normally have time constants in the range from 10ths of seconds up to hours there are little demands on cpu power. Also the number of i/o's is limited. 1 input for reading the temperature sensor. 1 output for controlling the SSR. 1 output for controlling the pump. 2 outputs for controlling filling and emptying valves. 1 input for level sensor. Totally 2 inputs and 4 outputs.

even if you doubled the capacity, you would still only have 12 I/O pins.
the UNO family, mini/nano/micro, all have the same pin count as the UNO, just different forms.
I would stay with the USB interface of the UNO/NANO/MICRO
I like the UNO to develop as you can just drop on a shield and immediately get results.
I like the nano becase on a board layout, the pins are very close to a UNO. the micro/mini are close to the BasicStamp
the Nano/Micro offer a much smaller form factor as compared to the UNO.
other selections would be based on the accuracy. how close do you want to get the temperature ?

What about using a standard thermostatic valve and using the Arduino to adjust it?

...R

SkinnyBruv:
What I am looking to build (Physically) is:
If the temperature of the water in the project is... (lets say too hot) a program using an if/else statement opens a valve (by a certain amount), to let more cold water into the project.

Vice versa - If the water in the project is too cold, it closes the water valve.

Any particular reason to want an expensive proportional valve? Solenoid valves (on/off)
are much more convenient. You control the amount by the time you open the valve for,
much easier and more reliable (and cheap - every washing machine and dish-washer
uses them). Solenoid valves use mechanical amplification from the
water pressure and only work at a particular range of supply pressures, note.

If you are mixing water of different temperatures you'll need to ensure enough stirring
to guarantee proper mixing, because usually warm water just sits on top of cold water.

Thanks for the tips up, but i may have left a bit of crucial information out.

I'm not trying to mix the water, but instead there is only one water feed. This water feed then goes through a hot condensing unit.

If the water is not flowing fast enough the temperature rises. (This temperature cannot exceed 60 Degrees Celsius)

Hope this allows everyone to understand a tad more :smiley:

What I am trying to build is: To make the distiller more automatic by controlling the temperature output

So it's the cooling jacket of the condenser you're trying to regulate?

Firstly I would add another component to the system. Rather than trying to regulate the flow of the pressurised mains supply, I'd introduce a reservoir tank that is kept topped up by a ball cock.

Now rather than attempting to control the squirtiness of a valve, you can use a pump instead. This is much more controllable, If your return also goes back to the reservoir tank, it would also reduce the wastage of water.

A simple mosfet would allow you to control a pump pretty precisely.

KenF:
If your return also goes back to the reservoir tank, it would also reduce the wastage of water.

Pump is a good idea and the level of water in the reservoir can be controlled by a regular ball valve.
However feeding the warm water back into the reservoir will quickly use up the cooling capacity.

And motorized valves are readily available from plumbing suppliers - and might work out to be less trouble for a slightly higher price.

I had originally thought the OP was trying to make a mixer valve.

Is this a whiskey still?

...R

1 Like

Cheers guys, Its a multi-purpose still, it has been used for vodka but is going to be currently used for distilling a certain chemical for our uni project.

Soo should i go with a pump? (Even though there might be little water i need)

Now what arduino controllers would i use/you use?

SkinnyBruv:
Soo should i go with a pump? (Even though there might be little water i need)

Well ... have you checked to see what motorized valves are available?
have you considered using an on-off solenoid valve such as are used in washing machines?

...R

I've decided to use an analog valve. I cannot use a solenoid because its on/off, and would constantly be switching on/off to variate the flow