Aerated static pile (ASP) compost controller

Thread Starter


Joined Dec 23, 2018
I would like to automatically control my Aerated static pile (ASP) compost for hot composting.
It's an aerobic pile, so for the bacteria to function well I have to set the oxygen and the water level correct.

I will drill holes in the 3" PVC pipe for air to escape from the bottom of the pile and in the 1/2 PVC pipe smaller holes for water to escape.

I need to control the intervals of when, how often and for how long the blower comes on.
Therefore I need to monitor temperature and humidity.
The more aerobic activity the hotter the pile gets.
It will go up to 70°C

I need to somehow find the ratio between perfect humidity level and according oxygen demand.
If despite perfect humidity- and oxygenlevel the pile cools down, the pile is ready.

So far I have purchased:
  1. 3" PVC pipe
  2. 1/2 PVC pipe
  3. Sun Joe SBJ597E All Purpose Electric Blower, 155 MPH, 6 Amp
  4. I2c Digital Temperature Temp and Humidity Meter Soil Moisture Sensor Probe (SHT25)
  5. Humidity Sensor with 14 Bit Resolution Internal Self Calibration I2C Serial Interface for Computer Room (SHT20)
  6. DS18B20 Temperature Sensor Waterproof Digital Thermal Probe Sensor for Arduino (Pack of 5pcs) EK1083
  7. ESP-WROOM-32
  8. I believe to have a 5V relay board

I guess an electric solenoid valve is missing for the water supply.

This preferably I would like to transmit via MQTT.
I am pretty unexperienced with this and would like to get as much ideas and input as possible.
I have tried MQTT before on openwrt but couldn't sucessfully make it work.

Is there a similar project that I could get ideas from already in the making?


Joined Aug 22, 2011
Your project embraces several sensor devices and you mention wanting to use MQTT. I would highly recommend looking on the web site where you will find tutorials, projects and some excellent ebooks covering the topics your are interested in. That web site is one of the very best on the 'net' for people wanting to learn about ESP, and many other, devices. I would also advise you to get each sensor working individually and then integrate each sensor into your overall project. What you want to do is definitely doable but you will need to build up your knowledge to accomplish it. If you want to gain more knowledge about MQTT go to the HiveMQTT website and read thier tutorials.
You will need a relay, preferably an opto-coupled time for the water solenoid. You will need a substantial relay for the blower motor. If that motor is an AC device then you could also use a Solid State Relay (SSR). In general the cheaper relays available on Ebay and Aliexpress have very generous ratings, so for good practise de-rate the relay value by 50%. If your motor is a 6amp AC motor, then you need a relay rated for something like 24 amp due to start up currents.
Your sensor choices are all good and there are libraries available if you are using the Arduino IDE or platformIO to program the ESP32. I think it is best as you learn ESP programming to start with the Arduino IDE and progress to platformIO.
I hope this information is useful and helps you with your project.


Joined Jun 19, 2012
Learning all the IOT MQTT stuff is a major task- one that has little to do with getting your controller to work.

It's really 3 different projects:

Getting all the sensors and outputs connected to a computer
Writing the functional code that makes your project work
Getting the thing to output useful data.

The first one is the hard part.

Remember, people did this stuff for many years before "IOT" was a thing, don't let this part ruin the fun.


Joined Feb 26, 2017
I second bobcroft's suggestiton to go to There are a lot of good write ups on using the ESP32 for the things that you want to accomplish. Each article is well written and easy to understand. You will have to read a number of them to see how to integrate all of the sensors that you want to use. If you follow bobcroft's advice you should be able to get your project to work.


Joined Jan 23, 2018
Since the blower delivery is described in MPH, I AM GUESSING IT IS A BATTERY POWERED LEAF BLOWER, and so it would only be run for short intervals. I am also wondering about the motivation for running the compost process like a race car engine, at the maximum possible speed. Certainly controlling the moisture level will keep the process running .
Unless this setup is a small batch operation, the temperature peaks will not always be in the same locations, so multiple sensors will be required. So it will be a bit complex.