PeterH:
I don't know anything about keeping fish or reef systems, but I'm surprised that it isn't possible to get a reliable float switch
Define "reliable".
A single float switch is pretty reliable. As in, thousands of cycles without malfunction. Good enough for many people in many applications.
But, in a reef tank (some of which contain, no exaggeration, years of effort and thousands of dollars of sensitive livestock), one failure in 10,000 is nowhere near acceptable. After losing a tank (I've lost two), you start thinking like NASA designing human-carrying spacecraft: 99.9999% reliability is the name of the game. I'll admit I'm a little more paranoid er, risk averse than many people though so I may go a bit over the top.
My current dual-float system works well enough, but I still have to clean the switches every month or two as a bacterial slime builds up and makes them sticky.
What are the capacitive sensing ones that go on the OUTSIDE of the tank?
I haven't seen any commercially. But it should be possible to make your own with two insulated wires glued parallel to each other over some length. Dunno if that length needs to be on the order of inches or feet though.
I dont know if the water level tape would work with salt water so i would have to research that. I also would have to worry about corrosion and calcium build up on it as well.
Yeah, saltwater is amazingly corrosive. I don't know that I'd trust the tape to hold up (and if it has copper inside, it's not getting anywhere near my water -- copper is deadly to most reef inhabitants!).
I was thinking of having the float switch turn the pump on and keep it on for like 30 or so seconds and then start the loop over again. Otherwise i think it would constantly going on and off. This will also help keep the salinity at an almost constant value instead of waiting until the system absolutely needs water and then adding two gallons of fresh at a time.
The cheap float switches I use are amazingly accurate. They have a sensitivity of a fraction of an inch, the water level stays very steady. Of course, I have a 1 gallon pico reef so you may get different results on a tank with more surface area.
My hardwired switches have no extra hysteresis, but the switches themselves do have a little bit of natural hysteresis. I have never experienced "flapping" or rapid on-off cycles except when I disturb the surface of the water. I'd say a few seconds of added software hysteresis for on-time and a few minutes for off-time would probably be fine.
I don't think it's necessary, but if you want more precise level control, use one switch for 'high' and one a few millimeters lower for 'low' and let your Arduino learn over time how to keep the water level steady (pump on time vs pump off time) without tripping either switch. The downside to this is you don't "exercise" the switches in normal operation so they're more likely to stick when you need them the most.
Or you can use an ultrasonic distance sensor aimed down at the surface and bypass the whole issue completely. I suspect an IR sensor would work too, but I'm not sure if it works well on the shiny water surface or not.
for an extra measure of safety i was thinking of having a float switch at the highest point of water acceptable. like a few inches above the normal so it would at most only add an extra gallon or two.
Having a third switch as a failsafe, mounted higher than your two main switches, is a good idea. LarryD's suggestion of having it hardwired (through a relay) and not through the Arduino is even better.