Article no. 4 about the fishtank, november 16, 2019.
First about the status of the control at the moment. As already mentioned in previous articles, the adding of osmose water to compensate the evaporized water is made and now also the replacement of a percentage of the salt water (once every 2 weeks) is added to the control.
The next part of the project is testing the sensors for the waterlevel, pH and TDS (OPS, redox to come in the future). The water levels are important for signaling the level in the tank (for monitoring), the sump (evaporation and replacing salt water) and the osmose tank. I want to analyze the stability and test how robust these sensors are over time. pH and TDS are now tested for a week and the test for the level sensor is started today. pH is important for monitoring the quality of the water and the TDS is important for testing the quality of the osmose installation.
The following sensors are tested:
- pH, PH-4502C
- TDS, Analoge TDS sensor
- Level, MPX5010DP 0-10KPa (~0..100cm water column
See the photos below for the test setup:
On the foreground the TDS sensor, pH and in the box -filled with water- the levelsensor.
Recordings (mp4 video)
- Recording of scada with the new sensors (click on this link). Remark: recording starts in the proces of replacing an amount of salt water in the system (state SALTWATER-TO-DRAIN). There is already salt water made in the osmose tank and will be transported to the sump at about 1:00 minute in the recording.
- Recording of the penplotter with pH, TDS and level sensor (click on this link)
- Arduino DUE R3
- DS3231 Real time clock
- RGB led
- OLED display
- Serial to USB converter
- Relay boards, 8 channel, optocoupler
- Motorized valves
- DS18B20 temperature sensors
- MPX5010DP differential pressure sensors
- SIM800L GSM module, sending text messages in case of alarm (not yet impl.)
- Power supplies, 24Vdc, 3.3 Vdc
- Visual studio 2017
- VMicro (Arduino IDE)
- MS Access
- MS Excell
Already the third article about the fishtank. The software for the control of the valves is ready, see also article Fishtank(2). Extra functionality is added to the valves; when going from handmode to automatic mode again, the valve is going to the state of the control. Also added; when the valve is in handmode and the control is commanding the valve, a valve error is standard raised.
I have also added soft- and hardware for the necassery clock. In this case a DS3231. This RTC is operating on 3.3Vdc, communicates by I2C and can present the room/panel temperature in the future. When HMI is started on the PC, the current time of the PC is send to the board and the time on the RTC is updated (this is part of the AFSM standard software).
Also connected via I2C is an OLED display. Presented on the OLED are the date/time, the temperature of the water and the room temperature. Last but not least the status of the installation; Normal, Warning, Alarm. The installation status is also presented by a RGB-led. The RGB-led will be placed in the cabinet of the sea tank (in sight). On the picture also 2 of the valves, connected to the board. Mention the special board for holding the DUE; to make the control a little bit "industrial" i bought a DIN-rail MEGA board holder for the connection of all wires.
... almost time to think about the building of a panel...
While testing the software, the need for extra simulation software is a must. The control is operational -for the part of adding osmose water- but i had to simulate the level of the different tanks during testing, by masking/setting the levels to the approprate value. This functionality -setting the levels by hand- is possibly, but i wanted to make it automatic. For the simulaton of the tank levels i made a matrix, with all possible routes and possible states of pumps, osmose, draines and even the evaporation of water.
Below the matrix:
This activation matrix is part of a spreadsheet, with tank data (dimensions), pump data (L/h), valve positions (open/close) and numbers for the water evaporation (% per 24h). The 3 last numbers of the table present the change of tanklevels in mm/sec, depending on routes and pump- and osmose data. A dash in the matrix persents "don't care". The matrix is imported in the Arduino. A timer is fired every second to check the matrix and process the different values of the 3 tanks.
See also the trend figures below;
The functionality of adding osmose water to the sump is now operational. Now starting with the make of salt water and then adding the most important instruments; temperature is already present, TDS, pH and conductivity planned to implement in the control....