Mushroom Growroom Box

Hello,
I am a mushroom producer and for my fruiting room, I need to monitor and control some of parameters. Humidity, Temperature, CO2 and light. At the moment, light and fan are plugged on timer and my humidifier on a non really acurate Inkbird = quite poor automation = not the best mushroom quality

I am in the process of conception of a box to control everything in one place and also get data when I am not in the farm. I started my research with arduino and finally ended up with Rasberry Pi + ESP32 solution with ESPHome and Home assistant( I'm not closed to change). From a skills standpoint, I can weld but not the best. I understand electronic concept, what pin for what use, but still in the beginning of the learning curve.
I also have some basic code skills and okay to take hours to debug if needed
In terms of real electricity skills, I am good in "big" elec like for a home proejct, but the little one, ohms, resistors... This is where my understanding stop and I would be happy if I do not need to go here hahaha.
I also add that it is not a hobby project, so I prefer to put few more $ for better module or sensor if it give me better result. I already ordered the rasberry pi, an ESP32 devboard and few composant to play with.

My requirement and understanding are now (again open to change):
1 Rasberry Pi box to run Home Assistant and be the central brain (I would add others box for my lab and incubation later)
I will be able to use ESPHome that should help me but I know that depending of what module I will use, I will need to put my hand in code

1 ESP32/relay/sensor box. In this box :
BOX
A big electrical box, with mounting plate, 12v power supply and few buck dc dc converter for 5v and 3.3 v composant

Microprocessor
An ESP32 devboard that I would prefer linked to the rasberry by ethernet or other wired solution. I would prefer to avoid wifi as i am in a cave with BIG walls.

QUESTION : It is more reliable to go with a ESP32 card with an inegrated Ethernet or add a module? And I begin to understand that this ethernet feature needed can be a pain in the ?

Relay
2x 4 relay board, one for my 12V equipment, the other for my 220v equipment. Connected to ESP32 with GPIO pins.
8 buttons on the box, which should not be so used but still better to be able to light up in the night or shut down humidifier when I harvest.

QUESTION : Regarding thoose buttons, I feel that the code I make will be the answer :slight_smile: but I need 3 "position". Normal, forced ON (light on in the night) and forced OFF (shut the humdifier when I harvest). Is it easy to implemente or would require lot more stuff?

Sensors
I would like to make a "sensor hub", allowing me to had more sensors if needed. Now 2 humidity/temp, then 1 CO2 and more.
I was planning to use I2C sensors but I understant that it shoud be used in short distance. My sensors will be 4 to 10 meters from the box so it is not the good solution. Some says that RS485 could be a good solution, others prefer CANBUS...

QUESTION : I rely on your advice here, easiest vs more acurate solution?

Pass-through
On of my main goal is that the box can be easy to unplug. Following the "sensors hub" things, I want to have on the left side : my 220 and 12 plug for equipment, on the bottom, power supply, ethernet and usb plug and on the right side plug for my sensors.

QUESTION : For the sensors, I was thinking of a row of Panel Mount Chassis RJ45, linked to each of my choosen sensor system pin, do you thinks it is a good idea?

Air conditioning

I also want to connect my not yet installed AC unit to this, I am talking with my AC guy to know what is feasable. Maybe another ESP32 plugged inside the AC or a infrared remote. This part of the project is is still unclear...

Display

While we're at it, why not add a little I2C screen to monitor data. It is not mandatory at all but hey, lets build a complete solution.

I found some card with ESP32, 8 relay, Ethernet port like this ( https://fr.aliexpress.com/item/1005003336002666.html?spm=a2g0o.cart.0.0.1bf1378dO2L9hP&mp=1&gatewayAdapt=glo2fra ). It could be a good start point as it as most of what I want and would allow me to avoid lot of connexion myself. But the problem is that if only one relay fail/break, do I will need to change the whole?

Lot of info, lot of questions, I know...
That summarizes the 87 chrome tab I currently have hahaha.
I'm not waiting for a full tuto but any advices or guidances and even warning would be much appreciated.
I'll be sure to keep you posted on the project's progress !
Have a good day !

Greto

Please read and complay with this link: How to get the best out of this forum - Development Tools / IDE 1.x - Arduino Forum

Your essay isn't interesting to read for the moment. Words never replace the engineering information You omitted.

No need to do that on this forum, but a web site or blog article giving the essential details of the finalized project would surely interest a number of people.

2 Likes

Disagree. WiFi access points are cheap and building a WiFi network will allow you to use mobile devices for monitoring etc. For the low bandwidth you require you could daisychain multiple repeaters throughout the tunnel system.

RJ45 connectors in a high humidity environment aren't going to survive. You either need to put your gear in a sealed box with cable glands or use IP68 rated connectors that have O-ring seals. Brand name water-proof connectors are extraordinarily expensive. There are cheap clones on Aliexpress but you need to buy them in male/fermale pairs as none of the clone makers use a common mechanical design.

what is the distance between the RPi and ESP32 nodes? e.g. could you use a USB hub - plugging ESP32 USB cable into RPi USB socket create a virtual serial port you can use for communication

if using ESP32 Ethernet I would go for a module with microcontroller and Ethernet on a PCB - reduce wired interconnections which are a source of poor connections and intermittent problems

you may need to go for industrial quality modules (can be very expensive)

EDIT: the Kincony ESP32 8 CHANNEL RELAY MODULE – KC868-A8 looks a possibility - maybe worth getting one and experiment?

maybe worth experimenting with WiFi - e.g. using ESP-MESH?

Throwing my 2 cents in here as I have run a grow tent for the last two years.
Look at the AC Infinity line of vents and fans and other grow equipment it might gives you some ideas for your project.

I am sorry if I ommited important info.
Can you please clarify what I did wrong in my post?
I did not already choose what specific hardware I will use for this project , this is why I asked in the first place but I would be happy to add anything that can help make it more understandable. I will share my prototype circuit diagram but I feel it is not relevant as most of part will have to change (I2C sensors for example).

Oh ok... :upside_down_face:
First time someone telling me that. What is a purpose of a forum if I do not give update and so others people can use theese information for their own projects/problematics?

The box will be on the wall outside the fruiting chamber so not in the extremely humid environment only the sensors and IP68 LED are in the fruiting chamber. But still, you are right ! All the hardware will be in a closed box and with every outgoing port with some kind of protection. For the 220v socket, I will buy IP65 socket. And for the sensors (and/or others port like usb), I was looking at this kind of socket which I can screw on the box.

The fruiting box will be 3-4 meters from the rasberry pi. But I also plan to make few more boxes for my lab, incubation space and sterilisation.
I was planning to rely on wifi first but read that wire connexion is more secure. But mikb55 is right, I do not need high bandwidth and so wifi can still be a solution, I just wanted the most secure system.
Thanks for the virtual serial port idea, I am looking to this.

As esp32 and other small modules are pretty cheap, I will buy all the components on one side and the kincony on the others and try with both.

Oh yeah thanks, I know this brand, I had one of their speed controled inline fan. Unfortunately, it didn't last long because of the harsh environment in the FC. Now I use cheap inline fan that i replace here and there. Their controllers looks good too but I prefer rely on opensource Home assistant + this project is a good way to learn new skills. I'm as interested in the result as in the journey.

So
Here my diagram so far :


And my hardware spec so far :

  • 1 bundle reichelt Raspberry PI 5 B 4 Go
  • ESP32 Development Board "ESP32-S3-DevKitC-1 "
  • 8 relay board "HW-281A 5V"
  • dc-dc buck converter LM2596S
  • display "1.5 inch SH1107 4 pins"
  • and for sensor, I do not know. I read that BME280 are more reliable so I planning to use 2 of these in a water resistant casing
  • "Sensor hub" is a RS485 4 channel hub is a good idea?

BME280 is a good choice but if it is in a water resistant casing how can it sense humidity
if you are looking for a waterproof temperature sensor look at the DS20B18

If you want to go with I2C and longer wiring, you can use (Adafruit) LTC4311 I2C Extender / Active Terminator. Also, use sensors from different brands and you don't get in trouble with I2C addresses. Sensirion SHT31 is good sensor and readily available as waterproof probe form. I personally prefer "wire-less" approach, more esp boards and short wiring. Esphome have components to make them communicate together.
For AC look for something that has Esphome wifi, for example Midea (and 30 other re-branded Midea ones) is economic and well supported with Esphome. IR is less reliable, you can never be sure of the state.

Indeed my sentence require some precision, water resistant humidity sensor would not make sense at all haha. I was thinking about using BME280 with water resistant casing like this. So all others components except the humidity reading chip are safe


Again, I am not against put few more $ for better sensors if needed.

I took a look in somes of theese extender when I read that I2C was more for short distance. But then I was wondering, if it not made for this at the beginning, why not try to use solution that are already designed for longer distance. And this is where talked a lot about RS485 systems.

I am not fighting against wireless, If 1 ESP per sensor connected in wifi is the most reliable why not. But I do not see the advantage of it (ignorant I am for sure) :

  • I have this idea that wire will be more secure. Like once plugged, it seems to me that disconnection chance are higher with wireless, same with interference? (Could be totally wrong on this)
  • If for each sensor I need to add esp + powering + wiring + coding + casing for each. Is it not more easy to make my "sensor hub" in the central box then wire each sensor directly?
  • Taking the pb from the other side, in the end, what would be the advantage of doing it wireless? Except pull a little cable

Thank for the AC advice ! I have also seen the FaikinESP device that allow to control daikin and some other tuto to plug mitsubishi AC. I will avoid the IR solution :+1:

Hi, few more days or research
The RS485 daisy chain topology is unfortunatelly not suitable for my project as I need star topology.

I searched about this extender, thanks a lot for the advice ! I took more research and will finally go to I2C. Regarding the adress possible pb, I even came to some I2C multiplexer which should allow me to put sensors with the same adress without pb. Adafruit said with this range of sensor distance, one LTC at the beginning of the chain should do the tricks. If not, multiple on each branch can (but would be bad for my finances)
Here is my actual schem. (Currently reading about pull resistors, It is possible that I will need some).

On the relay side, regarding my AUTO/OFF/FORCED requirement.
The wiring I did on the schema could be a solution?
OFF = IN1 is not connected to anything
ON (left) = IN1 is connected to 3.3 power
AUTO (right) = IN1 is connected to a GPIO pin of the ESP board.
Look ok to you or it is completelly stupid?

And as I can now be more precise on the hardware I want to use, here are the specs :
ESP32 board (not choosen already)
3.3V 8 relay module KW-3356
I2C Extender Adafruit LTC4311
I2C Multiplexer Adafruit PCA9548 8-Channel
Temp and humidity sensors BME280 I2C (waterresistant casing)
CO2 Sensor (not choosen already)

Ok. Be aware many relay modules have inverted logic.

Your setup should be ok if wiring between multiplexer and sensors is short, extender doesn't help beyond multiplexer.

Ok, but SHT3x is better to my opinion.

Choose NDIR or photoacoustic one.

Yeah it is what I fear. I will try different config

I will also took one on theese to compare with the BME280 :+1:

About everything is ordered and on its way, see you at the next episode

Ok I found really interesting topic about I2C and long distance cable.

I was looking to which kind of wire I would use to connect my box to my sensors hesitating between 4 wire cable and some cat5 cat6 ethernet cable.
Thehardwareman, by connecting one wire of twisted pair to signal and the other wire to shared ground from each part acheive pretty long distance, even without an extender.
Like "this"


I do not even know if as there is already two ground do I need the last one
It could be a really good solution for me as cat 5 wire are easy to find and by have twisted wire can help me. (I know that sda and SCL should not be twisted between them at all).

That's the most common I2C wiring pattern. There are others as well. You don't need 3rd gnd.
It's not some miracle approach making I2C become RS485, just good practice to minimize cross talk/interferences.

It is wonderfull as I started my research with "I2C is for 20cm wire only" to possible to do several meters !
As i told at the beginning of this post. I wanted to put some pass throught connector on the box wall. Following the logic of twisted pair cable SCL/GND, SDA/GND. This kind of connector could be perfect


I asked the seller how are the pin wired.
If it is
1-3-5-7
2-4-6-8
Using a straight cat 5 cable, I could wire the output of mulitplexer (or extender) on first row and a full GND only the second row like this

(Too much time on this schema? For sure hahaha but it help me understand and memorise)
I do not see any down I don't see any drawbacks to having so many GNDs apart but maybe I'm missing something?
EDIT : Soldering 5GND on the sensor side can be pbmatic to achieve.

More correctly it's for connections on same PCB only.

Obviously you don't try to fit them on the sensor pcb pad, but solder them together just next to it bringing single wire to sensor.

Anyway test your setup carefully before starting to solder long wiring and connectors.
If you have problems, it's helpful to have certainty that the setup "generally" works and problems are from distances/connectors.
You are lucky if it works out of the box...

Oh yeah you are 100% right ! Everything will start on prototyping breadbord and short distance before I weld a single spot of solder !

Regarding the SHT sensor family. Again thanks for the advice, they look great.
The SHT4X have a controlable heating element (the SHT3X also have heating element but it is only used to check that the temp reading is ok).
" Long-term exposure of the sensor to relative humidity (RH) levels greater than 90% RH may induce a reversible positive RH shift. This effect is called "Creep". Periodic heating of the sensor enables measurement in an environment with high humidity for a long time without the creep effect."

Which is great as mushroom fruiting chamber is always in the 80-100% range.
But I didn't read anything about how this heating element can affect the temp reading. If it doesn't affect it or in a negligeable scale (less than 2°c), theese sht40 would be a perfect match.
If it affect the temp more than 3-4°C, it would be too much. So I could rely on one for the temp and on for the humidity. But then I am more at risk if a sensor going crazy, I do not have a second one to to "mitigate" the data.