My pool controller for my pumps was starting to act a little flakey and instead of buying a new one for around 1K, decided to take a stab at building my own using a Raspberry Pi I had bought. The first issue I encountered was the lack of A/D builtin to the Raspberry. One option was to add an external A/D, but decided to look around and see what else I could use. I stumbled on the beaglebone, which has builtin A/D, so picked one up. After some initial testing it looked like it could work, although no way is that really a 12 bit A/D on the beaglebone. Maybe 10, but certainly good enough to use to measure the temperature for freeze protection sensing. After verifying the basics of I can toggle the GPIO pins, get a reading from the A/D, and get it on the network, I began coding the program to control the pumps & lights. For my pool, I have pretty simple requirements with a filter pump, a polaris pump, a water feature pump, main lights and feature lights. All are independant except when the polaris pump is active, the filter pump should be active. The only other requirement is if the temperature drops to freezing, then the filter and water feature pumps should activate to prevent water freezing in the pumps/lines. I also wanted timers of course for each feature as well as manual control. Unlike the original controller, I opted not to have buttons in the controller to manually activate stuff. Since my plan was to make the control via a Tcl/Tk GUI from any box on my network or my phone when on my home wifi, I did not think I needed to add the additional work of adding buttons on the controller itself. I've broken the project into three pieces, the C coded daemon that runs on the BBG, the actual hardware and the client Tcl code that can run either on a computer or phone. Note neither the client code nor the server C code is setup for any level of authentication or encryption. I am using it within my local lan and access is not on the internet. If you decide you want internet control, then you will want to add authentication before a connection is established and encryption to the channel. It is also very likely your set of pumps/lights/etc will be different than my case. With luck you can uses bits and pieces of this project in yours. And as always, remember you working with 220, so use extra care. Again, in my project, the original enclosure separated the controller from the 220V wiring/relays/circuit breakers with a metal shelf. The final installed controller
|
©2016 Stabie-Soft, Inc. All Rights Reserved.