Close
0%
0%

EnviroPi Temp Monitor

Combining a Raspberry Pi Zero 2 WH computer with an Adafruit MCP9808 temperature sensor.

Similar projects worth following
For my first project on Hackaday, I am starting simple by combining a Raspberry Pi Zero 2 WH computer with an Adafruit MCP9808 sensor. The MCP9808 will measure ambient air temperature once every second with Python. Said data will be logged to a CSV file, eventually exported and later visualized using the D3 JavaScript library.

This early-stage project is part of a larger personal interest in DIY self-quantification. As I move forward, I will update this page with more information and context.

Below are instructions for replicating and running this project.

Instructions

  1. Upload the Python file to a Raspberry Pi Zero 2 WH via SSH and run it using the following command: python3 app.py
  2. Before exiting your terminal session from step one, use Screen to keep the Python file operating.
  3. Allow your Raspberry Pi computer and Adafruit sensor contraption to record data for as long as desired.
  4. Once you have collected enough temperature data, export your temperature_log.csv file from the Raspberry Pi unit, onto your main computer.
  5. Finally, visualize your data using the HTML, CSS and JavaScript files provided on the related GitHub repository.

Please Note

There are two kinds of graphs available for exploring your temperature measurements. The first (type of) chart displays an average twenty four hour period, based on all of your readings. Whereas the second variety of charts displays each day's measurements, from when measurements began until their ending.

Also, in my experience, the Python file will generate between three and four megabytes of data every twenty four hours. Although your results may vary.

app.py

The primary Python script for recording temperature readings.

x-python - 1022.00 bytes - 01/28/2025 at 02:38

Download

  • 1 × Raspberry Pi Zero 2 WH
  • 1 × Adafruit MCP9808 Temperature Sensor
  • 4 × Breadboard Jumper Wires

  • Temperature Measurements Actively Being Recorded

    Bret Bernhoft01/28/2025 at 02:33 0 comments

    After a couple hours of work, to my great delight and relative astonishment, the Adafruit MCP9808 sensor has been successfully connected to the Raspberry Pi Zero 2 WH computer. The contraption is actively measuring ambient temperatures once per second, and storing said data in a common, local CSV file.

    I will run this experiment for roughly two or three weeks. Afterwards, I will export and visualize the information using D3; my favorite data graphing JavaScript library. In the meantime this "EnviroPi Temp Monitor" project needs to be clearly organized, including the addition of Python scripts and instructions on how to replicate.

    To keep things interesting, I am dreaming up my next Hackaday.io project. But that is fun for another time. Let's stay (mostly) focused on what is already in front of us. There is still a bit more to do here.

  • My First Attempt At Soldering Was A Success

    Bret Bernhoft01/16/2025 at 02:44 0 comments

    Tonight I soldered header pins to the Adafruit sensor I am using for this project. I noticed the temperature on my Weller soldering iron varied quite a bit during the soldering process. But after cleaning the iron's tip, everything stabilized as expected.

    What makes this soldering especially interesting and notable to me, is the fact tonight is my first time ever trying. And it was a success. The joints are solid, there are no solder bridges and I didn't use excessive material.

    The next step is to test the sensor component's connectivity with my Raspberry Pi computer. If I am able to verify the two are communicating, I can write the software for collecting temperature readings. And get this project on its way in earnest.

  • Purchased Soldering Equipment Today

    Bret Bernhoft01/11/2025 at 03:00 0 comments

    As this is my first Hackaday.io project, it is also my first attempt at soldering. While I have already been using Raspberry Pi computers and the Python programming language for self-quantification, my experience with assembling electronics is relatively limited. I have built numerous desktop PCs, but only a few devices weighing less than a pound or two.

    Today I purchased the equipment needed to solder. Once the hardware arrives, I will begin this journey by connecting header pins to the Adafruit MCP9808 temperature sensor. From there, I will be using jumper cables to connect said sensor to a Raspberry Pi Zero 2 WH. At which point I will write a program to have this apparatus collect temperature data every few seconds, adding those measurements to a growing CSV file. Which will later be visualized using the D3 JavaScript library.

    I will update this project again in the near future when there is more to share.

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates