{"id":8391,"date":"2022-05-18T12:38:55","date_gmt":"2022-05-18T07:08:55","guid":{"rendered":"http:\/\/myprojectideas.com\/?p=8391"},"modified":"2025-10-28T07:49:20","modified_gmt":"2025-10-28T07:49:20","slug":"study-lamp-using-arduino-arduino-project","status":"publish","type":"post","link":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/","title":{"rendered":"Study Lamp Using Arduino | Arduino Project"},"content":{"rendered":"<h2><strong style=\"font-size: 26px;\">Introduction<\/strong><\/h2>\n<p>We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch on and off the study lamp using Arduino. Students in schools and colleges can utilize this automation for better and more efficient management of electricity while studying.<\/p>\n<iframe loading=\"lazy\"  id=\"_ytid_88895\"  width=\"1080\" height=\"607\"  data-origwidth=\"1080\" data-origheight=\"607\" src=\"https:\/\/www.youtube.com\/embed\/foHKvCJhjb4?enablejsapi=1&autoplay=0&cc_load_policy=0&cc_lang_pref=&iv_load_policy=1&loop=0&rel=1&fs=1&playsinline=0&autohide=2&theme=dark&color=red&controls=1&\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe>\n<h2><strong>Supplies<\/strong><\/h2>\n<p>In order to make a Study Lamp using Arduino, we will require the following components:<\/p>\n<h3><strong>Components<\/strong><\/h3>\n<ul>\n<li>Arduino Uno R3<\/li>\n<li>PhotoResistor Sensor<\/li>\n<li>PIR Sensor<\/li>\n<li>1 Bulb<\/li>\n<li>1 Resistor<\/li>\n<li>1 small BreadBoard<\/li>\n<li>Connecting wires<\/li>\n<\/ul>\n<h2><strong>Circuit Diagram<\/strong><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-18308 size-full\" src=\"https:\/\/rudelabs.ai\/blogs\/wp-content\/uploads\/2022\/05\/word-image-61.webp\" alt=\"Study Lamp Using Arduino\" width=\"1517\" height=\"597\" \/><\/p>\n<h2><strong>Steps To Make A Study Lamp Using Arduino<\/strong><\/h2>\n<p><strong>Step 1:<\/strong> Gather all the components on the Digital Board or Physical Table.<\/p>\n<p><strong>Bulb:<\/strong><\/p>\n<p><strong>Step 2:<\/strong> Connect the Cathode terminal of it to the GND pin of the Arduino.<\/p>\n<p><strong>Step 3:<\/strong> Connect the Second terminal of it to the 3 number pin of the Arduino.<\/p>\n<p><strong>PIR Sensor:<\/strong><\/p>\n<p><strong>Step 4:<\/strong> Connect the Ground terminal of it to the GND pin of the Arduino.<\/p>\n<p><strong>Step 5:<\/strong> Connect the Power terminal of it to the 5V pin of the Arduino.<\/p>\n<p><strong>Step 6:<\/strong> Connect the Signal terminal of it to the 5-number pin of the Arduino.<\/p>\n<p><strong>PhotoResistor Sensor:<\/strong><\/p>\n<p><strong>Step 7:<\/strong> Connect the first terminal of it to the GND pin of the Arduino thru a resistor and the same with the A2 pin of the Arduino.<\/p>\n<p><strong>Step 8:<\/strong> Connect the second terminal of it to the 5V pin of the Arduino.<\/p>\n<h2><strong>Source Code<\/strong><\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\">void setup()\r\n\r\n{\r\n\r\npinMode(3, OUTPUT);\r\n\r\npinMode(2, INPUT);\r\n\r\npinMode(5, INPUT);\r\n\r\n}\r\n\r\nvoid loop()\r\n\r\n{\r\n\r\nint time = analogRead(A2);\r\n\r\nint presence = digitalRead(5);\r\n\r\n\r\n\r\n\r\ndigitalWrite(3, LOW);\r\n\r\nif(time == LOW &amp;&amp; presence == HIGH)\r\n\r\n{\r\n\r\ndigitalWrite(3, HIGH);\r\n\r\ndelay(1000);\r\n\r\n}\r\n\r\nelse\r\n\r\n{\r\n\r\ndigitalWrite(3, LOW);\r\n\r\n}\r\n\r\n}<\/pre>\n<p><strong style=\"color: #333333; font-size: 26px;\">Explanation of the Code<\/strong><\/p>\n<p>1. In the setup function, we have configured the pins of the Arduino for input &amp; output purposes to glow the bulb and take input from the sensors.<\/p>\n<p>2. In the loop function, we are reading the value of the two sensors and storing it in a variable.<\/p>\n<p>3. Then, we use the if-else statement to glow the bulb accordingly if the condition is satisfied.<\/p>\n<p>4. Finally, The delay function takes the value of time in milliseconds.<\/p>\n<h2><a id=\"post-8391-_1fob9te\"><\/a><strong>Output<\/strong><\/h2>\n<p>We will get the following output on the successful completion of the project.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-18311 size-full\" src=\"https:\/\/rudelabs.ai\/blogs\/wp-content\/uploads\/2022\/05\/Study-Lamp-Using-Arduino-Arduino-Project.webp\" alt=\"Study Lamp Using Arduino\" width=\"1109\" height=\"615\" \/><\/p>\n<p>On starting the simulation, the BULB will glow if there is no light in the room and there&#8217;s someone near the table.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch on and off the lamp.<\/p>\n","protected":false},"author":1,"featured_media":8392,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[31,4,7],"tags":[],"class_list":["post-8391","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-coding-basics","category-coding-projects"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Study Lamp Using Arduino | Arduino Project - RUDE LABS<\/title>\n<meta name=\"description\" content=\"We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Study Lamp Using Arduino | Arduino Project - RUDE LABS\" \/>\n<meta property=\"og:description\" content=\"We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\" \/>\n<meta property=\"og:site_name\" content=\"RUDE LABS\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-18T07:08:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-28T07:49:20+00:00\" \/>\n<meta name=\"author\" content=\"rudelabs.ai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rudelabs_in\" \/>\n<meta name=\"twitter:site\" content=\"@rudelabs_in\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rudelabs.ai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\"},\"author\":{\"name\":\"rudelabs.ai\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#\/schema\/person\/560bad88bae03cae99a326a46af0c894\"},\"headline\":\"Study Lamp Using Arduino | Arduino Project\",\"datePublished\":\"2022-05-18T07:08:55+00:00\",\"dateModified\":\"2025-10-28T07:49:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\"},\"wordCount\":352,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#organization\"},\"image\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage\"},\"thumbnailUrl\":\"\",\"articleSection\":[\"Arduino\",\"Coding Basics\",\"Coding Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\",\"url\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\",\"name\":\"Study Lamp Using Arduino | Arduino Project - RUDE LABS\",\"isPartOf\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2022-05-18T07:08:55+00:00\",\"dateModified\":\"2025-10-28T07:49:20+00:00\",\"description\":\"We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch\",\"breadcrumb\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/rudelabs.ai\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Study Lamp Using Arduino | Arduino Project\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#website\",\"url\":\"https:\/\/rudelabs.ai\/blogs\/\",\"name\":\"RUDE LABS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/rudelabs.ai\/blogs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#organization\",\"name\":\"RUDE LABS\",\"url\":\"https:\/\/rudelabs.ai\/blogs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/rudelabs.ai\/blogs\/wp-content\/uploads\/2025\/09\/RUDE-LABS.webp\",\"contentUrl\":\"https:\/\/rudelabs.ai\/blogs\/wp-content\/uploads\/2025\/09\/RUDE-LABS.webp\",\"width\":2459,\"height\":414,\"caption\":\"RUDE LABS\"},\"image\":{\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/rudelabs_in\",\"https:\/\/www.linkedin.com\/company\/ru-delabs\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#\/schema\/person\/560bad88bae03cae99a326a46af0c894\",\"name\":\"rudelabs.ai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/rudelabs.ai\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4d9f672e72f97294dfb6fac3d78e9f0bb5421a701cd2141cf2a2e540b4d67191?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4d9f672e72f97294dfb6fac3d78e9f0bb5421a701cd2141cf2a2e540b4d67191?s=96&d=mm&r=g\",\"caption\":\"rudelabs.ai\"},\"sameAs\":[\"https:\/\/rudelabs.ai\/blogs\"],\"url\":\"https:\/\/rudelabs.ai\/blogs\/author\/rudelabs-ai\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Study Lamp Using Arduino | Arduino Project - RUDE LABS","description":"We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/","og_locale":"en_US","og_type":"article","og_title":"Study Lamp Using Arduino | Arduino Project - RUDE LABS","og_description":"We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch","og_url":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/","og_site_name":"RUDE LABS","article_published_time":"2022-05-18T07:08:55+00:00","article_modified_time":"2025-10-28T07:49:20+00:00","author":"rudelabs.ai","twitter_card":"summary_large_image","twitter_creator":"@rudelabs_in","twitter_site":"@rudelabs_in","twitter_misc":{"Written by":"rudelabs.ai","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#article","isPartOf":{"@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/"},"author":{"name":"rudelabs.ai","@id":"https:\/\/rudelabs.ai\/blogs\/#\/schema\/person\/560bad88bae03cae99a326a46af0c894"},"headline":"Study Lamp Using Arduino | Arduino Project","datePublished":"2022-05-18T07:08:55+00:00","dateModified":"2025-10-28T07:49:20+00:00","mainEntityOfPage":{"@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/"},"wordCount":352,"commentCount":0,"publisher":{"@id":"https:\/\/rudelabs.ai\/blogs\/#organization"},"image":{"@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage"},"thumbnailUrl":"","articleSection":["Arduino","Coding Basics","Coding Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/","url":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/","name":"Study Lamp Using Arduino | Arduino Project - RUDE LABS","isPartOf":{"@id":"https:\/\/rudelabs.ai\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage"},"image":{"@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage"},"thumbnailUrl":"","datePublished":"2022-05-18T07:08:55+00:00","dateModified":"2025-10-28T07:49:20+00:00","description":"We will make a Study Lamp using Arduino in this Arduino project tutorial. To make this project will use two sensors to automatically switch","breadcrumb":{"@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/rudelabs.ai\/blogs\/study-lamp-using-arduino-arduino-project\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rudelabs.ai\/blogs\/"},{"@type":"ListItem","position":2,"name":"Study Lamp Using Arduino | Arduino Project"}]},{"@type":"WebSite","@id":"https:\/\/rudelabs.ai\/blogs\/#website","url":"https:\/\/rudelabs.ai\/blogs\/","name":"RUDE LABS","description":"","publisher":{"@id":"https:\/\/rudelabs.ai\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rudelabs.ai\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/rudelabs.ai\/blogs\/#organization","name":"RUDE LABS","url":"https:\/\/rudelabs.ai\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rudelabs.ai\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/rudelabs.ai\/blogs\/wp-content\/uploads\/2025\/09\/RUDE-LABS.webp","contentUrl":"https:\/\/rudelabs.ai\/blogs\/wp-content\/uploads\/2025\/09\/RUDE-LABS.webp","width":2459,"height":414,"caption":"RUDE LABS"},"image":{"@id":"https:\/\/rudelabs.ai\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/rudelabs_in","https:\/\/www.linkedin.com\/company\/ru-delabs\/"]},{"@type":"Person","@id":"https:\/\/rudelabs.ai\/blogs\/#\/schema\/person\/560bad88bae03cae99a326a46af0c894","name":"rudelabs.ai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rudelabs.ai\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/4d9f672e72f97294dfb6fac3d78e9f0bb5421a701cd2141cf2a2e540b4d67191?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4d9f672e72f97294dfb6fac3d78e9f0bb5421a701cd2141cf2a2e540b4d67191?s=96&d=mm&r=g","caption":"rudelabs.ai"},"sameAs":["https:\/\/rudelabs.ai\/blogs"],"url":"https:\/\/rudelabs.ai\/blogs\/author\/rudelabs-ai\/"}]}},"_links":{"self":[{"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/posts\/8391","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/comments?post=8391"}],"version-history":[{"count":2,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/posts\/8391\/revisions"}],"predecessor-version":[{"id":18312,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/posts\/8391\/revisions\/18312"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/media?parent=8391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/categories?post=8391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rudelabs.ai\/blogs\/wp-json\/wp\/v2\/tags?post=8391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}