Skip to content

(hackathon submission) visualizing co2 data from an esp32 microcontroller

License

Notifications You must be signed in to change notification settings

sueszli/hackzurich

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Untitled

Visualize data in real time from your Sensirion CO2 sensor!




🔧 Preparing the Hardware

  1. Download the “Arduino IDE”

  2. Install the Sensirion library called "Sensirion I2C SCD4x"

  3. Install a new board

  4. Select the "ESP32 Dev Module": Tools > Board > esp32 > ...

  5. Select the right port of your board

  6. Load a demo file to test it out: File > Examples > 01. Basics > BareMinumum

  7. Press the arrow to flash your ESP32. As soon as you establish a connection, hold the boot button, then press the reset button once.

  8. Connect the sensor to the ESP32 as shown here or here:

    First connect ground and power pins from sensor to the ESP32 and then connect the other cables to any pin you want.

    The green cable is the SDA (in the image below we have chosen pin 4) and the yellow cable is the SCL (in our case we have chosen pin 2).

  9. Connect to the ESP32 from your PC after the sensor was connected to it

    i. - Choose File > Examples > Sensirion I2C SCD4x > exampleUsage.
    ii. - Add Wire.begin(4, 2); after the while (!Serial) loop.
    iii. - Press the arrow in the top left corner to Upload.
    iv. - As soon as you establish a connection, hold the boot button, then press the reset button once - voila!

  10. Establish a serial connection and read the live data stream using terminal based tools or a lightweight C library.




🔧 Running the Software

  1. Attach the ESP23 microcontroller and the sensor to your Linux PC (not Windows or MacOs, also Windows-WSL doesn't work because peripherals from the /dev path don't get emulated correctly).
  2. You may need to update the path to your device in backend/main.c.
  3. In the backend directory run the build.sh script and then execute the main executable to run the backend.
  4. Then open up the js_frontend/index.html file and enjoy the sweet real time visualization!

About

(hackathon submission) visualizing co2 data from an esp32 microcontroller

Topics

Resources

License

Stars

Watchers

Forks