{"id":118010,"date":"2023-05-09T09:30:00","date_gmt":"2023-05-09T04:00:00","guid":{"rendered":"https:\/\/www.electronicsforu.com\/?p=118010"},"modified":"2024-07-26T17:30:29","modified_gmt":"2024-07-26T12:00:29","slug":"simple-automatic-bathroom-light-circuit","status":"publish","type":"post","link":"https:\/\/www.electronicsforu.com\/electronics-projects\/simple-automatic-bathroom-light-circuit","title":{"rendered":"Simple Automatic Bathroom Light"},"content":{"rendered":"<p>An automatic bathroom light Circuit can be made in several ways, depending on your preference and budget. Some of the options make use of either a motion sensor, a smart switch, an occupancy sensor, or a photo sensor.<\/p>\n<p>The simple system proposed here makes use of a small magnet fixed in the bathroom door\u2019s frame and a reed switch with normally open contacts as the sensor on the bathroom door, just opposite the magnet. So, whenever you open the door, the reed switch will move away from the magnet.<\/p>\n<figure id=\"attachment_118015\" aria-describedby=\"caption-attachment-118015\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-118015 size-full\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig.-1-Authors-prototype-2.jpg\" alt=\"Automatic Bathroom Light Connection\" width=\"500\" height=\"187\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig.-1-Authors-prototype-2.jpg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig.-1-Authors-prototype-2-50x19.jpg 50w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig.-1-Authors-prototype-2-100x37.jpg 100w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><figcaption id=\"caption-attachment-118015\" class=\"wp-caption-text\">Fig.1: Automatic Bathroom Light Connection<\/figcaption><\/figure>\n<p><em><strong>Note:<\/strong> Be sure to consult a qualified electrician if you\u2019re not comfortable with electrical work or if you need help with installation. Safety should always be your top priority when working with electricity.<\/em><\/p>\n<h2><strong>Automatic Bathroom Light Circuit Diagram<\/strong><\/h2>\n<p>The author\u2019s prototype is shown in Fig. 1 and the circuit diagram is shown in Fig. 2.<br \/>\nThe circuit comprises <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/learn-electronics\/step-down-transformer-working\">step-down transformer X1<\/a>, a normally closed type of reed switch, <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/learn-electronics\/bridge-rectifier-circuit-construction-working-types\">bridge rectifier BR1<\/a>, transistor BC557 (T1), <a href=\"https:\/\/www.electronicsforu.com\/technology-trends\/learn-electronics\/7805-ic-voltage-regulator\">5V voltage regulator LM7805 (IC1)<\/a>, a small magnet, op-amp 741 (IC2), decade counter 4017 (IC3), transistor 2N2219 (T2), 5V single changeover relay RL1, and a few other components.<\/p>\n<figure id=\"attachment_118019\" aria-describedby=\"caption-attachment-118019\" style=\"width: 800px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-118019 size-full\" src=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig-2-Circuit-diagram-2.jpg\" alt=\"Automatic Bathroom Light Circuit Diagram\" width=\"800\" height=\"223\" srcset=\"https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig-2-Circuit-diagram-2.jpg 800w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig-2-Circuit-diagram-2-500x139.jpg 500w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig-2-Circuit-diagram-2-696x194.jpg 696w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig-2-Circuit-diagram-2-50x14.jpg 50w, https:\/\/www.electronicsforu.com\/wp-contents\/uploads\/2023\/04\/Fig-2-Circuit-diagram-2-100x28.jpg 100w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-118019\" class=\"wp-caption-text\">Fig. 2: Automatic Bathroom Light Circuit Diagram<\/figcaption><\/figure>\n<p>The circuit needs 5V DC o work, which can be derived from the 230V AC primary to 9V, 500mA step-down transformer X1. The 9V AC from X1 goes to bridge rectifier BR1 for rectification and is filtered by capacitor C1. The rectified and filtered voltage is regulated to 5V DC by IC LM7805, which is indicated by the glowing LED1.<\/p>\n<h2><strong>Automatic Bathroom Light Working<\/strong><\/h2>\n<p>When the bathroom door is closed, the magnet and the reed switch are near each other, reed switch contacts are open, and BC557 transistor T1 does not conduct. Hence voltage at pin 3 of IC2 remains lower than the reference voltage at pin 2 (around half of the supply voltage), output of op-amp IC2 at its pin 1 remains low, and decade counter 4017 (IC3) does not get any clock signal.<\/p>\n<p>When the door is opened, the magnet and the reed switch move away from each other, the reed switch contacts close, and transistor T1 conducts. Hence voltage at pin 3 of IC2 goes higher than the reference voltage at pin 2, output of op-amp IC2 at its pin 1 goes from low to high, and decade counter 4017 (IC3) gets a clock signal. Clock Q0 of 4017 shifts to Q1 output and relay driver transistor T2 conducts. As a result, relay RL1 energizes and the bathroom light gets connected to 230V AC and glows.<\/p>\n<p>After entering the bathroom, when you close the door again, the magnet and the reed switch again come near each other. Reed switch contacts open and transistor T1 does not conduct. Hence voltage at pin 3 of IC2 goes lower than the reference voltage at pin 2, output of op-amp IC2 at pin 1 goes from high to low, and decade counter 4017 (IC3) does not get any clock signal. Clock Q1 of 4017 does not shift to Q2 output, the relay remains energized, and the bathroom light keeps glowing.<\/p>\n<table dir=\"ltr\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<colgroup>\n<col width=\"119\" \/>\n<col width=\"335\" \/><\/colgroup>\n<tbody>\n<tr>\n<td colspan=\"2\" rowspan=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Parts List&quot;}\"><strong>Parts List<\/strong><\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" rowspan=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Semiconductors:&quot;}\">Semiconductors:<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;IC1&quot;}\">IC1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- LM7805, 5V voltage regulator&quot;}\">&#8211; LM7805, 5V voltage regulator<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;IC2&quot;}\">IC2<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- Op-amp 741&quot;}\">&#8211; Op-amp 741<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;IC3&quot;}\">IC3<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 4017 decade counter&quot;}\">&#8211; 4017 decade counter<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;BR1&quot;}\">BR1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 1A bridge rectifier&quot;}\">&#8211; 1A bridge rectifier<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;LED1&quot;}\">LED1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 5mm LED&quot;}\">&#8211; 5mm LED<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;T1&quot;}\">T1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- BC557 PNP transistor&quot;}\">&#8211; BC557 PNP transistor<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;T2&quot;}\">T2<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 2N2219 NPN transistor&quot;}\">&#8211; 2N2219 NPN transistor<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" rowspan=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Resistors (all 1\/4-watt, \u00b15% carbon):&quot;}\">Resistors (all 1\/4-watt, \u00b15% carbon):<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;R1, R2&quot;}\">R1, R2<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 1-kilo-ohm&quot;}\">&#8211; 1-kilo-ohm<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;R3&quot;}\">R3<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 680-ohm&quot;}\">&#8211; 680-ohm<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;R4&quot;}\">R4<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 10-kilo-ohm&quot;}\">&#8211; 10-kilo-ohm<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;R5, R6&quot;}\">R5, R6<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 12-kilo-ohm&quot;}\">&#8211; 12-kilo-ohm<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" rowspan=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Capacitors:&quot;}\">Capacitors:<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;C1&quot;}\">C1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 1000\u03bcF, 35V electrolytic&quot;}\">&#8211; 1000\u03bcF, 35V electrolytic<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;C2&quot;}\">C2<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 1\u03bcF, 16V electrolytic&quot;}\">&#8211; 1\u03bcF, 16V electrolytic<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\" rowspan=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Miscellaneous:&quot;}\">Miscellaneous:<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;CON1-CON3&quot;}\">CON1-CON3<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 2-pin connector&quot;}\">&#8211; 2-pin connector<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;S1&quot;}\">S1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- Small normally closed type glass reed switch&quot;}\">&#8211; Small normally closed-type glass reed switch<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;RL1&quot;}\">RL1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 5V, 1CO relay&quot;}\">&#8211; 5V, 1CO relay<\/td>\n<\/tr>\n<tr>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;X1&quot;}\">X1<\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- 230V AC primary to 9V, 500mA secondary transformer&quot;}\">&#8211; 230V AC primary to 9V, 500mA secondary transformer<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;- A small magnet&quot;}\">&#8211; A small magnet<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>When you open the bathroom door once again to exit, the magnet and the reed switch move away from each other, the reed switch contacts close, and transistor T1 conducts. Hence voltage at pin 3 of IC2 goes higher than the reference voltage at pin 2, output of op-amp IC2 at its pin 1 goes from low to high, and decade counter 4017 (IC3) gets a clock signal. Clock Q1 of 4017 now shifts to Q2 output and relay driver transistor T2 stops conducting. As a result, relay RL1 de-energizes, and the bathroom light disconnects from 230V AC and goes off.<\/p>\n<div class=\"mepr_error\"><div class=\"locked-content\">\n<b>EFY++ CONTENT: ACCESS TO THIS CONTENT IS FREE! BUT YOU NEED TO BE A REGISTERED USER.<\/b><\/p>\n<p>Oops! This is an EFY++ article, which means it's our Premium Content. You need to be a Registered User of our website to read its complete content.<\/p>\n<p><b>Good News: <\/b>You can register to our website for FREE! <a href=\"https:\/\/www.electronicsforu.com\/plans\/subscription-plans\" target=\"_blank\" rel=\"noopener\">CLICK HERE<\/a> to register now.<\/p>\n<p><b>Already a registered member? <\/b>If YES, then simply login to you account below. (TIP: Use 'forgot password' feature and reset and save your new password in your browser, if you forgot the last one!)\n<\/div>\n<\/div><div>\n<div class=\"mp_wrapper mp_login_form\">\n                  <!-- mp-login-form-start -->     <form name=\"mepr_loginform\" id=\"mepr_loginform\" class=\"mepr-form\" action=\"https:\/\/www.electronicsforu.com\/login\" method=\"post\">\n            <div class=\"mp-form-row mepr_username\">\n        <div class=\"mp-form-label\">\n                              <label for=\"user_login\">Username<\/label>\n        <\/div>\n        <input type=\"text\" name=\"log\" id=\"user_login\" value=\"\" \/>\n      <\/div>\n      <div class=\"mp-form-row mepr_password\">\n        <div class=\"mp-form-label\">\n          <label for=\"user_pass\">Password<\/label>\n          <div class=\"mp-hide-pw\">\n            <input type=\"password\" name=\"pwd\" id=\"user_pass\" value=\"\" \/>\n            <button type=\"button\" class=\"button mp-hide-pw hide-if-no-js\" data-toggle=\"0\" aria-label=\"Show password\">\n              <span class=\"dashicons dashicons-visibility\" aria-hidden=\"true\"><\/span>\n            <\/button>\n          <\/div>\n        <\/div>\n      <\/div>\n            <div>\n        <label><input name=\"rememberme\" type=\"checkbox\" id=\"rememberme\" value=\"forever\" \/> Remember Me<\/label>\n      <\/div>\n      <div class=\"mp-spacer\">&nbsp;<\/div>\n      <div class=\"submit\">\n        <input type=\"submit\" name=\"wp-submit\" id=\"wp-submit\" class=\"button-primary mepr-share-button \" value=\"Log In\" \/>\n        <input type=\"hidden\" name=\"redirect_to\" value=\"\/wp-json\/wp\/v2\/posts\/118010\" \/>\n        <input type=\"hidden\" name=\"mepr_process_login_form\" value=\"true\" \/>\n        <input type=\"hidden\" name=\"mepr_is_login_page\" value=\"false\" \/>\n      <\/div>\n    <\/form>\n    <div class=\"mp-spacer\">&nbsp;<\/div>\n    <div class=\"mepr-login-actions\">\n      <a href=\"https:\/\/www.electronicsforu.com\/login?action=forgot_password\">Forgot Password<\/a>\n    <\/div>\n\n      \n    <!-- mp-login-form-end --> \n  <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>An automatic bathroom light Circuit can be made in several ways, depending on your preference and budget. Some of the options make use of either a motion sensor, a smart switch, an occupancy sensor, or a photo sensor. The simple system proposed here makes use of a small magnet fixed in the bathroom door\u2019s frame [&hellip;]<\/p>\n","protected":false},"author":106036,"featured_media":118015,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,23,6070,6072,3713],"tags":[1985,110,83,10413],"class_list":{"0":"post-118010","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-electronics-projects","8":"category-hardware-diy","9":"category-advanced-projects","10":"category-beginners-projects","11":"category-premium","12":"tag-diy-projects","13":"tag-electronics-projects","14":"tag-featured","15":"tag-may-2023"},"_links":{"self":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/118010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/users\/106036"}],"replies":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/comments?post=118010"}],"version-history":[{"count":1,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/118010\/revisions"}],"predecessor-version":[{"id":144947,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/posts\/118010\/revisions\/144947"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media\/118015"}],"wp:attachment":[{"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/media?parent=118010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/categories?post=118010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.electronicsforu.com\/wp-json\/wp\/v2\/tags?post=118010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}