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!