Skip to main content

Hello, World!

· 4 min read
Jan Grewe
Maintainer of GrowSmart

Today is April the 1st of 2024, the day that the law for decriminalizing the private cultivation of Cannabis plants in Germany has come into effect. That means for this year, Easter Monday is indeed a High Holiday.

But that also means that after spending more than 2 years working on an open-source solution to monitor and control my home growing setup in stealth mode, i can finally present it to the public without having to risk the authorities stopping by for an unpleasant visit.

To give you a bit of backstory, here's how it all began:

When i first decided to grow cannabis (as i had recently received a prescription, but the whole process was a nightmare), i had absolutely zero knowledge about plants in general. So i read up on how to grow cannabis succesfully and decided that i want a hydroponic system. But having something to grow cannabis in wasn't a guarantee for actually growing cannabis properly, as the environmental conditions during the individual stages of growth play the probably biggest role in ensuring success. So i started with an ESP32 and a simple BME280 sensor to measure the air temperature and humidity, so that i could manually adjust the fan speed in my grow box when when the temperature or relative humidity where out of bounds.

As i also wanted to measure the pH and EC levels of my nutrient solution, i first looked into any kind of pH/EC meter that provides some way to read the values by any other means than looking at the display, and found a chinesium device with BLE functionality. After implementing this into my own ESP32 firmware, but having severe reliability issues with the BLE connection, and encountering lots of other issues caused by trying to add more and more functionality, i finally found the perfect framework that allowed me to hook up a variety of sensors and actuators, while still providing enough flexibility to customize the behaviour of the system: ESPHome.

While ESPHome is intended to create "smart" devices that can be integrated into Home Assistant (a home automation solution), it also works perfectly fine on its own. It has a simple web interface to display sensor values or switches, but also allows adding custom controls to set e.g. time schedules for grow lights or calibrate pH/EC probes.

Once i had fully commited to ESPHome, and wired up all kinds of sensors and other boards deadbug-style, i started designing 3D printed enclosure for the ESP32 and some of the sensors, but eventually ran into issues again because some cables were too short to place the sensors into usefull place, or too long to reliably transmit signals - so i needed to find a way to have a signal bus that is either directly supported by many sensors, or for which there are at least modules available that convert e.g. an analog signal into that bus. And it has to works at least with cable runs of a couple of meters. And of course be cheap. Now lots of people will probably disagree, but i eventually settled on I2C. Hear me out...

While I2C ticks most of the boxes mentioned above, it has the major downside of being meant to work only over very short distances - as the long form name "inter-integrated circuit" implies. And at first it was close to ruling out I2C as a candidate, but then i discovered the LTC4311 chip, and the easy to use breakout board Adafruit created with it, and suddenly i was able to run an I2C bus with half a dozen of sensor over many meters of wire.

Having found a working bus, the only thing left to implement was the physical layer. I wanted something that is easy to connect and disconnect, with the connectors provind at least some kind of mechanical locking mechanism, while also using cables that are a bit sturdier than typical electronics wires. And it's gotta be cheap too, of course. Once i ruled out all the typical JST, Molex, DuPont and all those other tiny connectors, the most obvious choice was RJ45 connectors and Ethernet cables. More than enough pins for I2C, and i could even provide both 5V and 3.3V via the same cable.

So this is how GrowSmart was eventually born: Taking a bunch of off-the-shelf electronics components, putting them into freely available encloures, connecting them via a readily available physical layer, and interacting with them through a well established software framework.

Please bear with me while i still polish the documentation, add wiring diagrams, upload the STL files for the enclosure, prepare better examples, etc. This is just the beginning.