Skip to content

1. Setup GrowOne

Maximilian Bauer edited this page Dec 5, 2023 · 4 revisions

The following instructions describe one possible way on how to install GrowOne on your hardware and how to connect supported hardware components to the board. Please note that it can not be guaranteed that these steps will work exactly as described on your specific hardware and might require some additional tinkering and debugging - so having some experience with C# and electronics is strongly recommended.

1.1 Software

To install GrowOne on your ESP32, you will need:

The ESP32 should then be flashed with the most recent nanoFramework firmware. Assuming your ESP32 is available through the serial port "COM3", this can be done using the following command:

nanoff --update --platform esp32 --serialport COM3

Alternatively to compiling GrowOne yourself and deploying it from within VisualStudio (as described below), cou can also flash the firmware directly with the most recent binary of the GrowOne application found under "Releases" using the following command:

nanoff --update --platform esp32 --serialport COM3 --deploy --image "GrowOne.bin" --address 0x1B000

In any case, after the firmware has been flashed to the ESP32, open up Visual Studio, switch to the nanoFramework "Device Explorer" window (found in View > Other Windows > Device Explorer), select your device and set up your Wifi connection by clicking on the "Edit Network Configuration" button and switching to the "Wi-Fi profiles" tab. Make sure to set the "Options" drop-down to "Enable".

Then, you can either build and deploy the project to the device - or run it directly from Visual Studio. For debugging (and seeing status messages in the debug output), make sure to use the "Debug" mode - for deploying, the "Release" mode should be used (which works faster and doesn't output debug messages) and the device should be restarted.

If everything went well, you should now be able to access the web interface by entering http://[DEVICE_IP] into your browser (HTTPS is currently not supported). As there is no password configured by default, just click "Login" - and you should be seeing the "Stats" screen. If no sensors are currently connected to the device, only two (invalid) readings will be displayed. Switch to the "Settings" tab - and see the pins currently configured for the various supported components at the bottom of the page. It is recommended to write down the default pin numbers for each component, turn off the device and connect the components accordingly (see instructions below). After turning the device on again, any readings from the new sensors should appear on the "Stats" page.

If a piezo buzzer was already connected, the state of the device will be communicated via different audio signals. The start of the initialisation sequence will be indicated by a single beep, the completion of the initialisation - meaning that the device is connected to the Wifi and the web interface was started - is indicated by a rising sequence of two beeps. Restarting the device will play a sequence of two descending beeps. A serious error is indicated by 4 descending beeps and is usually followed by a device reboot.

1.2 Hardware

The software was written using an development board with an ESP32-WROOM-32 chip, 4MB flash, 520KB SRAM (without PSRAM). It can either be used on a breadboard and then connected with all required components and a power source via jumper wires, or soldered to a prototype board. As the approach described below was built using parts already available, it might not be the best or most economic - so the following should be seen as the description of a proof-of-concept rather than a step-by-step instruction.

1.2.1 Power source

In the approach described here, an external 12V power source was both connected to a step-down converter that had a 5V output, as well as to a magnetic valve that released water into the plant when powered. The 5V from the step-down converter were then used to power the relais, the HC-SR04 sensor (described below) and the ESP32 board itself. It should be noted that this could be simplified to connect a 5V converter directly to the board and use a pump with a lower voltage instead - but the small low-voltage pumps used in early development got clogged and stalled frequently due to sediments from the fertilizer in the water.

1.2.2 HC-SR04 (water fill level)

As mentioned above, the HC-SR04 sensor used for checking the fill level of a connected water tank requires a 5V power input. The "HC-SR04 echo pin" and the "HC-SR04 trigger pin" (25 and 26 by default) need to be connected to the "ECHO" and the "TRIGGER" pin of the module. For additional protection of the ESP32 from overvoltage, an additional 1kΩ resistor was added between the "ECHO" pin of the module and the GPIO pin of the board (source).

1.2.3 DHT22 (temperature and humidity)

For connecting the temperature/humidity sensor DHT22, the "DHT22 echo pin" and the "DHT22 trigger pin" (12 and 14 by default) need to be connected to the "DATA" pin of the sensor. If the module doesn't have a built-in 10kΩ resistor, one has to be added between the data pin and +3.3V. For more information, see the Github page of the used NuGet package Iot.Device.Dhtxx.Esp32. When trying to boot the ESP32 using an external power source while the sensor was connected, the used device seemed to freeze before even loading GrowOne - as it wasn't possible to find the bug in GrowOne, the "Sensor switch pin" (22 by default) can be used to control a relais that interrupts the connection to the sensor data pin until the program is actually initializing. Alternatively, that "SensorSwitchPin" could also be used as +3.3V for the sensor - but this hasn't been tested.

1.2.4 Capacitive soil moisture sensor

The analog soil moisture sensor (like the ones with the "Capacitive Soil Moisture Sensor v1.2" label) can be connected by wiring the "AOUT" pin of the component with the "Moisture sensor pin" of the ESP32 board (as well as the VCC to 3.3V )

Relais

The relais used for this approach has 4 separate switches, where one was used for controlling the magnetic valve and another one for interrupting the data connection to the DHT22, as mentioned before. While the relais requires a 5V power source, the switches can be triggered with the 3.3V coming from the ESP32 board. Therefore, after connecting the "Sensor switch pin" (22 by default) to the associated relais pin interrupting the data connection to the ESP32, the other relais pin needs to be connected to the "Irrigator switch pin" (23 by default).

1.2.5 Piezo buzzer (signaler)

For informing the user of the device state, configurable warnings or errors during operation, a piezo buzzer can be connected by wiring the "Buzzer pin" (18 by default) to the "+" of the buzzer and its "-" to the GND pin of the board.