Need help with components for coffee boiler autofill

Hi All

I'm replacing the controller on my coffee machine with an arduino as the Gicar box is dead and I'm looking to add extra functionality (touchscreen display showing dispense options and sensor outputs, gravimetric dispense control, wifi/bluetooth connectivity, etc. are on the [u]wish[/u] list).

I've stripped the electronics out of the machine and everything is currently controlled electro-mechanically with physical switches and at the moment I am looking to bring it back to factory functionality which involves reviving the autofill function that keeps the boiler topped up.

The autofill system consists of a conductive level sensor comprising a (probably steel) rod isolated from the copper boiler by a teflon gasket which makes a circuit when the water level touches the rod. The boiler itself is grounded. A single wire then travels from the top of the probe to the control box and connects up to a comparator. At this point I hold my hands up and admit I had not come across comparators before and I need help to understand how to best incorporate and utilise a comparator in my designs.

As I understand it a comparator has two inputs and compares the voltage of those inputs. It then puts out a signal of HIGH or LOW depending on which of the two inputs is greater. I think I have that correct but my difficulty starts with how to actually go about putting that into practice; what other components are required (resistors, diodes, etc.) if any are required?

Also as the system relies on the boiler earth, do I need to consider protecting the arduino board should something like the heating element (which is running at mains voltage) fail and go to earth through the boiler?

I understand that there is a comparator on my board (Arduino Mega) but (as i understand it) the software it uses is an interrupt which may not be ideal as I wouldn't want the boiler autofill to activate when the espresso shot is being dispensed.

If anyone can suggest an alternative that they think is better than the comparator please speak up!

we have to assume that before the brewing cycle, the tank is full. assuming a brewing cycle is complete,

once complete, there would be a respite that would allow a self diagnostic. at that point, check the level and fill.

once it is filled, you really do not need to test for fill again until after another brewing cycle. and in point of fact you DO NOT want to test for fill again until after another brewing cycle. lest there is a leak and the auto fill has to fill the whole kitchen.

as for level. if you have two electrodes. one protruding and on as the vessel. all you are looking for is any voltage across the gap. I would offer that any analog pin on the UNO would be able to detect that voltage.

here is a simple circuit https://www.youtube.com/watch?v=ZaTMvOyUzyo

or a more complex one https://www.youtube.com/watch?v=PkqEAMVBx_0