{"id":59904,"date":"2024-06-19T14:40:38","date_gmt":"2024-06-19T18:40:38","guid":{"rendered":"https:\/\/www.engineersgarage.com\/microcontroller-projects-tf\/ldr-with-piezo-sensor\/"},"modified":"2024-06-20T16:16:33","modified_gmt":"2024-06-20T20:16:33","slug":"ldr-with-piezo-sensor","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/","title":{"rendered":"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor"},"content":{"rendered":"<div id=\"content\">\n<div id=\"wsite-content\" class=\"wsite-elements wsite-not-footer\">\n<div>\n<div id=\"874224834603088102\" class=\"wcustomhtml\" style=\"width: 100%; overflow-y: hidden;\" align=\"center\"><input name=\"IL_IN_TAG\" type=\"hidden\" value=\"2\" \/><\/div>\n<\/div>\n<div><\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">This is a simple project on arduino, ldr(light dependent resistor)\/photoresistor sensor and piezo buzzer. Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor. An led will also fade by arduino depending on the intensity of light thrown on photoresistor. The diy project is same like basic electronics project which we design in our electronics class &#8220;<strong>Light sensor<\/strong>&#8221; using passive components(Resistors, Transistors, LDR, Led, Buzzer). The difference is, in our diy project we are going to use a dedicated\u00a0microcontroller(Arduino uno) for controlling buzzer sound level and led fadeness depending on the ldr light sensor value.\u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/span><\/div>\n<div>\n<div class=\"wsite-image wsite-image-border-none \" style=\"padding-top: 10px; padding-bottom: 10px; margin-left: 0px; margin-right: 0px; text-align: center;\">\n<p><a href=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/buzzer-arduino-led-and-ldr_orig.jpg\" rel=\"lightbox\"> <img decoding=\"async\" style=\"width: auto; max-width: 100%;\" src=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/buzzer-arduino-led-and-ldr_orig.jpg\" alt=\"Buzzer Arduino led and LDR\" \/> <\/a><\/p>\n<div style=\"display: block; font-size: 90%;\">Buzzer Arduino led and LDR<\/div>\n<\/div>\n<\/div>\n<div>\n<div id=\"259072335188983247\" class=\"wcustomhtml\" style=\"width: 100%; overflow-y: hidden;\" align=\"left\">\n<h3>Piezo buzzer<\/h3>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">Piezo buzzer is a small electronic component. It outputs a tone when voltage is supplied across its power pins. Normally piezo buzzer operates on 5 volts, but 12 volt versions are also available. The tone\/sound produced by piezo buzzer depends on the power supplied to it. If power is low the output tone will be low and if power is high the pitch of tone\/sound will be high. A 5 volt rated piezo buzzer can output a tone at 3 volt. The output tone pitch increase if we increase the voltage from 3 and the maximum tone we will get is at 5 volts. Piezo buzzer have two pins. Vcc to which we supply +ve voltage and Gnd which we connect to out power source ground.<\/span><\/div>\n<div>\n<div id=\"490201114923507439\" class=\"wcustomhtml\" style=\"width: 100%; overflow-y: hidden;\" align=\"left\">\n<h3>LDR(Light dependent resistor)\/Photoresistor<\/h3>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">LDR is a special resistor. LDR resistance varies when light is thrown on it\u00a0 Its resistance increases and decreases depending on the intensity of light thrown on it. Normally it has high resistance and when it is exposed to light its resistance decreases. This unique feature of LDR makes us to use it in automatic street light on\/off circuits. It is used as autonomous light switch. Light intensity and brightness can be controlled using LDR.<br \/>\nIn our project we are also going to measure the intensity of light with ldr(light dependent resistor). Now how we are going to measure it? See the diagram on below.<\/span><\/div>\n<div>\n<div class=\"wsite-multicol\">\n<div class=\"wsite-multicol-table-wrap\" style=\"margin: 0 -15px;\">\n<table class=\"wsite-multicol-table\">\n<tbody class=\"wsite-multicol-tbody\">\n<tr class=\"wsite-multicol-tr\">\n<td class=\"wsite-multicol-col\" style=\"width: 42.045454545455%; padding: 0 15px;\"><\/td>\n<td class=\"wsite-multicol-col\" style=\"width: 57.954545454545%; padding: 0 15px;\">\n<div>\n<div class=\"wsite-image wsite-image-border-none \" style=\"padding-top: 10px; padding-bottom: 10px; margin-left: 0px; margin-right: 10px; text-align: center;\">\n<p><a href=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/3209640_orig.jpg\" rel=\"lightbox\"> <img decoding=\"async\" style=\"width: 470; max-width: 100%;\" src=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/published\/3209640.jpg?1533979188\" alt=\"LDR Arduino measuring intensity of light\" \/> <\/a><\/p>\n<div style=\"display: block; font-size: 90%;\">LDR Arduino measuring intensity of light<\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">A voltage divider circuit is shown above. Recall LDR is a resistor. when their is no light on ldr very little amount of current will flow through the circuit. 100 k resistor will be on 0 potential. Their will be no voltage across the 100 k resistor. Now when a light source is brought near the LDR. Its resistance\u00a0will start decreasing and current starts flowing\u00a0through the circuit. Voltage starts appearing across the 100 k resistor. The more the intensity of light thrown on ldr the more voltage appears on the 100 k resistor. When the amount of light thrown on the ldr sensor increases the threshold value the ldr resistance\u00a0becomes almost to 0.<br \/>\nThe voltage appearing across the 100 k resistor is read by the analog pins of arduino and translated for further use(controlling buzzer arduino and led fade mechanism).<\/span><\/div>\n<div>\n<div id=\"781642142217863107\" class=\"wcustomhtml\" style=\"width: 100%; overflow-y: hidden;\" align=\"left\">\n<h3>Project Circuit diagram<\/h3>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">Arduino two digital pins and one analog pin is used in the project. Two digital pins of arduino are carefully selected. I choose the arduino digital pins(~11 and ~6) which can output a pwm signal. I hope you people know about the PWM(Pulse width modulation) technique. If not then just for this tutorial take it(pwm) as a way to output a variable signal on digital pins. From variable signal i mean output voltage between 0-5 volt. It can be 0.5, 1, 1.2, 3.5, 4.1 volts any voltage between 0-5 volts.<br \/>\nArduino buzzer one leg is connected to arduino pin#11 and the other is pulled high. Led positive leg is connected to arduino pin#6 and the other end is pulled high. 5 volts supplied to buzzer and led can be from the arduino 5v pin. 220 ohm resistor in series with the buzzer and led is used for current limiting purpose.<br \/>\nLDR and 10 k resistor voltage divider circuit middle point is connected to analog channel 0 of arduino uno. Ldr input 5 volts can also be supplied with the arduino 5 volt output rail. Circuit diagram of the project is given below.\u00a0\u00a0<\/span><\/div>\n<div>\n<div class=\"wsite-image wsite-image-border-none \" style=\"padding-top: 10px; padding-bottom: 10px; margin-left: 0px; margin-right: 0px; text-align: center;\">\n<p><a href=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/buzzer-arduino-led-and-ldr-light-control-switch_orig.gif\" rel=\"lightbox\"> <img decoding=\"async\" style=\"width: auto; max-width: 100%;\" src=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/buzzer-arduino-led-and-ldr-light-control-switch_orig.gif\" alt=\"Arduino buzzer alarm with light dependent resistor(LDR)\/photoresistor \" \/> <\/a><\/p>\n<div style=\"display: block; font-size: 90%;\">Arduino buzzer alarm with light dependent resistor(LDR)\/photoresistor<\/div>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\"><span style=\"font-size: medium;\">Coming to the code portion of the project. Code is written in arduino ide and its free for every one. You can use and modify it according to your needs. In the code first i defined the variables for analog channel 0 of arduino as <strong>sensor<\/strong>, buzzer arduino pin(arduino pin#11) as <strong>Buz<\/strong> and led arduino pin(arduinp pin#6) as <strong>Led<\/strong>. In the setup function i declared the <strong>Buz<\/strong> and<strong> Led <\/strong>pins as output. Since they are outputting voltage or Pwm(pulse width modulated) signal for buzzer and led fadness.<br \/>\nIn setup function arduino serial port is also initialized at 9600 baud rate. Arduino serial port is initialized to see the voltage measurement by analog channel 0 to which LDR output is connected. <strong>Serial.begin(9600)<\/strong>\u00a0statement is initialing the arduino serial port.\u00a0\u00a0 \u00a0\u00a0<\/span><\/div>\n<div>\n<div id=\"964896968706421694\" class=\"wcustomhtml\" style=\"width: 100%; overflow-y: hidden;\" align=\"left\">\n<div><script src=\"https:\/\/gist.github.com\/d-boz-wtwh\/e1e3e0fd27d909f97f4af655f1f59dfb.js\"><\/script><\/div>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: justify;\">\n<p><span style=\"font-size: medium;\">In the loop function first i am reading the LDR intensity light value. The statement <strong>int senValue=analogRead(sensor)<\/strong> is reading the LDR output voltage across 10 k resistor. The read value is stored in <strong>senValue<\/strong> variable.\u00a0<\/span><\/p>\n<ul>\n<li><span style=\"font-size: medium;\">Arduino is a 5 volt tolerant device. Its gpio pins can output 5 volt TTL signal. Similarly its gpio pins can be exposed to 5 v TTL signal as input. Higher than 5 v may destroy the gpio pin. So your input voltage to arduino pins must remain between 0-5 volts. I supplied 5 volt to LDR keeping in mind the above constraint. \u00a0<\/span><\/li>\n<li><span style=\"font-size: medium;\">Arduino analog channel can also read max 5 volts. Arduino ADC(Analog to digital channel) is 10 bit wide or its resolution is 10 bit. Means it can\u00a0 output value up to 1024. 1024 represents 5 volts. 512 represents 2.5 volts and vise versa.<\/span><\/li>\n<li><span style=\"font-size: medium;\"><strong>So if voltage across the 10 k resistor is 2 volts than the analog channel 0 of arduino will read it and provide us an integer value of 410. [\u00a0(410\/1024)*5v = 2v ].<\/strong><\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: medium;\">The same above strategy is applied in the code. When the voltage across 10 k resistor increases 1.5 volts(ADC value 310) then the buzzer and led are activated and are driven with the same voltage that appears across the 10 k resistor<strong>.\u00a0 <\/strong>The if statement in the code is checking 1.5 volts or 310 integer value by ADC. Buzzer and LED will operate only on the voltages greater than 1.5 volts.\u00a0<strong>\u00a0<\/strong>\u00a0\u00a0\u00a0<\/span><\/p>\n<ul>\n<li><span style=\"font-size: medium;\">Unlike arduino ADC the arduino pwm provides 8 bit resolution. So in <strong>analogWrite(*, senValue\/4)<\/strong> function in code i am dividing\u00a0the <strong>senValue<\/strong> by 4 to bring the <strong>senValue<\/strong>\u00a0in 8 bit resolution 0-255. I hope it makes sense to you.\u00a0<\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: medium;\"><br \/>\nMore advanced projects involving Buzzer and a microcontroller. Click the below buttons to visit the projects. Source code and circuit diagram of each project is free.<\/span><\/p>\n<\/div>\n<div style=\"text-align: center;\">\n<div style=\"height: 10px; overflow: hidden;\"><\/div>\n<p><a class=\"wsite-button wsite-button-small wsite-button-normal\" href=\"\/arduino-home-security-with-gsm-pir-and-reed-switch.html\" target=\"_blank\" rel=\"noopener noreferrer\"> <span class=\"wsite-button-inner\">Home security system with Arduino<\/span> <\/a><\/p>\n<div style=\"height: 10px; overflow: hidden;\"><\/div>\n<\/div>\n<div style=\"text-align: center;\">\n<div style=\"height: 10px; overflow: hidden;\"><\/div>\n<p><a class=\"wsite-button wsite-button-small wsite-button-normal\" href=\"\/pir-motion-detector-with-nodemcu.html\" target=\"_blank\" rel=\"noopener noreferrer\"> <span class=\"wsite-button-inner\">WiFi security alarm with nodemcu<\/span> <\/a><\/p>\n<div style=\"height: 10px; overflow: hidden;\"><\/div>\n<\/div>\n<div>\n<div id=\"829484731897845653\" class=\"wcustomhtml\" style=\"width: 100%; overflow-y: hidden;\" align=\"left\">\n<div id=\"test\" align=\"justify\"><span style=\"font-size: large;\"> Download the project code. Folder contains arduino ide .ino project file. Please provide us your feed back on the project. Write your comments below in the comments section. <\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"paragraph\" style=\"text-align: right;\"><a href=\"\/wp-content\/uploads\/2\/2\/1\/5\/22159166\/buzzer_arduino_led_and_ldr_light_detector_alarm.rar\">Code\/Files<\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This is a simple project on arduino, ldr(light dependent resistor)\/photoresistor sensor and piezo buzzer. Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor. An led will also fade by arduino depending on the intensity of light thrown on photoresistor. The diy project is same like&hellip;<\/p>\n","protected":false},"author":394,"featured_media":59903,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[32,13,1853],"tags":[],"class_list":{"2":"type-post","10":"entry","11":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Arduino based Piezo Buzzer alarm using LDR<\/title>\n<meta name=\"description\" content=\"Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor\" \/>\n<meta property=\"og:description\" content=\"Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1108\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"EG Projects\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"EG Projects\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\"},\"author\":{\"name\":\"EG Projects\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2\"},\"headline\":\"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor\",\"datePublished\":\"2024-06-19T18:40:38+00:00\",\"dateModified\":\"2024-06-20T20:16:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\"},\"wordCount\":1152,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg\",\"articleSection\":[\"Arduino Projects\",\"Electronic Projects\",\"Featured Contributions\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\",\"url\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\",\"name\":\"Arduino based Piezo Buzzer alarm using LDR\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg\",\"datePublished\":\"2024-06-19T18:40:38+00:00\",\"dateModified\":\"2024-06-20T20:16:33+00:00\",\"description\":\"Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg\",\"width\":1108,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2\",\"name\":\"EG Projects\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g\",\"caption\":\"EG Projects\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/eg-projects\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Arduino based Piezo Buzzer alarm using LDR","description":"Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor.","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:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/","og_locale":"en_US","og_type":"article","og_title":"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor","og_description":"Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor.","og_url":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":1108,"height":600,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","type":"image\/jpeg"}],"author":"EG Projects","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"EG Projects","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/"},"author":{"name":"EG Projects","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2"},"headline":"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor","datePublished":"2024-06-19T18:40:38+00:00","dateModified":"2024-06-20T20:16:33+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/"},"wordCount":1152,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","articleSection":["Arduino Projects","Electronic Projects","Featured Contributions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/","url":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/","name":"Arduino based Piezo Buzzer alarm using LDR","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","datePublished":"2024-06-19T18:40:38+00:00","dateModified":"2024-06-20T20:16:33+00:00","description":"Piezo buzzer output sound level will variate by arduino depending on the intensity of light thrown on ldr\/light sensor.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","width":1108,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/ldr-with-piezo-sensor\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"Arduino piezo buzzer alarm with LDR(light dependent resistor)\/photoresistor"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/46bbd53b9db1c5d1580cd604e3d6a2f2","name":"EG Projects","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/258abb93057dea88a2a5a7616dccf9a0dc3a77d050ca970493853035a0e6f634?s=96&r=g","caption":"EG Projects"},"url":"https:\/\/www.engineersgarage.com\/author\/eg-projects\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/10\/buzzer-arduino-led-and-ldr_orig-2.jpg","author_info":{"display_name":"EG Projects","author_link":"https:\/\/www.engineersgarage.com\/author\/eg-projects\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/59904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/394"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=59904"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/59904\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/59903"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=59904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=59904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=59904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}