Week 10

PS Error

The goal for this week was to reconnect the moisture sensor that was working with my old board, reading and printing values, to an ESP32 board so that I could send the data to the cloud. However, I underestimated the difficulties that using the board I chose would be.

The goal for this week was to reconnect the moisture sensor that was working with my old board, reading and printing values, to an ESP32 board so that I could send the data to the cloud. However, I underestimated the difficulties that using the board I chose would be. Down below, we can see the pinout configuration for the ESP32 CAM board that I chose to use (I wanted to take advantage of the camera to keep an eye on my plants visually). The moisture sensor that I am using needs a low voltage ADC input, which is sparse on this board. The ones that I found to work consistently were 4 and 14, and since 4 was connected to the SUPER BRIGHT LED, I decided to use 14. It took a lot of debugging to identify this, especially because there seem to be other ADC ports, but they stay at HIGH, so they overpower the signal from the sensor.

PS Error

Eventually, though, I was able to get the sensor to work, printing out values in the serial monitor. Then, all I seemingly needed to do was integrate with Firebase, upload the data at specific intervals, and the rest would be fine. I soon found out that the specific ADC ports that I identified as the only ones working were ADC2, and were disabled when WiFi connectivity was enabled. This meant that I had to find a way to connect to WiFi, and then disable it, and then re-enable it to upload the data to Firebase. This was a lot more difficult than I thought it would be, and I spent a lot of time trying to figure out how to do it. There were different commands to disconnect from WiFi and to enable the ADC and vice-versa, but eventually I found the right series of commands to disable the WiFi and renable it again.

PS Error PS Error

So the new process, was: disable WiFi, enable ADC, read sensor, disable ADC, enable WiFi, upload data to Firebase, and then repeat. This was a lot more annoying than expected, but in the end it worked. I could see the moisture values on Firebase!

PS Error