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:
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?
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.
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.