WebServer implemented using the WizFi360 Arduino library. Displays BME280 environmental data locally and interacts with WebClients
I wanted to implement an MQTT server on the WizFi360 using the Arduino library, I couldn't get the MQTT functions working. I decided instead to implement a WebServer that displays BME280 sensor data (temperature/humidity/pressure) locally on a 128x64 I2C OLED and also sends that data over WiFi in response to a WebClient request.
A Pico Breadboard is being used to assemble the components. I am using a BME280 sensor which hooks up to the the WizFi360_Pico_EVB via I2C0. In the Arduino IDE using the https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json board library, SDA is on GPIO8 and SCL is on GPIO9. The SSD1306 OLED display is also on I2C0 and is wired in parallel. The LED that I am controlling via the WebClient is LED1 which is the left-most LED at the lower right of the breadboard.
Besides the earlephilhower RP2040 board library the following software libraries are required to operate the board and OLED and BME280:
The board is selected in the Arduino IDE using the Board Manager:
The video shows the WebServer operation. When the program starts, it connects to my local WiFi access point and the connected IP address is shown in the Serial Monitor window. Opening that IP address in a browser will display the webpage on the left.
When the button is pressed in the webpage, LED1 will toggles and the RP2040 core temperature and BME280 data will update in the webpage and on the OLED screen.
Bonus content - Grove AI Camera
I had also hoped to add some AI content to the project, but I don't think that an asynchronous webserver is implemented in the Arduino library yet. I was going to use a Grove AI Camera from Seeed Studios and I did get it hooked up and working with the WizFi360 EVB Pico. I thought I would show it working in a standalone mode (not using the WebServer). The camera also interfaces with the Pico board using the same I2C0 as the other components. The camera is running a face detection model and transmits the detection information over I2C and I display it on the OLED and also print it out to the Serial Monitor. The camera image and bounding box visualization is done via USB Serial from the camera to a browser webpage on my PC.
WizFi360 WebServer Program
Support definitions and functions for the SSD1306 OLED
WizFi360 WebServer Schematic.jpeg
Diagram of WizFi360 EVB Pico connections to OLED and BME280
Face detection using Grove AI camera