RaspiPool (Pool Automation System with Raspberry pi + Home Assistant)

segalion

Well-known member
Jul 3, 2019
70
Madrid
There are a lot of ideas about extend project:
1. control chlorinator instead bleach injection
2. Basic control for VSP pumps based on 3 relays,... but I need help here because I don't know how this all works.it is really important has more than two speed?
3. Heater control based on water temperature. HA has built- thermostat and can be possible integrate google calendar as
4. Lights control for aditional relays. I don't know how to make automations with this without a presence detector.
5. Presence detector. It can raise the automation to new levels ( changing filter times and chemical in funtion of time of use of pool), switch lights at night....
6. Some relay for control valve. I can't figure how standarize automation control.

please Ideas and proposal or "vote for/priorice" are welcomed.
 

Katodude

Silver Supporter
Aug 22, 2017
301
West Palm Beach/Florida
I think what you should do is try to incorporate some of the Nodejs pool controller code with yours. They have variable speed pump control and I think control for SWG. All the code is available on Git. It has quite a few of the items you have listed.
 
  • Like
Reactions: cmc0619

segalion

Well-known member
Jul 3, 2019
70
Madrid
Please, could you post link for Nodejs? I think that nodejs code is not for create an Automation system but integrating with only one automated system (Pentair Intelli-xxx)
This project is for create an automation system, with minimun intelligence in peripherics (pump, peristaltic, SWG, etc.), and all intelligence in rpi-ha system.
 
Last edited:

Katodude

Silver Supporter
Aug 22, 2017
301
West Palm Beach/Florida
Please, could you post link for Nodejs? I think that nodejs code is not for create an Automation system but integrating with only one automated system (Pentair Intelli-xxx)
This project is for create an automation system, with minimun intelligence in peripherics (pump, peristaltic, SWG, etc.), and all intelligence in rpi-ha system.

Here is the link, but I suspect you already found it. There is good code in there to control a Pentair Intelliflo and to control Hayward SWG.

 

segalion

Well-known member
Jul 3, 2019
70
Madrid
Thanks Kato.
It's same I know. It's for control & monitoring one RS485 closed product.
Soery, but today, It's out of my actual goals.
 

Kdem

New member
Aug 20, 2019
2
Canada
Helo Katodude. I have revised the 8 relays hat from
Sequentmicrosystems
(
https://www.sequentmicrosystems.com/8relays.html
), and first problem is that control is with I2C protocol, so integration in Home Assistant can be more dificult. My proposals relays are directly gpio so they are directly integrated as switches in HA. Furthermore, seems a more profesional board than chinesse boards...

About aditional card for ADC, i think I could get it as simple as possible… so maybe with ezo Carrier board and DS18D20 one-wire can be enough.
Segalion, please be aware that the 10Amp rating you are relying on for the relays to run the pumps is for a resistive load. The inductive load rating for this relay will be less than 1/3 of that, as it is much more difficult to switch off the current to a rotating magnetic device than a resistive device. This will cause arcing when the contacts open, which the relay cannot handle, welding of the contacts, relay sticking on or failing, and possibly a serious fire. See the data sheet for the relays: http://datasheetcafe.databank.netdna-cdn.com/wp-content/uploads/2015/10/SRD-05VDC-SL-C-Datasheet.pdf Note the inductive load rating. Please take the advice given earlier and use these relays to trigger a proper contactor (magnetic relay) to run the pump. Sincerely Kdem
 
  • Like
Reactions: cmc0619

segalion

Well-known member
Jul 3, 2019
70
Madrid
Thanks a lot, kdem .
I was precisely investigating about that. I think you are right.
I will take this into account.
Could be great a recomendation for buying and possibilities of connections.
 

Kdem

New member
Aug 20, 2019
2
Canada
I would not pretend to be competent to select the proper equipment and wiring connections for your country and unknown equipment. Please do not take this in a negative way. My advise always is if someone has to ask how to connect electrical equipment, and what to use, they should hire a professional. There is more to it than is obvious; it is not worth the risk, or possibly invalidating your insurance if you make a mistake. There is a reason it takes many years to become certified in the trade, or to be an engineer. I am not talking about the low voltage/RPi driven stuff, just mains power. I only jumped in here to try and prevent a safety issue. Sincerely, Kdem
 

segalion

Well-known member
Jul 3, 2019
70
Madrid
I have been investigated more...
We need to include contactors between actual RPI relays and the pump. The two-speed pumps are really two motors inside one chassis, so we need 2 contactors.

All the project remain the same. Only 2 contactors need to be dispossed between rpi relays and pump power source.

The contactors has to be :
2 poles, both of them NO (Normally Open) so when rpi is power-off, pump is power-off too
The power rate (Ampers or KW) you need to buy is that marked as "AC-7b" or "AC-3" kind or load, that is the power for inductance loads like pumps and motors.
I.e. a contactor rated as AC-7b = 9A means can safely relay a pump upto 9A (i.e a 1HP pump with minimum efficiency of 40% as seen in this calculator).

I would try to paint a good schema for conenct RPI relays, a manual dual switch (in parallel), the contactors, and the dual-speed pump.
 

segalion

Well-known member
Jul 3, 2019
70
Madrid
The schema (it takes lot of time create good documentation)...

This picture describes how-to connect raspberry pi relays based on hat, to feed two contactors, to control dual-speed pump, and with a manual switch in parallel.

The contacts has been carefully designed to ensure:
- If rpi is off, pump is totally off (power off, speed low)
- You can allways by-hand power-on the pump and force high speed), even with rpi down.
- Contactors are Normally-Open (NO), so if no power on A1-A2, pump is off.


 

segalion

Well-known member
Jul 3, 2019
70
Madrid
Yesterday, I connected the sonnof POW R2 to the pump, and seems to work fine:

- High speed (3000 rpm): 5.21 A => 65% efficiency
- Low speed (1500 rpm): 1.41A => 60% efficiency

There are a component to include this as sensor and relays with ewelink cloud, but I preffer flash firmware with tasmota and use as mqtt device, with no chinnesse cloud connection.
 

Katodude

Silver Supporter
Aug 22, 2017
301
West Palm Beach/Florida
You just reminded me that I need to add some temperature sensors. I just bought 5 of those same ones so I will wire them up. From what I remember I think you can wire several of them up in parallel and they all have a unique identifier. I want to put one in the controller box to make sure the operating temperature does not get too high.
 

segalion

Well-known member
Jul 3, 2019
70
Madrid
You just reminded me that I need to add some temperature sensors. I just bought 5 of those same ones so I will wire them up. From what I remember I think you can wire several of them up in parallel and they all have a unique identifier. I want to put one in the controller box to make sure the operating temperature does not get too high.
Yes Kato. You can simply connect them in parallel (no more than 10 for gpio).

For inside box temperature , you have the Raspberry pi built in CPU sensor. As ir is at less than 5% cpu load more than 99.9% of time the temp is very related to the temperature inside the box.
 

segalion

Well-known member
Jul 3, 2019
70
Madrid
About the ORP...
So some people here are interested in ORP work, I am going to write some first conclusions about that:

1. ORP and FC relationship:
It depends on pH and "other multiple factors". On pH I have create a very good relationship between pH and ORP. Seems to be very exact to me in values from .5 and 5 FC ppm, because I have seen that ORP lectures has been variating in function of pH elevation to mantain FC fixed (and with DPD-1 test demostrate fixed FC).
Now about "other factors".
- Cyanuric acid
As some people know, I dont use CYA because I use Bromine tablets in skimmer, and probably I have a "bromide bank" so all bleach (FC) is converted to Bromine.
I have a polycarbonate (double-layer) cover 95% closed or semi-closed that filter most ot UVA rays, so my sanitization loose is very very low. I have tested ORP without any bromine tablets for days and decreasing speed is really really low.

So I can´t experience with CYA, but I have seen people complain about "CYA reduce ORP". I have read ( see Understanding ORP: Oxidation Reduction Potential ) that ORP is really a better meassure than FC, because it measure not the FC but efectiveness of sanitization. Usually CYA blocks the action of FC, so it is logical than ORP give a lower level: it is talking about effective FC, not total FC.

Morover, CYA is something that has to be very static (exception of water losses and renovations), so influence over ORP should remain constant. If not, means your CYA has changed a lot, so you need to correct it.

- TA. People reported to decrease ORP. I dont have SPAs, jets, waterfalls, and other elements interference the TA, so for me, it is very very stable. Maybe, if the automation system can measure the time all of this is working, could predict how ORP changes to correct it, or better, correct the ORP-FC formuale in function of (pH,estimated TA)

- Other dissolved elements (phosphates, disolved solids, etc.). It is know that same orp probe ph and fc levels give diferent ORP in funcion of water. It is because lots of components, so most people recomend create your proper ORP-FC table.
I dont know, because I can experiment only with my water, but I suspect that all this parameter usually remains
very stable, so can be statically corrected.

It's curious that some articles change the perspective of ORP and FC: If you have low ORP levels with high FC, probably you have bad water (dirt in water), and if you have high ORP levels and low FC, means your water is very pure and healthy.

2. ORP Probe
- I have found that ORP meassurement is very very slow to take correct meassurements. It takes about 25-40 minutes to get adecuate (correct, coherent, and stable) values from a bad state (i.e pump filter off)

- Seems to me that It is slower decreasing than growing.

- When raspberry power down or reboot (the EZO cirtuit loose power, and reboot too), the ORP begin at very low level. I.e if orp is 770, when reboot, it begin rate to 630, and takes 25-40 minutes to get the 770 before.

- I have seen that when pump is in high speed, ORP (and pH) measurements decrease a little (i.e. from 750 to 740), and when change to low speed pump, it goes to previous measurements (750). I dont know why, so is supposed the flow dont affect to probes.

- When the pump starts after some time stopped, I see a small ORP peak. I suspect that ORP grow inside stagnant water (I dont know why).

And more things... I have found that there are two kinds of ORP depending on electrode composition (plata y plantino/calomel), with 50mV of diference.


3. Final Impressions
Although I have been testing for a short time, at the moment I am quite satisfied with the results. I see that the ORP gives very predictable values according to what I am changing in the pool:

- If I remove the bromine tablets, lower the ORP, from a stable value to a lower value, which goes down gradually and slowly.

- When I added bleach for a mini SLAM, I have seen ORP levels very accorndly with expected FC (I have problems here because bromine and chlorine dont have same molecular weight and I dont know how powerfull my bromide-bank is (in DPD-1 you have x2,25 "Cl-Br" relation).

4. Raspipool implementation
I have created a sensor that give the "estimated effective Free Chlorine".

To make the system wide-range kind of pool, I have included 2 methods to calibrate ORP-FC:
1. offset for ORP sensor (like calibration)
2. a more fine tunnig in % (from -100% to +100%) of formulae.

To reach a more accurate meassure (just previous to calculate liquid injections) I have created an automation that set pump at high speed for 8 min, and then low speed for 12 mins, increase the measure interval from 5 min to 20 seconds, and get measure based on medium in last 5 minutes. It sends (configurable) all parameters to notification pushbullet account (FC, ORP, pH, bleach to inject, muriatic to inject).

The calc for bleach injection (once a day) is related to estimated FC (not ORP).


The post seems to be a litle hard, so no more for today...
 
Last edited:

segalion

Well-known member
Jul 3, 2019
70
Madrid
I am continuing testing ORP vs FC letting change pH and FC in ranges of 7 to 7.6 and FC in 0.5 and 8 and I am getting very good results.I am considering it finally calibrated.

Now I am going to begin with test quantity injections and compare expected values with real values.

I have readed for other automation projects and I am think I am the first to make something similar. Please, can anybody tell me others in same direction (pre calculate, inject and compare with expected resutlts).