Hello,
I made an ATO system with two float sensors, a Raspberry Pi, and a solid state relay board. I wanted to log fills to a database so that irregularities could be detected and I would be notified. I also wanted more than a purely mechanical system so that I could try to prevent flooding due to stuck floats.
I have a lower and upper float. If the lower float sinks too far, the script will check the last fill time and if it was long enough ago, it will turn on the pump. Every second it will read the sensor to see if it has lifted. After it lifts up, the pump will run for one more second and stop. It is set to run no more than 10 seconds at a time, no more than once per hour (for now). If the water level goes low before an hour has passed, or the pump runs longer than 10 seconds without lifting the lower float, I am going to have it send an email to me.
The upper float switch is between the 3.3v signal to run the pump and the pump relay. This is so that if the upper float switch is lifted, it will cut off power to the relay and shut the pump off. I also ran a wire from the relay side of the switch to an input pin on the Raspberry Pi so that I can log if this occurs, telling me that the low sensor got stuck. Also if the Pi crashes and the pump gets stuck on, the upper float will cut power to the relay and shut it off.
For the lighting I can set the sunrise time, sunset time, length of sunrise, length of sunset, and maximum intensity. For instance I can set it to start sunrise at 6 am, ramp up to full intensity over 3 hours, then ramp down to 0 over 3 hours, starting at 4 pm. I also turn on the dusk/dawn lights during sunrise and sunset, and the moonlights at night. I am considering adding in the ability to retrieve sunrise/sunset and moonrise/moonset times from any location and have it use those. I might not do this since equatorial sunset times don't change that much. I am also planning to add in random "clouds" where the lights will dim to between 70-95% for random lengths of time. All events are logged to a database.
Here are some pictures of my setup so far, I am going to clean it up once everything is all tested and working, I know it looks like a dangerous mess at the moment.
Float switches
Power box and raspberry pi
Hood with ground + PWM signal wires added
Log from controller script
Simple wiring diagram of ATO system
The 8 outlet box is controlled by the Pi, I just found a tutorial here http://www.instructables.com/id/Web-...el-Powerstrip/ to build it, but I used a solid state relay instead of a mechanical relay.