you want some caps on the voltage regulator to smooth out any wonkyness from the wall supply and to filter out noise, and to prevent oscillation you also need a resistor on the base of the transistor, and one end of the coil is connected to the diode and nothing elsefinally I dont really know why you even need a micro controller, I have a similar setup with just a low current float switch and a relay
finally I dont really know why you even need a micro controller
eh what do I know, my original idea was just to cut the pump cord and let the two ends of the neutral wire sit in water, so when it got too low it would shut off the pump (I am watching too low of a level in a rank with a submersible pump pretty much same idea in different direction)but noooo, the managers wouldn't let me do that, we had to spend money *snark*
Thats what I am doing wire, switch and a relay, but the op has a good point as his situation involves a surface in motion (ie air bubbles and fish) so it would probably click on and off a bunch, with the avr in the mix you can use time delays and whatnot to dance around this problem.
Either add a pulldown resistor from the pin to ground, or else connect the float switch between ground and the pin, then you can enable the internal pullup resistor.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16