Close

I'm not dead...!

A project log for ESP32 Greenhouse Monitor

Collect temp/humidity, soil moisture, sunlight data to be stored on local web server

jeff-taylorJeff Taylor 01/22/2018 at 21:490 Comments

It's been quite awhile, but this project is not dead yet!  However I have tossed the original hardware and made some significant upgrades to allow for a much broader range of functions...

I am currently using what is marked as a "Lolin32" board, however this appears to be mislabeled.  The board was available on ebay for around $10.50US and contains an ESP32 with a 128x64 OLED display and USB port.  The ESP2 offers a fantastic upgrade in I/O pins, most importantly including the ability to use many of these pins as ADC inputs.  The impact on power draw appears to be minimal despite the huge increase in computing power, so we'll see what happens when I move the project over to battery and solar power.

The DHT22 has been replaced with a BME280.  At about the same cost as the DHT, this chip communicates through a standard I2C bus using two wires, and adds a barometric pressure sensor along with more precise temperature and humidity measurements.

I have also had discussions with others regarding greenhouse operations, and believe there is a need to include a high-amperage relay board.  With this a person could control heaters, fans, and water pumps.  While 5amp relay boards are easily obtained, even the small heaters I use would require at least 12amp relays to operate.  It would be handy for future expansion if I can find a relay board controlled through an I2C bus, but have not run across any yet.

With the expanded I/O of the ESP32 and the addition of a relay board, this opens up a lot of possibilities.  For example, each relay could be defined to trip on a specific parameter... Temperature drops below 32F? Turn on the heater via relay 1.  Soil moisture sensor reads below 25%?  Turn on the water pump via relay 2.  And so on...  These are things that could easily be defined by a built-in web page on the ESP32 and stored to flash memory.  Additionally we could define some built-in rules about certain things.  The water pump is a good example in that as soon as the water starts flowing it will show 100% on the sensor.  Your ideal setup may call for the water to run for five minutes, and then re-check the sensor again an hour later.

So I have one of these new 'Lolin32' boards plugged into a breadboard with the BME280 and have already run into some issues with heat.  The ESP32 puts out a noticeable amount of heat while running, and raised the temperature of the sensor several degrees, so I put the sensor on some 4" leads to move it away from the board.  Closer but still not quite right.  It turns out the default setting of the sensor is to continually poll for new values, causing it to heat itself!  Fortunately updates to the driver library have solved this, so I have new code to test which should only request one data sample and then shut off again.  By only requesting data once per minute the sensor will not generate enough heat to affect the results.  Having the onboard display is handy for testing, but would not be wanted for the final model as it would use excess power and drain the batteries faster.  However there are a number of ePaper displays appearing on the market that would be ideal for a low-power solution.  I have not had time to investigate this option though...

My biggest concern lies with data storage.  For my own uses, I have several servers up and running that I could easily store data on... but what about the average home user?  Adafruit has their own server set up for customers to log data to, perhaps I could also set up something for this particular project.  Again, time will tell what happens. For now I just want to get this unit up and running in my greenhouse before I start planting seeds, then I can work on improvements on a live system.  And OTA updates -- gotta get that working too!

Discussions