Programming Web "/> How to Display live data from an Arduino on a webpage GameDev Web "/> Working with Pneumatics Electronics Pneumatics "/> Velleman KA05 / VMA05 pinout Electronics "/> Assembling the Prusa MK3 3D Printing "/> Requiem for a Reprap - packing down the BAM printer 3D Printing BAM printer "/> General PCB design tips Electronics PCB "/> Persistence of Vision with APA102 Electronics Blinky! "/> Getting started with STM32F0 Electronics Microcontrollers "/> Xmas cleaning and new workspace Electronics 3D Printing BAM printer Misc "/> MegaMatrix 1.0 Electronics Blinky! "/> Particle memory limitations and workarounds Electronics Microcontrollers "/> Level shifting NeoPixels for Particle Photon Electronics Microcontrollers Blinky! "/> Odd Particle Photon error messages and what they can mean Electronics Microcontrollers "/> Easter funtime with KiCad Electronics PCB "/> Embedding myself in devices Electronics Microcontrollers Projects "/> Basic Blink example for dsPIC30F4013 Electronics Microcontrollers Blinky! "/> Makeblock mBot review Electronics Robots "/> Playing with LoRa radio Electronics RF "/> Milling 2-sided PCB’s Electronics PCB "/> Buying a laser cutter for your Hackerspace Hacking/Making "/> React with Javascript package managers Programming Web "/> Call me! (with Adafruit FONA) Projects Microcontrollers "/> Fixing avr-eclipse paths Programming "/> Testing with Testflight Programming Mobile "/> Popcorn Time! Misc "/> Including Native extensions on OSX Programming Mobile "/> Filament review: Printing with potatoes? 3D Printing Materials "/> Beta testing for Makeblock Electronics Robots "/> ESP8266 and stability Electronics Microcontrollers "/> Spark Core shows solid magenta LED Electronics Microcontrollers "/> Unpacking the Titan 1 3D Printing SLA "/> Filament review: PlastInk Rubber 3D Printing Materials "/> Filament review: ColorFabb PLA-PHA variables 3D Printing BAM printer Materials Ultimaker "/> Teaching with robots Electronics Robots Projects "/> Filament review: NinjaFlex rocks! 3D Printing BAM printer Materials "/> Filament Review: PET+ from MadeSolid 3D Printing BAM printer Materials "/> Making a custom 3D printer controller Electronics 3D Printing "/> Why I’ll never use Windows Phone again Mobile "/> Project: Makeblock 3D printer Electronics Robots 3D Printing Projects "/> Project: wifi-enabled RGB LED displays Electronics Microcontrollers Projects "/> Summertime Projects "/> Ultimaker - preventing the extruder from plugging 3D Printing Ultimaker "/> Filament review: Colorfabb XT 3D Printing Materials Ultimaker "/> What platform next? Programming "/> X/Y robot with MakeBlock (Part 4) Microcontrollers Robots "/> X/Y robot with MakeBlock (Part 3) Robots "/> X/Y robot with MakeBlock (Part 2) Microcontrollers Robots "/> Apple is not currently accepting applications built with AIR 3.9 Programming Mobile "/> X/Y robot with MakeBlock (Part 1) Electronics Robots "/> Time for Maker Faire again! Electronics Robots Hacking/Making "/> Error occurred while installing the application: Invalid specified Programming Flash "/> Raspberry Pi or Arduino? Electronics Microcontrollers "/> Heated Build Platform update 3D Printing Ultimaker "/> Heated Build Chamber for Ultimaker 3D Printing Ultimaker "/> Promoting 3DP 3D Printing Ultimaker Hacking/Making "/> 3D printing trick: ABS sludge 3D Printing Heated bed Materials "/> Making a scale for Arduino with INA125 Electronics Microcontrollers "/> Project: pressure sensitive floor Electronics Microcontrollers Projects "/> Custom PCB’s with Fritzing Electronics PCB "/> VerifyError: Error #1102: Illegal default value for type int Programming Flash "/> Maker Faire Oslo Hacking/Making "/> Filament review: Conductive ABS from Repraper 3D Printing Materials "/> My first PCB - a DS1307 based realtime clock Electronics PCB "/> Printrbot Jr Heated bed upgrade 3D Printing Printrbot Jr "/> 3D Printer meetup #3 3D Printing Makerbot Printrbot Jr Ultimaker Hacking/Making "/> Meetup Pocket Sign Electronics Microcontrollers 3D Printing Hacking/Making "/> Unexplainable errors in Flash Builder 4.7 Programming Flash "/> A two dollar programmable FM radio Electronics Microcontrollers "/> 2012 - what a difference a year makes Misc Projects "/> Tutorial: making Gravitech’s MP3 Player add-on work Electronics Microcontrollers "/> Using Printrbot Jr with Kisslicer 3D Printing Printrbot Jr "/> Printrbot Jr - built by Jr! 3D Printing Printrbot Jr Hacking/Making "/> 3D Printer weekend 3D Printing Printrbot Jr Hacking/Making "/> Installation Error: ApplicationVerificationFailed Programming Mobile "/> The slow climb of HTML5 Programming GameDev "/> Dead HDD = a 3DP moment 3D Printing "/> How to update the official Arduino Wifi Shield Electronics Microcontrollers "/> SafeFrames for mobile apps Programming Mobile "/> Flash Builder fails to start Programming Flash "/> AIR package has no certificates at entry in AIR Programming Flash "/> JY-MCU Pro Mini (made in china) Electronics Microcontrollers "/> Heated Build Platform (Take 3) 3D Printing Heated bed Ultimaker "/> Warming up to browser apps Programming GameDev Projects "/> Rock in the road Misc "/> 3D printing with Color! 3D Printing Materials "/> MK1 heated bed and different power supplies 3D Printing Heated bed "/> Heated Build Platform for Ultimaker Electronics 3D Printing Heated bed Ultimaker "/> About Archive Arduino Companion 1.1 Programming Mobile "/> ExpressionEngine: redirecting based on group_id Programming Web "/> SAEF’s annoying default Programming Web "/> My new Ultimaker 3D printer 3D Printing Ultimaker "/> Arduino Serial - a real retro-arduino Microcontrollers "/> Updated ADXL345 library for Arduino 1.0 Electronics Microcontrollers Programming "/> Using your Arduino as an ISP Electronics Microcontrollers "/> Makerbotting 3D Printing Makerbot "/> Making a good cube 3D Printing Makerbot "/>

HiGrow ESP32 moisture and temperature sensor

20 July 2019 at 11:09 pm

Article image for HiGrow ESP32 moisture and temperature sensor

​This summer I’m researching plant monitoring using IoT devices running on solar power. One of the obvious boards to test is the HiGrow boards you’ll find on asian websites. There’s not much info around on these, so I’m documenting my findings in this post.

For this autumn I want my M2M (Machine to Machine Communication) students to work with plant monitoring. Given that plants are happy if they have access to some minerals, UV rich light and moisture, it should be fairly simple to set up a tiny IoT “farm” somewhere on the new premises of the school. For this to work, I’ll need an inexpensive board that I can hand out to the students.

Browsing AliExpress, DX, Banggood and similar sites for moisture sensors that you can control yourself, will typically return one of two results that come at a good price. Both are based on the same Open Hardware design and the original creator has closed down the project. Of the two boards found online, one is just the sensor and the other is the HiGrow board that comes with a full ESP32 onboard.

HiGrow board vs sensor board
HiGrow board vs sensor board

The sensor is about a dollar and the ESP32-based version is around ten dollars. Of these two, it’s more convenient with an integrated solution so I’ll focus on the HiGrow board though the sensor is a good alternative if you want to keep the microcontroller out of contact with the soil.

Here’s shortcuts to what I’ve found this far:

HiGrow features

The HiGrow is a complete development board for monitoring plants. Here’s a list of the features you get for about $10:

  • Espressif Wroom 32 rev 1 module (pinout). A powerful 32 bit microcontroller running at 80Mhz with WiFi radio and PCB antenna.
  • CP2102 serial chip for programming the ESP32
  • TP5410 lipo charger that’ll charge an optional 18650 lipo cell. The board contains two status LEDs showing charge status (red=not charging, green=charging)
  • DHT11 humidity and temp sensor on gpio/pin 22. Does not look original, but should do the job well enough based on my testing
  • Capacitive sensor on gpio/pin 32 / analog pin 6
  • User LED on gpio/pin 16
  • Power switch

That’s all there is. The main sensor on the board is a capacitive moisture sensor based on a 555 timer generating an analog value based on capacitance. The sensing is fairly simple but works well. The board also holds a (fake) DHT11 sensor that can measure temperature and humidity fairly precisely. Using these two sensors, you can to some degree know if it has been raining recently (increased moisture) or if the sun is shining by comparing the reported temperature to weather data online. Not super precise, but good enough to know if your plants need water.

Sensor and IC's on the board
Sensor and IC’s on the board

The user LED and power switch may seem insignificant, but they are indeed useful for debugging and programming. The LED can be used to show the status when you are out in the field and do not have a USB cable connected. The power switch is very handy for doing a hard reset if the ESP module throws programming errors when you try to program it.

You’ll find other sketches that indicate that there should be power monitoring on pin 34 and a light sensor on pin 33. This is for the V2 board that is not commercially available.

Power consumption & drawbacks

On startup, the board pulls about 130mA, but over time it stabilises around 45-50mA. Without Wifi enabled, the board will pull about 20mA.

This video by Mark Furneaux details some of the drawbacks of this board. Here are some of his findings:

  • Using MicroPython also works, but is a little inefficient
  • Despite enabling Deep Sleep on the ESP32 it will still consume 20mA since the sensors are always on. This limits how long you can run the board using the 18650 lipo battery it comes with.
  • The board isn’t very well protected against the elements, so it is limited to indoor use unless you improve it in some way

Mark published his video in November 2017, so I’m guessing he didn’t have time to take this project further?

Updating the HiGrow firmware

Since the board is based on the wroom-32 module, it’s very straightforward to work with.

That’s all you need to upload and play around with it. I’ve also made a few more examples:

Why Capacitive sensing?

The most basic moisture sensor is just two nails with wires connecting them to a microcontroller. You can get these $1 sensors that is basically just a PCB that does the same as those nails. The problem with these sensors is that they will corrode and may even in som cases affect the plant negatively. Capacitive sensors on the other hand does not affect the plant in any way and they have the potential to last for a long time. Andreas Spiess has a great video explaining the difference between these sensor types.

Typical capacitance values for sand, mulch & soil

I’ve done some preliminary testing using sand, mulch & soil and the table below lists some typical values. A typical value for the sensor not touching anything is above 3100. If touching very wet medium, the value can dip to below 1500. Keep in mind that this is just a very rough scale to give an die of the output values you can expect from the 10bit ADC on the ESP32.

sand mulch
soil
Dry 2747 2958 - *)
Slight moisture 2501 2731 - *)
Moist 2108 2362 - *)
Very moist 1636 1856 - *)
Wet/soaking 1513 1488 - *)


*) Thanks to a massive downpour, I currently haven’t got access to dry soil right now so I’ll fill these in later.

If the board is online, you can see live values at the moment at https://thingspeak.com/channels/829281

HiGrow origins and status

The project seems to have originated from Github user @lucafabbri who created code for both both Arduino (no longer compiles) and Mongoose OS. Based on info found in the issue list for the Arduino code and the original Hackaday post, it seems that he is also the originator of the PCB design given that he mentions a V2 design? The project website higrow.tech is now deleted and the domain is for sale. The Arduino version of the code was last updated 2 years ago. The Mongoose OS version was last more than a year ago, so I can only guess that he didn’t have time to maintain the project and complete version 2?

Well, thanks to Chinese websites it seems the HiGrow design will be around for some time. If you need a better maintained project - Catnip electronics on Tindie seems to be on the right path. For now, the HiGrow board is sufficient for my use.