Hi, A look at comparator chips is on the ArduinoInfo.Info WIKI HERE:
There are links to a tutorial and some circuits...