Custom inputs and P...
 
Notifications
Clear all

[Solved] Custom inputs and PID for Grow Tent  

Page 1 / 2
  RSS

jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 15, 2019 6:46 pm  

Hi,

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.

 

Jamie


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 15, 2019 7:29 pm  

Hi Jamie,

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)?

Mycodo Developer


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 15, 2019 7:41 pm  

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.

Mycodo Developer


ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 15, 2019 7:46 pm  

Ah, I just spent the last few minutes trying to work out how to attach a file!


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 15, 2019 7:55 pm  

I just enabled attachment of txt files, so just rename them to py for Mycodo. Also, the attachment is now on my previous post.

Mycodo Developer


ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 15, 2019 7:56 pm  

@kylegabriel

Thank you, will give it a try.


ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 15, 2019 8:07 pm  

Unfortunately that doesn't seem to work.

 

Edit:It says i'm not allowed to upload txt files

I also installed dependencies for SHT31 

This post was modified 9 months ago 6 times by jpmchitty

ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 15, 2019 8:42 pm  

I have log files for both input modules when upload is enabled as it now doesn't read from my file anymore...

This post was modified 9 months ago by jpmchitty

ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 15, 2019 9:28 pm  

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. 

Mycodo Developer


ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 15, 2019 9:43 pm  

Have started an issue on github to keep things neat.


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 15, 2019 10:55 pm  

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.

https://github.com/kizniche/Mycodo/issues/687

Mycodo Developer


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 16, 2019 10:44 pm  

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.

Mycodo Developer


ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 17, 2019 12:16 pm  

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.


ReplyQuote
jpmchitty
(@jpmchitty)
Active Member
Joined: 9 months ago
Posts: 12
September 17, 2019 12:41 pm  

Attached Humidity chart.


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 199
September 17, 2019 12:58 pm  

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.

Mycodo Developer


ReplyQuote
Page 1 / 2