🛠 Complete Use Case: Weather Dashboard with M5Stack PaperDIY

M5Stack PaperDIY Complete Kit ESP32-S3 e-paper Development Kit · debutant · Apprenez à combiner le WiFi, l'écran e-paper et le stockage MicroSD pour créer un tableau de bord autonome affichant la météo locale.

Objectifs

This tutorial guides you through creating a functional weather dashboard. You will learn to initialize the ESP32-S3 core module, establish a WiFi connection, fetch data via an API, display information on the 4.7-inch e-paper screen, and save the latest data to the MicroSD card. This project illustrates the synergy between wireless connectivity, low-power display, and local storage of the PaperDIY kit.

Matériel nécessaire

Étapes

  1. Environment Configuration: In Arduino IDE, select the 'M5Stack-ATOMS3' or 'M5Stack-CoreS3' board depending on your configuration, then choose the COM port corresponding to the PaperDIY.
  2. System Initialization: In the setup() function, call M5.begin() to initialize the e-paper display and the ESP32-S3 core module. Configure the display in 16-level grayscale mode for better readability.
  3. WiFi Connection: Use the WiFi.h library to connect to your local network. Insert your SSID and password credentials. Verify the connection with a while(WiFi.status() != WL_CONNECTED) loop.
  4. Data Retrieval: Use the HTTPClient library to send a GET request to a free weather API (like OpenWeatherMap). Parse the JSON response with ArduinoJson to extract temperature and conditions.
  5. Display on Screen: Clear the screen with M5.Display.clear(). Use M5.Display.drawString() to display the temperature and condition text. Remember to call M5.Display.update() to refresh the e-paper screen.
  6. MicroSD Backup: Initialize the SD card with M5.SDCard.begin(). Open a data.txt file in write mode (FILE_WRITE) and write the current weather data to preserve it during power outages.

Vérification

After uploading, the screen should display the updated temperature and weather conditions. Insert the MicroSD card into a computer to verify that the data.txt file contains the latest recorded data. If the display remains blank, check that the 8-bit parallel interface is correctly initialized by the library.

Pour aller plus loin

Explore the deep sleep mode of the ESP32-S3 SoC to extend the battery life of the 140mAh battery. You can also add a physical button to force a manual update or use Bluetooth 5.0 LE to configure WiFi without code.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials