Temperature/Humidity Logger

Recently, a need arose to take humidity readings of a crawlspace, over an extended period of time. An Arduino clone called the Bare Bones Board (BBB) is used in this project, mainly for its ability to be mounted to a breadboard.

Using a commercial-off-the-shelf sensor and microSD card, the logger takes temperature and humidity readings at a predefined time interval and writes the readings to a text file on the card. An Octave/MATLAB script is shown that plots the results.

All source code can be found on GitHub.




I had the BBB already assembled, and knew it’d make for a tidy finished product. If you don’t have the time/care to solder one together, any Arduino will do. This will also prevent the purchase of an FTDI cable if you don’t already have one.

The DHT22 kit currently comes with a single 10k resistor; feel free to skip buying the whole pack if you get the kit.

While an Octave/MATLAB script is included to display the data, you can use Excel or any other tool you’re comfortable with to visualize the results.

The current time delay value in the code is set to one second, this can be changed for your specific application.

Be mindful of the power shunt on the BBB. When attached to the computer with the FTDI cable it must be set to ‘USB’, when attached to the DC power supply, it must be set to ‘EXT’.

Adafruit’s DHT library is used, and their site has extensive DHTxx documentation.


  1. Install all software for the Arduino IDE and FTDI cable. Make sure you can program ‘Blink’.
  2. Format the microSD card.
  3. Make the circuit as shown below. fritzing_screenshot
  4. Carefully insert the totally assembled BBB to the breadboard such that it looks like below. It helps to align the GND/+5V pins to the respective cables.IMG_2253 IMG_2254
  5. Attach the BBB to the computer using the FTDI cable. Make sure the BBB’s power shunt is set to ‘USB’.
  6. Using the Arduino IDE, program the source code to the board.
  7. Unplug the FTDI cable, set the power shunt to ‘EXT’, and insert the microSD card. After placing the logger wherever you want to take readings, plug in the DC power supply. The green LED on the BBB should turn on, and the red LED on the microSD board will blink during writes.
  8. When you’ve collected the required data, insert the microSD card into a reader on your computer, and open ‘LOG_FILE.TXT’. If all went as planned, there should be three columns: milliseconds since boot, temperature (F) and humidity (%).
  9. Copy and past the log file such that it is in the same directory as the Octave/MATLAB script, plot_results.m, run the script.
  10. If all went well, you should get a plot like the following: Plot

Leave a Reply