{"id":8414,"date":"2014-04-05T13:17:03","date_gmt":"2014-04-05T17:17:03","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=8414"},"modified":"2014-04-05T16:35:10","modified_gmt":"2014-04-05T20:35:10","slug":"step-by-step-guide-for-making-a-very-simple-temperature-and-humidity-meter-with-7-segment-led-displays","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/step-by-step-guide-for-making-a-very-simple-temperature-and-humidity-meter-with-7-segment-led-displays\/","title":{"rendered":"Step-by-step guide for making a very simple temperature and humidity meter with 7-segment LED displays"},"content":{"rendered":"<p>In this blog post, I am providing you step by step instructions to build a very simple temperature and relative humidity meter for indoor use. All you need to build this project are an Arduino Uno or compatible board, a DHT11 sensor, and a MAX7219 based 8-digit serial 7-segment LED display. The temperature is displayed in degree Celsius and relative humidity in percentage.<\/p>\n<div id=\"attachment_8418\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH3.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8418\" class=\"size-full wp-image-8418\" alt=\"Temperature and Humidity meter\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH3.jpg\" width=\"580\" height=\"416\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH3.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH3-550x394.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8418\" class=\"wp-caption-text\">Temperature and Humidity meter<\/p><\/div>\n<p><!--more--><\/p>\n<h4 dir=\"ltr\"><span style=\"color: #000080;\"><strong>Things required to build this project<\/strong><\/span><\/h4>\n<p><span style=\"font-size: 0.95em; line-height: 1.6em;\"><em><strong>Arduino Uno board<\/strong><\/em><\/span><\/p>\n<p><span style=\"font-size: 0.95em; line-height: 1.6em;\">I am using <a href=\"http:\/\/www.elecrow.com\/arduino-compatiable-c-109\/micro-controller-c-109_117\/crowduino-unosd-v14-p-840.html\" target=\"_blank\"><strong>Crowduino Uno SD<\/strong><\/a> board, which is manufactured by Elecrow and is fully compatible with Arduino Uno board. Crowduino has the following additional features that the standard Arduino Uno board doesn\u2019t have.<\/span><\/p>\n<p dir=\"ltr\">1 Reset button is placed on the left side edge, and thus more convenient to access.<\/p>\n<p dir=\"ltr\">2 Improved power supply circuit with selectable 3.3V and 5.0V for operation.<\/p>\n<p dir=\"ltr\">3 Uses the mini USB connector to avoid the potential risk of connecting to the shield plugged in.<\/p>\n<p dir=\"ltr\">4 Micro SD card slot on board, which makes this board useful for data logging applications.<\/p>\n<div id=\"attachment_8415\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUno2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8415\" class=\"size-full wp-image-8415\" alt=\"Crowduino Uno SD board\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUno2.jpg\" width=\"580\" height=\"400\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUno2.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUno2-550x379.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8415\" class=\"wp-caption-text\">Crowduino Uno SD board<\/p><\/div>\n<p dir=\"ltr\"><em><strong>DHT11 sensor<\/strong><\/em><\/p>\n<p><span style=\"font-size: 0.95em; line-height: 1.6em;\">DHT11 is an ultra low cost digital sensor for measuring temperature and relative humidity. It operates from 3.0-5.0V and provides calibrated digital outputs for temperature (in degree Celsius) and humidity through a single wire serial interface. It can measure humidity ranging from 20-80% with 5% accuracy, and temperature ranging from 0-50 degree Celsius with 2% accuracy. When it is active, the maximum current consumption is 2.5mA. The sensor has 4 pins with 0.1\u201d spacing as shown below.<\/span><\/p>\n<div id=\"attachment_5600\" style=\"width: 526px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/07\/DHT11_Pins.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5600\" class=\"size-full wp-image-5600\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/07\/DHT11_Pins.png\" width=\"516\" height=\"378\" \/><\/a><p id=\"caption-attachment-5600\" class=\"wp-caption-text\">DHT11 sensor and its pins<\/p><\/div>\n<p dir=\"ltr\"><em><strong>MAX7219-based seven segment display<\/strong><\/em><\/p>\n<p>The next thing required to do this project is two rows of 4-digit seven segment LED displays for displaying temperature and humidity simultaneously. This project uses <a href=\"http:\/\/embedded-lab.com\/blog\/?p=7364\" target=\"_blank\"><strong>SPI7SEGDISP8.56-2R display module<\/strong><\/a>, which is MAX7219 driven and allows you to control all 8 digits through a 3-wire serial interface. The display brightness can also be adjusted through software commands. In addition, library routines are available for interfacing the SPI7SEGDISP8.56-2R module to Arduino. This project, in particular, uses the <strong><a href=\"http:\/\/www.wayoda.org\/arduino\/ledcontrol\/\" target=\"_blank\">LedControl<\/a>\u00a0<\/strong>library.<\/p>\n<div id=\"attachment_8426\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/SPI7SEGDISP8.56-2R-top.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8426\" class=\"size-medium wp-image-8426\" alt=\"SPI7SEGDISP8.56-2R display module\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/SPI7SEGDISP8.56-2R-top-550x390.jpg\" width=\"550\" height=\"390\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/SPI7SEGDISP8.56-2R-top-550x390.jpg 550w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/SPI7SEGDISP8.56-2R-top.jpg 800w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/a><p id=\"caption-attachment-8426\" class=\"wp-caption-text\">SPI7SEGDISP8.56-2R display module<\/p><\/div>\n<p><em><strong>Jumper cables<\/strong><\/em><\/p>\n<p>We will also need a few male-to-female type jumper wires to connect the parts together.<\/p>\n<p><em><strong>Power supply<\/strong><\/em><\/p>\n<p>You can use an USB cable connected to PC or a 9V DC wall adapter to power this project.<\/p>\n<h4><span style=\"color: #000080;\"><strong>Project setup<\/strong><\/span><\/h4>\n<p>In this project, we insert the DHT11 sensor directly into the right female headers of the Arduino Uno board such that the pin 4 (GND) of DHT11 goes in to the GND pin (second pin from top right) of the Arduino header. With this arrangement, the pins 1 (VCC), 2 (Data), and 3 (NC) of DHT11 will be connected to Arduino digital I\/O pins 11, 12, and 13, respectively. Since DHT11 requires only 2.5mA current at most during operation, it will be powered directly through Arduino pin 11 by setting it to 1. The Arduino pin 12 is used to read the sensor output.<\/p>\n<div id=\"attachment_8417\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8417\" class=\"size-full wp-image-8417\" alt=\"Inserting DHT11 directly into Arduino headers\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH2.jpg\" width=\"580\" height=\"361\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH2.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH2-550x342.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8417\" class=\"wp-caption-text\">Inserting DHT11 directly into Arduino headers<\/p><\/div>\n<p>Next we connect the SPI7SEGDISP8.56-2R display module to the Arduino board. The display is powered by 5V and Gnd supply pins from left header pins on the Arduino board. The DIN, LOAD, and CLK pins of the display are wired to the Arduino digital pins 5, 6, and 7, respectively. The complete setup looks like the following picture.<\/p>\n<div id=\"attachment_8416\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8416\" class=\"size-full wp-image-8416\" alt=\"Complete setup of the project\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH1.jpg\" width=\"580\" height=\"417\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH1.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH1-550x395.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8416\" class=\"wp-caption-text\">Complete setup of the project<\/p><\/div>\n<h4><span style=\"color: #000080;\"><strong>Arduino Software<\/strong><\/span><\/h4>\n<p>The firmware for this project uses the <a href=\"http:\/\/www.wayoda.org\/arduino\/ledcontrol\/\" target=\"_blank\"><strong>LedControl library<\/strong><\/a> for MAX7219 interface and <a href=\"https:\/\/github.com\/adafruit\/DHT-sensor-library\" target=\"_blank\"><strong>Adafruit&#8217;s DHT sensor library<\/strong><\/a> for reading the DHT11 output. I have slightly modified the LedControl library to display the degree symbol and the capital letter &#8216;C&#8217;. You can print the degree symbol using the following setChar command using the modified library.<\/p>\n<p style=\"text-align: center;\"><em><strong>setChar(0, 1, &#8216;\/&#8217;, false)<\/strong><\/em><\/p>\n<p><span style=\"font-size: 0.95em; line-height: 1.6em;\">The sensor measurements are taken every second and updated on the display.<\/span><\/p>\n<p><em><strong>Download the modified LedControl library from <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/LedControl.zip\" target=\"_blank\">here<\/a>.<\/strong><\/em><\/p>\n<p><em><strong>Download the DHT Sensor library from <a href=\"https:\/\/github.com\/adafruit\/DHT-sensor-library\" target=\"_blank\">here<\/a>.<\/strong><\/em><\/p>\n<p><em><strong>Download the Arduino sketch for this project from <a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/DHT11_TR_meter_Crowduino.zip\">here<\/a>.<\/strong><\/em><\/p>\n<div id=\"attachment_8420\" style=\"width: 590px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH5.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-8420\" class=\"size-full wp-image-8420\" alt=\"Displaying temperature and humidity  on seven segment LED displays\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH5.jpg\" width=\"580\" height=\"432\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH5.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2014\/04\/CrowduinoUnoTrH5-550x409.jpg 550w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><p id=\"caption-attachment-8420\" class=\"wp-caption-text\">Displaying temperature and humidity on seven segment LED displays<\/p><\/div>\n<h4><span style=\"color: #000080;\"><strong>Where to buy components<\/strong><\/span><\/h4>\n<p>If you are interested to build this temperature and humidity meter, you can buy all the components from Elecrow, China. They ship items worldwide at a reasonable shipping cost. Here are the links for the products.<\/p>\n<p><a href=\"http:\/\/www.elecrow.com\/arduino-compatiable-c-109\/micro-controller-c-109_117\/crowduino-unosd-v14-p-840.html\" target=\"_blank\"><strong>Crowduino Uno SD<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/www.elecrow.com\/sensors-c-111\/environment-c-111_112\/dht11-temperature-humidity-sensor-p-313.html\" target=\"_blank\"><strong>DHT11 Sensor<\/strong><\/a><\/p>\n<p><a href=\"http:\/\/www.elecrow.com\/cooperated-designers-c-127\/embedded-lab-c-127_128\/max7219-spi-7segment-displays-2-rows-redblueyellow-p-877.html\" target=\"_blank\"><strong>SPI7SEGDISP8.56-2R display<\/strong><\/a> (it comes in three colors)<\/p>\n<p>&nbsp;<\/p>\n<p>USA buyers can also buy the SPI7SEGDISP8.56-2R displays directly from our <a href=\"https:\/\/www.tindie.com\/stores\/rajbex\/\" target=\"_blank\"><strong>Tindie Store<\/strong><\/a>. Use the following links:<br \/>\n<a href=\"https:\/\/tindie.com\/products\/rajbex\/double-row-4-digit-seven-segment-red-led-display-module-with-spi-interface\/\" target=\"_blank\"><strong>SPI7SEGDISP8.56 buying link &#8211; Red color<\/strong><\/a><\/p>\n<p><strong><a href=\"https:\/\/tindie.com\/products\/rajbex\/double-row-4-digit-seven-segment-yellow-led-display-module-with-spi-interface\/\" target=\"_blank\">SPI7SEGDISP8.56 buying link &#8211; Yellow color<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/tindie.com\/products\/rajbex\/double-row-4-digit-seven-segment-blue-led-display-module-with-spi-interface\/\" target=\"_blank\"><strong>SPI7SEGDISP8.56 buying link &#8211; Blue color<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, I am providing you step by step instructions to build a very simple temperature and relative humidity meter for indoor use. All you need to build this project are an Arduino Uno or compatible board, a DHT11 sensor, and a MAX7219 based 8-digit serial 7-segment LED display. The temperature is displayed in degree Celsius and relative humidity in percentage.<\/p>\n","protected":false},"author":1,"featured_media":8415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[150,245],"tags":[148,392,439,750],"class_list":["post-8414","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-2","category-embedded-lab-projects","tag-arduino","tag-dht11","tag-max7219","tag-sensors"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=8414"}],"version-history":[{"count":14,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8414\/revisions"}],"predecessor-version":[{"id":8440,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/8414\/revisions\/8440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/8415"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=8414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=8414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=8414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}