NOTICE: This forum has been archived (i.e. registration and posting is disabled).
Please go to the new forum at https://forum.kylegabriel.com
[Solved] Custom inputs and PID for Grow Tent
I am trying to set up an automated grow tent for plants but while I am enthusiastic and quick to pick things up, I have little coding knowledge. I am using a 1.2x1.2x2.2m tent. I am currently using MH-Z19 CO2 sensor and Seed studio's grove SHT35 for temp/humidity. I will be looking to incorporate a quantum PAR meter and soil moisture sensors next.
I have managed to get the SHT35 working with a bodged custom input file and manually installing grove.py. but something is wrong as it keeps spitting out "ERROR - mycodo. inputs. sht35_66f46a98 - InputModule. get_measurement() method raised IOError: [Errno 121] Remote I/O error". Would you be able to help me write the correct input file?!
My current outputs are intake/outtake fans on one relay, a 1000w oil heater, ultrasonic humidifier and co2 regulator with solenoid.
Thanks in advance for any help you may be able to provide and thanks again for such an awesome controller.
You say you got the SHT35 working with a custom Input yet there are errors in the daemon log. So, just so I understand, it is working and there are errors? Does that mean it works but only periodically? Can you provide the code you used for the custom Input (please attach a file rather than pasting it)?
I just made a custom Input for you to try that uses the grove.py python module (attached, rename from .txt to .py before trying to import into Mycodo).
Edit: hold on a sec my forum settings aren't letting me upload a file. I'll have it up in a moment.
Ah, I just spent the last few minutes trying to work out how to attach a file!
I just enabled attachment of txt files, so just rename them to py for Mycodo. Also, the attachment is now on my previous post.
Unfortunately that doesn't seem to work.
Edit:It says i'm not allowed to upload txt files
I also installed dependencies for SHT31
I have log files for both input modules when upload is enabled as it now doesn't read from my file anymore...
You can go ahead and paste it in the post, since uploading isn't working at the moment. Alternatively, you can start an issue on github and upload the files there.
Have started an issue on github to keep things neat.
Great. I'll provide a link, below, so people can find these related threads from each other. We can have general discussion here about tuning once we fix the issue with reading the sensor.
So what conditions are you trying to achieve, range-wise? We should work in a step-wise fashion, trying to get one condition to regulate at a time. I would suggest starting with humidity, which would need a PID controller with the measurement set to the Humidity measurement of the SHT35, and the Raise Output set to the humidifier. Make sure the SHT35 Period is set to 10 to 20 seconds (lower the better, but not too low). Set the PID Period=30, Setpoint=80, Kp=1, Ki=0.1, Kd=0, Integrator Max=250. This should be a relatively good tuning to start with. Let that PID run for about an hour. On the Dashboard, you should create a graph that includes the Input humidity, Output seconds, PID setpoint, and PID Output Duration, and set X-Axis (minutes)=120. This will give you good feedback about how the PID is operating. Once the hour is up, take a screenshot of the entire graph and legend and attach it to a post here. I can then look how the initial tuning worked and recommend how to change the PID gains and maybe other settings. Any questions, let me know.
Thank you, have inputted those settings and will post again once test is complete.
Ultimately I'm trying to set a range of VPD's from about 400pa to 1600pa while staying at a temp of around 30C. Also to set CO2 levels between 800 and 1500ppm. Would be great to control my LED light as well, they provide an API but not sure how difficult it would be to add into Mycodo.
Well, it looks like we hit a really good tuning on the first try! I'll have more time later to make a more detailed response about the next condition we can set up regulation for.