Automatic Control of Fuzzy Logic Hydroponics Using pH & electrical conductivity

Hi,

I am new to using arduino (I'll be honest I did not know it existed until a couple months ago) and I am a research student looking code arduino for my project. I am using:

  1. An Arduino Mega 2560
  2. 4 peristaltic pump [https://sea.banggood.com/12V-DC-Dosing-Pump-Peristaltic-Pump-For-Aquarium-Lab-Analytical-Water-p-931333.html?cur_warehouse=CN]
  3. An Electrical Conductivity Sensor [ec meter - DFR0300 - Gravity: Analog Electrical Conductivity Sensor - DFRobot]
  4. An pH Sensor [PH_meter_SKU__SEN0161_-DFRobot]

Output from my system plan are;

  • Two peristaltic pump for pH Up and pH Down (input pH sensor)
  • Two peristaltic pump for A nutrition and B nutrition (input electrical conductivity sensor)

I get a reading from the probe and I calibrated it fine, the issue is I am not too good at this fuzzy logic programming for my system plan. Would you give me a code?

Kind Regards,
reatirsa

reatirsa:
Would you give me a code?

NO.

If you want someone to write a program for you please ask in the Gigs and Collaborations section of the Forum and be prepared to pay.

If you want to learn to program yourself then people will be happy to help you if you get stuck.

...R

You should be able to find examples of code fora sensor
Try that and see how it works
Add the next sensor
Build as you learn

We will help as you hahave problems

You might want to take a look at the embedded fuzzy logic library eFLL.h

It is available through the library manager.

when you say 'fuzzy logic' are you referring to the scientific term regarding the application of a specific type of control or are you using it as a slang term meaning not well understood by you ?

often the simple ;
if the reading is over 50 turn on the fan
if the reading is under 40 turn the fan off

is all that is needed

other times it might be

if the reading is over 50, then turn the pump on for 30 seconds
wait 5 minutes and read again.

to add to the latter. you could then have the code automatical modif the next time
if the desired goal is 40,but after 30 seconds, it reaches 38

lastRange = (reading/40) // reading being 38
nextRun = 30 * lastRange // 30 being your default, so 95% * 30 = 28.5

then

if the reading is over 50 turn the pump on for nextRun
this would turn on the pump for 38.5 seconds and if the relationship was linear, the result would be closer to your target of 40.

but, for us to help you with your project, you would need to tell us the specific problem you are having.

Documentation is TOTALLY out of date (dating a few rewrites ago) but otherwise it's doing pretty much what you need: GitHub - wvmarle/HydroMonitor: Monitor your hydroponic growing system from the comfort of your chair!

Note that I'm using a quite different type of EC sensor (only a fraction of the cost of DF Robots one, yet still highly accurate) but code is written to be pretty agnostic to that, and have no pH-plus function as that's normally not needed in hydroponics.