{"id":1863,"date":"2024-06-28T06:35:07","date_gmt":"2024-06-28T06:35:07","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=1863"},"modified":"2024-08-11T17:13:53","modified_gmt":"2024-08-11T17:13:53","slug":"light-emitting-register-temperature-sensor-lm35","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=1863","title":{"rendered":"Light Emitting Register &amp; Temperature Sensor LM35"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-5c17042f6f31caab2df3d74238210949 wp-block-paragraph\" style=\"color:#5c5c5c\">In this program we use an LDR to read the light condition. The connection diagram of LDR as follow-<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<figure class=\"wp-block-image size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"349\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR-LM35-1024x349.jpg\" alt=\"\" class=\"wp-image-1866\" style=\"width:526px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR-LM35-1024x349.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR-LM35-300x102.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR-LM35-768x262.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR-LM35.jpg 1053w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" width=\"413\" height=\"241\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR.jpg\" alt=\"\" class=\"wp-image-1867\" style=\"width:288px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR.jpg 413w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/LDR-300x175.jpg 300w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-38fde0ccf409c4d529db3881f29d5f1e wp-block-paragraph\" style=\"color:#5c5c5c\">LDR is nothing but a register that vary with light condition. At low light resistance is high and at high light the resistance is low. Temperature sensor LM35 is a digital temperature whose V<sub>out<\/sub> value change according to temperature. The sensor has reading +10mV\/\u00b0C. Since our ADC has a resolution 5\/1024=4.88mV so the desire temperature is<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"79\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/function-2-3-1024x79.jpg\" alt=\"\" class=\"wp-image-1871\" style=\"width:467px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/function-2-3-1024x79.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/function-2-3-300x23.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/function-2-3-768x59.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/function-2-3.jpg 1051w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-63dda2bb71d255bd406e8b13fbd810fe wp-block-paragraph\" style=\"color:#5c5c5c\">The main program-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\n  #include&lt;avr\/io.h&gt;\n  #include&lt;stdio.h&gt;\n  #include&lt;util\/delay.h&gt;\n  #include&quot;adc.h&quot;\n  #include&quot;lcd.h&quot;\n  uint16_t value,tempa;\n  float temperature;\n  char str&#x5B;20];\nint main(void)\n  {\n   LCD_INIT();\n   adc_init();\n   LCD_Clear();\n   DDRB|=(1&lt;&lt;DDB1);                     \/\/LOAD PORT\n   _delay_ms(10);\n   LCD_Clear();\n   while(1)\n   {\n     value=read_adc(0);\n     tempa=read_adc(1);\n     temperature=(tempa*4.88)\/10;\n     sprintf(str,&quot;%d   %.2f&quot;,value,temperature);\n     if(value&lt;=400)\n\t    {\n\t      PORTB |=(1&lt;&lt;PINB1);\t\t\t \/\/in dark condition glow\n\t    }else{\n\t      PORTB &amp;=~(1&lt;&lt;PINB1);\t\t\t \/\/else off\n\t    }\n     LCD_write_string(1,1,&quot;ADC  Temperature&quot;);\n     LCD_write_string(1,2,str);\n   }\n return 0;\n}\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-2e546ce576fc2e87e021fe974841f131 wp-block-paragraph\" style=\"color:#5c5c5c\">Read all dark condition of light and your desire condition inside if loop. For proper connection diagram see the proteus simulation.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-7387b849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-3e41869c wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/LDR.rar\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--40)\">download<\/a><\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p class=\"has-text-color has-link-color has-upper-heading-font-size wp-elements-6db1164e69c9600aa618af50d581f9bf wp-block-paragraph\" style=\"color:#252525\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/LDR.rar\">Sensor clibration.rar<\/a><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this program we use an LDR to read the light condition. The connection diagram of LDR as follow- LDR is nothing but a register that vary with light condition. At low light resistance is high and at high light the resistance is low. Temperature sensor LM35 is a digital temperature whose Vout value change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-1863","post","type-post","status-publish","format-standard","hentry","category-adc"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1863"}],"version-history":[{"count":9,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1863\/revisions"}],"predecessor-version":[{"id":2623,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1863\/revisions\/2623"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}