HTMAA Week 12
Assignment Description:
write an application that interfaces a user with an input &/or output device that you made
Application & Interface Week
In Week 10 I created the main control board for my Final Project utilizing a Raspberry Pi Pico. It manages the sensors and the pumps.
I additionally want to add a mini OLED screen to show update messages for the user. Moreover, I want to host a web page for the user to interact with the device and perform actions like testing pumps, viewing status, and viewing the camera feed (or just pictures) of the gardens.
I want to use the ESP32S3 Sense board I created in Week 11 to run this process. I broke out the I2C pins for the screen, and it is capable of hosting a web server and taking photos.
The Screen
As I mentioned, I intended to run the OLED screen from the Sense board. However, I could not get the board to find the screen. I tried all kinds of things: I2C scanners, different screens, different connectors, the gamut. I am unsure if I did not set up the pull down resistors correctly or if I fried the board partially when I soldered it via reflow. Moreover, I planned to connect an array of buttons for my final project to the board, but I decided I didn't really need buttons and preferred a cleaner external appearance.
To make sure the screen worked, I tested it on my simple RP2040 board from week 6.

I wrote the following code to interact with the screen and do things like print multi-line messages and draw a smiley face:
- screen_code.py - Functions for testing and using the OLED Screen
- ssd1306.py - Driver for the screen (source)
Instead, I decided to use the I2C pins on the Pico Control board, which were unclaimed. I assumed it wouldn't work because they did not have pull-down resistors, but it worked!
Here it is integrated into the final project housing and the device's code:

When Juggy goes to sleep, he smiles!

The Web Interface
As I mentioned previously, I want the Sense board to host a web server where the user can interact with Juggy. This code implements a simple web interface that sends messages over serial to the Pico Control Board to turn pumps off and on.

During each loop, Juggy checks for messages over serial and acts on any received from the Sense board. Moreover, the Sense board takes a photo every hour to compile into a timelapse.
I intend to extend functionality to make this interface more appealing as well as add support for viewing status updates from Juggy and images.