✅ Cómo conectar tu ESP32 a EXCEL en Google Drive y monitorear SENSORES en tiempo real

BeCircuit
22 Aug 202412:14

Summary

TLDRIn this video, Catlin demonstrates how to send data from an ESP32 board to a Google Excel sheet via Wi-Fi, creating a real-time database for sensor readings or system states without relying on external services. Using the ESP32's built-in temperature and humidity sensor (SHT30), data is read every two seconds, converted into JSON, and posted to a Google Apps Script linked to a Google Sheet. The tutorial covers connecting to Wi-Fi, setting up the Excel sheet, coding the ESP32, implementing the Apps Script, and verifying successful data transmission. Catlin also highlights customization options for additional sensors and encourages viewers to explore further electronics projects.

Takeaways

  • 😀 The video demonstrates how to export sensor data from an ESP32 board over a local Wi-Fi network to a Google Excel sheet.
  • 😀 The main sensors used in the example are the SHT30 temperature and humidity sensor included on the ESP32 board.
  • 😀 The ESP32 reads sensor data every 2 seconds using the millis() function instead of delay() for non-blocking timing.
  • 😀 Sensor readings are converted into a JSON string and sent via an HTTP POST request using the HTTPClient library.
  • 😀 A Google Sheet is created in Google Drive with columns for timestamp, temperature, and humidity to store the data.
  • 😀 Google Apps Script is used to create a web app URL that listens for POST requests and appends new rows to the sheet.
  • 😀 The URL from Google Apps Script is inserted into the ESP32 code along with Wi-Fi credentials before uploading the sketch.
  • 😀 The code includes serial monitoring at 115,200 baud to display sensor readings and HTTP response status codes.
  • 😀 The implementation allows real-time data logging directly into Excel without the need for external services.
  • 😀 The setup can be extended to include additional sensors or other ESP32/ESP8266 boards, and the system is adaptable for various projects.
  • 😀 Proper Google authorization steps are necessary to allow the ESP32 to write data to the Google Sheet.
  • 😀 The video encourages viewers to join a mentorship program for learning electronics, Arduino programming, and ESP32/ESP8266 projects.

Q & A

  • What is the main purpose of the video?

    -The video demonstrates how to export data from an ESP32 board over a local Wi-Fi network to a Google Excel sheet, enabling the creation of a local database for sensor readings or system status without using an external service.

  • Which sensors are used in the example project?

    -The example project uses the SHT30 sensor included on the ESP32 board to measure temperature and humidity, although the method can be adapted for other sensors or data types.

  • What role does the ESP32 board play in this project?

    -The ESP32 board reads sensor data, connects to the local Wi-Fi network, converts the readings into JSON format, and sends them via HTTP POST requests to a Google Apps Script URL that updates an Excel sheet.

  • Why is JSON used in this project?

    -JSON is used to structure the sensor data with labels (e.g., temperature and humidity) so that the Google Apps Script can accurately identify and insert the values into the corresponding columns in the Excel sheet.

  • How is the ESP32 connected to the Wi-Fi network?

    -The ESP32 is connected by including the Wi-Fi library in the code, specifying the network SSID and password, and running a subroutine that attempts to connect for up to 10 seconds, displaying the assigned IP address or a failure message on the serial monitor.

  • What is the purpose of using the millis() function instead of delay()?

    -The millis() function is used to schedule sensor readings every 2 seconds without blocking the program execution, allowing continuous data processing and Wi-Fi communication, unlike delay(), which halts the program.

  • How is the Google Apps Script set up to receive data?

    -A Google Excel sheet is created, and an Apps Script is added under Extensions > Apps Script. The script listens for POST requests, extracts data using predefined labels matching the ESP32 JSON, and appends new rows with timestamps and sensor values.

  • What steps are required to deploy the Apps Script?

    -The script must be deployed as a web application, configuring access permissions to allow any user to send data, authorizing the app through a Google account, and then copying the provided URL to the ESP32 code.

  • How frequently are sensor readings sent to the Excel sheet?

    -Sensor readings are sent every 2 seconds, as controlled by the timing variable in the ESP32 code using the millis() function.

  • What response indicates successful data transmission to the Excel sheet?

    -The ESP32 shows an HTTP response code 200 on the serial monitor, which confirms that the data was successfully sent and processed by the Google Apps Script.

  • Can this method be adapted for more sensors or other data types?

    -Yes, additional sensors or data points can be added by creating new JSON labels in the ESP32 code and corresponding columns in the Excel sheet, allowing the database to store multiple types of readings.

  • Are ESP8266 boards compatible with this approach?

    -Yes, the method can also be applied to ESP8266 boards, or any other microcontrollers capable of connecting to Wi-Fi and sending HTTP POST requests with JSON data.

  • What are the benefits of using this local Excel-based approach instead of an external service?

    -It allows real-time data collection without relying on third-party services, maintains privacy by keeping data local, and provides a simple interface for storing, viewing, and analyzing sensor readings with timestamps.

Outlines

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Mindmap

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Keywords

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Highlights

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now

Transcripts

plate

This section is available to paid users only. Please upgrade to access this part.

Upgrade Now
Rate This

5.0 / 5 (0 votes)

Related Tags
ESP32IoTGoogle SheetsApps ScriptWiFi DataSensor LoggingJSON DataHTTP POSTArduino CodingTemperature SensorHumidity SensorData LoggingElectronics ProjectReal Time