Irrigation – Part 5: Software Update

Having my first results in hand I have to modify my software a bit. The DHT11 sometimes give strange measuring values (0°C, 6°C) and I want to change my measuring procedure. I will measure 3 values for temperature and humidity and I will take the middle values. The soil moisture measurement is quite unstable so I will take the average of three measurements.

Additionally I have cleaned up the code structure.

I had troubles with two issues:

  • My measurement values are stored in arrays of struct. I learned that the typedef must be done in a header.
  • The ESP8266 does not support the std library. So I use a macro for the min function

That’s the result:

 

Leave a Reply