After the completion of version one I felt the performance of the system was lacking modern features, thus my goal for version two was to incorporate a more recent MCU and to explore IOT by developing my own backend framework. Additionally version two would have an increase in the volume of plants in its care which had eclipsed the capabilities of the singular pump in version one.


HMI.

In the second version I focused on improving the interface:

The 16x2 LCD in version one lacked modern features such as on-screen buttons and custom indicators.

The new interface was based off a nextion basic series 2.4” TFT display

Using the nextion editor development environment I created a multipage layout with intuitive controls for temperature, water, light, time, and Wi-Fi options.

I was able to pipeline control instructions from the screen to the PCB over serial UART.

The screen has a built-in command set for controlling the display which helped create a feedback loop between the MCU and the screen.


PCB design.

The PCB followed a similar design to the first version:

A few components were carried over from the first version, such as the SMPS, the RTC and the motor control MOSFETs.

New to version two, the MCU was replaced with an ESP32 featuring a higher clock frequency and dual cores.

The soil sensors were switched with shielded higher resolution capacitive sensors.

A new piezoelectric humidifier was added to control the climate in the tank. This required a boost converter to amplify a waveform that followed the device's resonant frequency.

The watering system was reworked using multiple peristaltic pumps to create four controllable zones.

Along with the new motors a SN74LV4051AN 1:8 Multiplexer and a SN74HC573AN 8:8 D-Latch were used to control all zones with only 3 pins on the MCU.


Internet Of Things.

One of the main focuses of the new version was making the device easy to interact with online:

To successfully create a web-based application running from the ESP32 required in-depth knowledge of web sockets, frontend, and backend web development.

To this end I learned, HTML, CSS, JavaScript, and JSON through out the project.

After learning the fundamentals, I set to work creating a JSON pipeline that could read and write data on the ESP32.

This pipeline could then be modified by both the client and host to present live data from the sensors while allowing users to control the system remotely.

Using common libraries, the ESP32 can act as its own Wi-Fi soft access point to collect logon information for the network the device will join later.

After which, the ESP32 can present an HTML page that is embedded as a string in C on the connected local network.

This live page can be accessed locally or globally at the user's discretion.


Firmware.

The Firmware had to be rewritten from the ground up:

In version two, many hardware level changes necessitated a rewrite of the backend firmware.

For example, the combinations of pins A, B, and C on the 1:8 multiplexer allowed the MCU to use a pre-programmed truth table to control up to 8 devices with only 3 pins differing from the direct I/O connections in version 1.

Now that the MCU has two cores, the firmware handles Wi-Fi connectivity on one core while running watch dog tasks and sensor polling on the other.

Each back-end process was scheduled in a round robin fashion. In this way all tasks get an equal section of time to complete while maintaining fluidity of processing.

Several functions had to be written to collect data from the peripherals and then adjust the data for communication between the HMI and the web socket.

Included in this data processing is an exponentially weighted moving average filter to help keep the system from falsely triggering a watch dog parameter with a single bad reading.


In summary, version 2 brings many hardware and software changes to the platform expanding the capability of the device while also updating it to use more modern solutions.