Using arduino with float switches

Hi,

I would like to use a float switch in an aquarium setup in order to detect overflow issues with the arduino, however, I'm not sure how to do the wiring.

The float switch has two wires and if I'm not mistaken, I'm supposed to measure the resistance using the arduino. Does anyone have experience with this sort of switches?

Many thanks!

I have some float switches that cost a piffling 70c. They are just a magnetic on/off switch and therefore work just like a press button on the Arduino. I think you might be referring to a probe that measures the resistance through the water, if there is any there, no float.

or is it like an automotive fuel level sender. those are variable resistor. if it is you can put a fixed resistor in series and measure the voltage change across the sender. +5V to resistor to sender to ground. analog input from junction of resistor and sender.

Are you using one of these switches?

then it is just an ON/OFF switch, so you won't be detecting the change in the water level.. instead, when the water reaches certain level the switch will turn from ON to OFF (or viceversa, depending if you place it upside down or not) and that's it.

So basically, you can say that you can think of these switches as a normal ON/OFF switch.
I think this link might help you: http://arduino.cc/en/Tutorial/DigitalReadSerial

That's what I'm talking about. They come in different lengths, all for about 70 cents, and all work the same. I'm sure that is all you need for a fish tank.