{"id":6582,"date":"2012-12-15T14:57:02","date_gmt":"2012-12-15T19:57:02","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=6582"},"modified":"2014-05-07T22:37:30","modified_gmt":"2014-05-08T02:37:30","slug":"trh-meter-a-diy-indoor-thermometer-plus-hygrometer-with-adaptive-brightness-control-implemented-to-7-segment-led-displays","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/trh-meter-a-diy-indoor-thermometer-plus-hygrometer-with-adaptive-brightness-control-implemented-to-7-segment-led-displays\/","title":{"rendered":"TrH Meter: A DIY indoor thermometer plus hygrometer with adaptive brightness control implemented to 7-segment LED displays"},"content":{"rendered":"<p>This project is about building a microcontroller-based digital room thermometer plus hygrometer that displays temperature and relative humidity on 4 large (1 inch) seven segment LED displays which adjust their brightness level according to the surrounding illumination. It consists of a closed loop system that continuously assesses ambient light condition using an inexpensive light-dependent resistor (LDR) and uses that information to adjust the brightness of the display. An inexpensive DHT11 sensor is used to measure temperature and relative humidity. The microcontroller used in this project is PIC16F688, and it runs at 4 MHz clock generated from its internal source. A separate display driver chip (MAX7219) is used to control and refresh the display data on the seven segment LEDs.<\/p>\n<div id=\"attachment_6583\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6583\" class=\"size-full wp-image-6583\" title=\"TRHMeterPrototypeOP2\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2.jpg\" width=\"565\" height=\"223\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2-550x217.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-6583\" class=\"wp-caption-text\">TrH Meter:\u00a0A DIY indoor thermometer plus hygrometer<\/p><\/div>\n<p><!--more--><strong>Why do we need adaptive brightness control?<\/strong><\/p>\n<p>Auto-adjusting the brightness of the seven segment LED displays not only saves power but also\u00a0enhances the readability in all ambient lighting conditions. Many smartphones, HDTVs, PDAs, tablets, and computer screens now come with this feature. It basically dims the display in a dark environment and is still readable and eye-soothing. Similarly, when the ambient light level goes up, it brightens the display to enhance the\u00a0readability. This project displays indoor temperature and relative humidity on large 1 inch seven segment LEDs that automatically adjust the brightness to be in balance with the light condition in the room. So, if you put this meter in your bedroom,\u00a0you won\u2019t have to worry about turning it off during nighttime. It will automatically dim low enough to not to disturb your sleep, while maintaining the readability.<\/p>\n<p><strong>Circuit diagram\u00a0<\/strong><\/p>\n<p>To make it easy to explain, I have divided the complete circuit diagram into 3 parts: <strong>Power supply unit<\/strong>, <strong>Microcontroller and sensor unit<\/strong>, and <strong>Display driver unit<\/strong>.<\/p>\n<p>The power supply unit consists of a LM7805 regulator IC to derive regulated +5V power supply from a 9-15V DC wall adapter. The complete power supply unit circuit diagram is shown below. LED1 is a power-on indicator LED.<\/p>\n<div id=\"attachment_6668\" style=\"width: 559px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrhMeterPS_CircuitPT.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6668\" class=\"size-full wp-image-6668\" title=\"TrhMeterPS_CircuitPT\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrhMeterPS_CircuitPT.jpg\" width=\"549\" height=\"327\" \/><\/a><p id=\"caption-attachment-6668\" class=\"wp-caption-text\">Regulated +5V power supply unit<\/p><\/div>\n<p>The following circuit diagram shows connections of the DHT11 sensor and the photoresistor (also called light dependent resistor or LDR) to the PIC16F688 microcontroller. DHT11 is a low cost digital sensor for measuring temperature from 0-50 \u00b0C with an accuracy of \u00b12\u00b0C and relative humidity ranging from 20-95% with an accuracy of \u00a0\u00b15%.\u00a0The sensor provides fully calibrated digital outputs and has got its own proprietary 1-wire protocol for communication. I have described more about this sensor and its communication protocol in\u00a0<a title=\"Permanent Link to Measurement of temperature and relative humidity using DHT11 sensor and PIC microcontroller\" href=\"http:\/\/embedded-lab.com\/blog\/?p=4333\" rel=\"bookmark\">Measurement of temperature and relative humidity using DHT11 sensor and PIC microcontroller.<\/a>\u00a0The PIC16F688 uses the RC4 I\/O pin to read the DHT11 output data. Note that R7 serves as the pull-up resistor required for the data pin of the DHT11 sensor. The S2 switch in the circuit diagram is to select between degree Fahrenheit (\u00b0F) and degree Celsius (\u00b0C) unit for temperature display. When the switch is open, the RC3 pin is pulled low by default, and the temperature is displayed in \u00b0F scale. In order to chose \u00b0C scale, the RC3 pin should be pulled high, which happens when S2 is closed.<\/p>\n<p>Next, the photoresistor (R5) and R4 construct a voltage divider network as shown in the circuit. The analog voltage across R4 increases proportionally with the amount of light falling on the photoresistor.\u00a0The resistance of a typical photoresistor is less than 1 K? under bright lighting condition. Its resistance could go up to several hundred\u00a0K? under extremely dark condition. Therefore, for the given setup, the voltage across the R4 resistor can vary from less than 0.1V (under dark condition) to over 4.0V (under very bright illumination). The PIC16F688 microcontroller reads this analog voltage through its AN2 (RA2) ADC channel to determine the surrounding illumination level.<\/p>\n<div id=\"attachment_6619\" style=\"width: 567px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_uCircuit.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6619\" class=\"size-full wp-image-6619\" title=\"TrHMeter_uCircuit\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_uCircuit.jpg\" width=\"557\" height=\"570\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_uCircuit.jpg 557w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_uCircuit-550x562.jpg 550w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/a><p id=\"caption-attachment-6619\" class=\"wp-caption-text\">Microcontroller circuit<\/p><\/div>\n<p>The display unit consists of a MAX7219 chip that can directly drive up to eight 7-segment LED displays (common cathode type) through a 3-wire serial interface. Included on the chip are a BCD decoder, multiplex scan circuitry, segment and digit\u00a0drivers, and an 8\u00d78 static RAM to store the digit values. The segment current for all LEDs is set through only one external resistor connected between the ISET pin and power supply. The device also provides 16 level brightness control through software using its internal pulse-width modulator. To learn more about the MAX7219 device, read my previous article\u00a0<a href=\"http:\/\/embedded-lab.com\/blog\/?p=4935\" target=\"_blank\">Serial 4-digit seven-segment LED display<\/a>. In this project, the RC0, RC1, and RC2 I\/O pins of PIC16F688 are used to drive the DIN, LOAD, and CLK signal lines of the MAX7219.<\/p>\n<div id=\"attachment_6618\" style=\"width: 544px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_displayCircuit.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6618\" class=\"size-full wp-image-6618\" title=\"TrHMeter_displayCircuit\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_displayCircuit.jpg\" width=\"534\" height=\"788\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_displayCircuit.jpg 534w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TrHMeter_displayCircuit-440x650.jpg 440w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/a><p id=\"caption-attachment-6618\" class=\"wp-caption-text\">Display circuit<\/p><\/div>\n<p>Here&#8217;s the complete project circuit setup on a general purpose perforated prototyping board.<\/p>\n<div id=\"attachment_6585\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6585\" class=\"size-full wp-image-6585\" title=\"TRHMeterPrototypeSetup\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup.jpg\" width=\"565\" height=\"377\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup-550x366.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-6585\" class=\"wp-caption-text\">Circuit made on a general purpose perforated prototyping board<\/p><\/div>\n<div id=\"attachment_6586\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6586\" class=\"size-full wp-image-6586\" title=\"TRHMeterPrototypeSetup2\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup2.jpg\" width=\"565\" height=\"256\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup2.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeSetup2-550x249.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-6586\" class=\"wp-caption-text\">Complete setup<\/p><\/div>\n<p><strong>Software<\/strong><\/p>\n<p>The PIC firmware is developed in C and compiled with mikroC Pro for PIC compiler version 5.30. The subroutines for initializing the MAX7219 and sending display data bytes are written in a simple and understandable way so that they can be easily implemented with any other programming language, if required. The MAX7219 allows display brightness to be controlled through software by an internal pulse-width modulator (PWM). The PWM output is controlled by the lower nibble (D3-D0) of the intensity register (address 0x0A) and allows 16 brightness levels. The zero nibble value sets the display intensity to minimum, whereas all nibble bits set to 1 (0x0F) selects the maximum intensity level for the display. For auto-brightness control, the 10-bit ADC count (0-1023) corresponding to the photoresistor output voltage is scaled down to 0-19 by dividing the count by 50 (20 brightness levels between 0-1023). Then a look-up table is used to map the scaled brightness levels to appropriate nibble values for the intensity control register of the MAX7219. The temperature is displayed in Fahrenheit (\u00b0F) scale if RC3 is pulled low, and in\u00a0Celsius\u00a0(\u00b0C) scale if RC3 is high. The relative humidity measurement is shown in percentage (P). The microcontroller alternately switches the display data between temperature and relative humidity.<\/p>\n\n<div class=\"wp_syntax\"><table><tr><td class=\"code\"><pre class=\"c\" style=\"font-family:monospace;\"><span style=\"color: #666666; font-style: italic;\">\/\/ Define Soft-SPI connections for LED display<\/span>\n<span style=\"color: #339933;\">#define MOSI_Pin     RC0_bit<\/span>\n<span style=\"color: #339933;\">#define CS_Pin       RC1_bit<\/span>\n<span style=\"color: #339933;\">#define CLK_Pin      RC2_bit<\/span>\n&nbsp;\n<span style=\"color: #666666; font-style: italic;\">\/\/ Define Data pin for DHT11<\/span>\n<span style=\"color: #339933;\">#define Data         RC4_bit<\/span>\n<span style=\"color: #339933;\">#define DataDir      TRISC4_bit<\/span>\n<span style=\"color: #339933;\">#define FC_Select    RC3_bit    \/\/ Fahrenheit or Celcious select<\/span>\n&nbsp;\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">short<\/span> TOUT <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> CheckSum<span style=\"color: #339933;\">,<\/span> i<span style=\"color: #339933;\">,<\/span> check<span style=\"color: #339933;\">,<\/span> u<span style=\"color: #339933;\">,<\/span> NumSamples<span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">short<\/span> T_Byte1<span style=\"color: #339933;\">,<\/span> T_Byte2<span style=\"color: #339933;\">,<\/span> RH_Byte1<span style=\"color: #339933;\">,<\/span> RH_Byte2<span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">long<\/span> <span style=\"color: #993333;\">int<\/span> brightness<span style=\"color: #339933;\">=<\/span><span style=\"color: #208080;\">0x0b<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">int<\/span> counter <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> TempF<span style=\"color: #339933;\">,<\/span> TempC<span style=\"color: #339933;\">,<\/span> RH<span style=\"color: #339933;\">,<\/span> ADC_OP<span style=\"color: #339933;\">,<\/span> TempSum<span style=\"color: #339933;\">,<\/span> RHSum<span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #666666; font-style: italic;\">\/\/Brightness look-up table<\/span>\n<span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">short<\/span> Brightness_Table<span style=\"color: #009900;\">&#91;<\/span><span style=\"color: #0000dd;\">21<\/span><span style=\"color: #009900;\">&#93;<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #009900;\">&#123;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">2<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">3<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">3<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">4<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">5<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">6<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">7<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">8<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">9<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">10<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">11<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">12<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">12<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">13<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">14<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">15<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">15<\/span><span style=\"color: #009900;\">&#125;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">short<\/span> num<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n <span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">short<\/span> t<span style=\"color: #339933;\">,<\/span> Mask<span style=\"color: #339933;\">,<\/span> Flag<span style=\"color: #339933;\">;<\/span>\n CLK_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n Mask <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">128<\/span><span style=\"color: #339933;\">;<\/span>\n <span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #009900;\">&#40;<\/span>t<span style=\"color: #339933;\">=<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span> t<span style=\"color: #339933;\">&amp;<\/span>gt<span style=\"color: #339933;\">;<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>\n <span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> MAX7219_INIT<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n  <span style=\"color: #666666; font-style: italic;\">\/\/ Disable Shutdown mode<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x0C<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select Shutdown register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x01<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Set D0 bit to return to normal operation<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n&nbsp;\n  <span style=\"color: #666666; font-style: italic;\">\/\/ Set BCD decode mode for digits DIG1-DIG3, and DIG5-DIG7<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x09<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select Decode Mode register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0b00001100<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Disable BCD mode for digits DIG0, DIG1<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n  <span style=\"color: #666666; font-style: italic;\">\/\/ Set display brighness<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x0A<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select Intensity register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span>brightness<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Set brightness<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n&nbsp;\n   <span style=\"color: #666666; font-style: italic;\">\/\/ Set display refresh<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x0B<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select Scan-Limit register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x03<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select digits DIG0-DIG3<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n&nbsp;\n <span style=\"color: #666666; font-style: italic;\">\/\/ Enable Display-Test<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x0F<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select Display-Test register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x01<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Enable Display-Test<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n  Delay_ms<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">1000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n <span style=\"color: #666666; font-style: italic;\">\/\/ Disable Display-Test<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x0F<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Select Display-Test register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x00<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Disable Display-Test<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>              <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n&nbsp;\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n <span style=\"color: #993333;\">void<\/span> Display_Value<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">int<\/span> j<span style=\"color: #339933;\">,<\/span> <span style=\"color: #993333;\">unsigned<\/span> <span style=\"color: #993333;\">short<\/span> k<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>                    <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">4<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>             <span style=\"color: #666666; font-style: italic;\">\/\/ Send thousands digit<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#40;<\/span>j<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">100<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>                    <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n&nbsp;\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>                    <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">3<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>             <span style=\"color: #666666; font-style: italic;\">\/\/ Send hundreds digit<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#40;<\/span>j<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">%<\/span><span style=\"color:#800080;\">10<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>                    <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n&nbsp;\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>                    <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">2<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>             <span style=\"color: #666666; font-style: italic;\">\/\/ Send tens digit<\/span>\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>k <span style=\"color: #0000dd;\">40<\/span><span style=\"color: #009900;\">&#41;<\/span> num <span style=\"color: #339933;\">|=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">&amp;<\/span>lt<span style=\"color: #339933;\">;<\/span>40us<span style=\"color: #339933;\">,<\/span> Data is <span style=\"color: #0000dd;\">1<\/span>\n  <span style=\"color: #009900;\">&#125;<\/span>\n  <span style=\"color: #b1b100;\">return<\/span> num<span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> interrupt<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>PIR1.<span style=\"color: #202020;\">TMR1IF<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n   TOUT <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>\n   T1CON.<span style=\"color: #202020;\">TMR1ON<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ stop timer<\/span>\n   PIR1.<span style=\"color: #202020;\">TMR1IF<\/span>  <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span> <span style=\"color: #666666; font-style: italic;\">\/\/ Clear TMR0 interrupt flag<\/span>\n  <span style=\"color: #009900;\">&#125;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> Display_Brightness<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n  ADC_OP <span style=\"color: #339933;\">=<\/span> ADC_Read<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">2<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  Brightness <span style=\"color: #339933;\">=<\/span> ADC_OP<span style=\"color: #339933;\">\/<\/span><span style=\"color: #0000dd;\">50<\/span><span style=\"color: #339933;\">;<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>                <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled LOW<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #208080;\">0x0A<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>      <span style=\"color: #666666; font-style: italic;\">\/\/ Select Intensity register<\/span>\n  SPI_Write_Byte<span style=\"color: #009900;\">&#40;<\/span>Brightness_Table<span style=\"color: #009900;\">&#91;<\/span>brightness<span style=\"color: #009900;\">&#93;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/ Update brightness<\/span>\n  CS_Pin <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>                <span style=\"color: #666666; font-style: italic;\">\/\/ CS pin is pulled HIGH<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> Wait_Nsec<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span>\n Delay_ms<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">3000<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n<span style=\"color: #009900;\">&#125;<\/span>\n&nbsp;\n<span style=\"color: #993333;\">void<\/span> main<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span> <span style=\"color: #009900;\">&#123;<\/span>\n  ANSEL <span style=\"color: #339933;\">=<\/span> <span style=\"color: #208080;\">0b00000100<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ RA2\/AN2 is analog input<\/span>\n  CMCON0 <span style=\"color: #339933;\">=<\/span> <span style=\"color: #208080;\">0x07<\/span> <span style=\"color: #339933;\">;<\/span>      <span style=\"color: #666666; font-style: italic;\">\/\/ Disbale comparators<\/span>\n  TRISC <span style=\"color: #339933;\">=<\/span> <span style=\"color: #208080;\">0b00001000<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ PORTC All Outputs except RC3<\/span>\n  TRISA <span style=\"color: #339933;\">=<\/span> <span style=\"color: #208080;\">0b00001110<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ PORTA All Outputs, Except RA3 and RA2<\/span>\n&nbsp;\n  INTCON.<span style=\"color: #202020;\">GIE<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>    <span style=\"color: #666666; font-style: italic;\">\/\/Enable global interrupt<\/span>\n  INTCON.<span style=\"color: #202020;\">PEIE<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>   <span style=\"color: #666666; font-style: italic;\">\/\/Enable peripheral interrupt<\/span>\n  <span style=\"color: #666666; font-style: italic;\">\/\/ Configure Timer2 module<\/span>\n  PIE1.<span style=\"color: #202020;\">TMR1IE<\/span> <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #339933;\">;<\/span>  <span style=\"color: #666666; font-style: italic;\">\/\/ Enable Timer2 interrupt<\/span>\n  T1CON <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>        <span style=\"color: #666666; font-style: italic;\">\/\/ Prescaler 1:1, and Timer2 is off initially<\/span>\n  PIR1.<span style=\"color: #202020;\">TMR1IF<\/span> <span style=\"color: #339933;\">=<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>   <span style=\"color: #666666; font-style: italic;\">\/\/ Clear TMR INT Flag bit<\/span>\n  TMR1H <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n  TMR1L <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n  MAX7219_INIT<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>           <span style=\"color: #666666; font-style: italic;\">\/\/ initialize  max7219<\/span>\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #339933;\">!<\/span>FC_Select<span style=\"color: #009900;\">&#41;<\/span> Display_Value<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n  <span style=\"color: #b1b100;\">if<\/span><span style=\"color: #009900;\">&#40;<\/span>FC_Select<span style=\"color: #009900;\">&#41;<\/span> Display_Value<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">,<\/span> <span style=\"color: #0000dd;\">1<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #339933;\">;<\/span>\n&nbsp;\n  <span style=\"color: #b1b100;\">do<\/span><span style=\"color: #009900;\">&#123;<\/span>\n    NumSamples <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n    TempSum <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n    RHSum <span style=\"color: #339933;\">=<\/span> <span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span>\n    <span style=\"color: #b1b100;\">for<\/span> <span style=\"color: #009900;\">&#40;<\/span>u<span style=\"color: #339933;\">=<\/span><span style=\"color: #0000dd;\">0<\/span><span style=\"color: #339933;\">;<\/span> u<\/pre><\/td><\/tr><\/table><\/div>\n\n<p><a href=\"http:\/\/embedded-lab.com\/uploads\/HexFiles\/PIC16F688\/TrH_Meter_V1.0.zip\"><strong>Download source and HEX files<\/strong><\/a><\/p>\n<p>The PIC16F688 microcontroller runs at 4.0 MHz internal clock. The MCLR and Power-Up Timer (PWRT) are both enabled.<\/p>\n<p><strong>Output<\/strong><\/p>\n<p>The project was tested under different indoor lighting conditions, varying from very dark to very bright. The display was found equally well readable and eye-soothing in all the different conditions. I have put it in my bedroom and at night the display automatically dims low enough to not disturb the sleep, while I can still read the temperature and humidity readings in the dark.<\/p>\n<div id=\"attachment_6584\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6584\" class=\"size-full wp-image-6584\" title=\"TRHMeterPrototypeOP1\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP1.jpg\" width=\"565\" height=\"227\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP1.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP1-550x220.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-6584\" class=\"wp-caption-text\">Relative humidity in percentage (P)<\/p><\/div>\n<div id=\"attachment_6583-2\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6583-2\" class=\"size-full wp-image-6583\" title=\"TRHMeterPrototypeOP2\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2.jpg\" width=\"565\" height=\"223\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/TRHMeterPrototypeOP2-550x217.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-6583-2\" class=\"wp-caption-text\">Temperature displayed in Fahrenheit (F)<\/p><\/div>\n<p><strong>Update<\/strong><\/p>\n<p>I am now selling a complete kit of this project (with pre-programmed PIC16F688 microcontrollers) on Tindie. If you are interested, you can order it from here:<br \/>\n<strong>Tindie order link:<\/strong> <a href=\"https:\/\/www.tindie.com\/products\/rajbex\/pre-order-trh-meter-kit-3\/\">https:\/\/www.tindie.com\/products\/rajbex\/pre-order-trh-meter-kit-3\/<\/a><\/p>\n<p>The PCB version uses the same circuit diagram as described above except it uses AMS1117-5.0 regulator IC instead of LM7805. Here&#8217;s a picture of an assembled project board.\u00a0The soldering instructions for this kit are available\u00a0<strong><a href=\"http:\/\/embedded-lab.com\/blog\/?p=6958\" target=\"_blank\">here<\/a><\/strong>.<\/p>\n<div id=\"attachment_6710\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/AssembledTrHboard3.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6710\" class=\"size-full wp-image-6710\" title=\"AssembledTrHboard3\" alt=\"\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/AssembledTrHboard3.jpg\" width=\"565\" height=\"448\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/AssembledTrHboard3.jpg 565w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2012\/12\/AssembledTrHboard3-550x436.jpg 550w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-6710\" class=\"wp-caption-text\">Assembled project board<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This project is about building a microcontroller-based digital room thermometer plus hygrometer that displays temperature and relative humidity on 4 large (1 inch) seven segment LED displays which adjust their brightness level according to the surrounding illumination. It consists of a closed loop system that continuously assesses ambient light condition using an inexpensive light-dependent resistor (LDR) and uses that information to adjust the brightness of the display. An inexpensive DHT11 sensor is used to measure temperature and relative humidity. The microcontroller used in this project is PIC16F688, and it runs at 4 MHz clock generated from its internal source. A<\/p>\n","protected":false},"author":1,"featured_media":6583,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[245,4],"tags":[392,523,20,522],"class_list":["post-6582","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-embedded-lab-projects","category-pic-projects","tag-dht11","tag-pic-thermometer","tag-pic16f688","tag-trh-meter"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/6582","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=6582"}],"version-history":[{"count":44,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/6582\/revisions"}],"predecessor-version":[{"id":8669,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/6582\/revisions\/8669"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/6583"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=6582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=6582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=6582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}