{"id":332,"date":"2011-12-17T09:24:59","date_gmt":"2011-12-17T08:24:59","guid":{"rendered":"http:\/\/stigern.net\/blog\/?p=332"},"modified":"2026-11-17T11:19:58","modified_gmt":"2026-11-17T10:19:58","slug":"arduino-leds-that-blinks-to-the-music","status":"publish","type":"post","link":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/","title":{"rendered":"Arduino, LEDs that blinks to the Music!"},"content":{"rendered":"<p>I always wanted to make something out of the microphone sensor I got, it&#8217;s just been laying in a compartment-box until recently when I got the idea of a music beat blinker.<\/p>\n<p><a href=\"http:\/\/stigern.net\/images\/2011\/arduinobeatshd.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" title=\"Arduino Beats\" src=\"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg\" alt=\"\" width=\"300\" height=\"254\" \/><\/a><\/p>\n<p>Basically it just reads the analog value from the mic and converts it to a 0-1023 value, but since the microphone sensor I got is meant for 12 volts, it only ranges from 0 &#8211; 5-600 on 5 volts. But it works just as good, only it&#8217;s not as sensitive as it should be. When playing music that is never a problem hehe.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"http:\/\/stigern.net\/images\/2011\/explanation.jpg\" alt=\"\" width=\"200\" height=\"213\" \/><\/p>\n<p>The microphone sensor I use is one I found on eBay some time ago, just search for &#8220;Arduino Sound Sensor Module&#8221; they cost around 5$. And are very easy to use, only ground it and feed it with 5 volts and stick the output to a analog input on the Arduino. I&#8217;ll also post the program code for the Arduino, it&#8217;s the same thats used in the video below. If you want to make something like this yourself using my example, you only need 5 LEDs or more. And just wire them to the digital pins 2-5, and of course the mic to analog 0. Code example can be found in the bottom of this article.<\/p>\n<p>Here is a video showing the LEDs blinking to the music.<\/p>\n<p><iframe loading=\"lazy\" src=\"http:\/\/www.youtube.com\/embed\/1lAyXiVFdZc?rel=0&amp;hd=1\" frameborder=\"0\" width=\"562\" height=\"317\"><\/iframe><\/p>\n<p>Program code example:<\/p>\n<p>[codesyntax lang=&#8221;cpp&#8221; lines=&#8221;no&#8221; blockstate=&#8221;collapsed&#8221;]<\/p>\n<pre>int micValue = 0; \/\/ Store the readings here.\r\nvoid setup()\r\n{\r\n\/\/ Settings the pins for output to leds.\r\npinMode(2, OUTPUT);\r\npinMode(3, OUTPUT);\r\npinMode(4, OUTPUT);\r\npinMode(5, OUTPUT);\r\n}\r\n\r\nvoid loop()\r\n{\r\n\/\/ Lets read from the mic\r\nmicValue = analogRead(0);\r\n\r\n\/\/ Then choose what leds to turn\r\n\/\/ on and off.\r\nif (micValue &gt; 410)\r\n{\r\ndigitalWrite(2, HIGH);\r\n\r\n}\r\nelse\r\n{\r\ndigitalWrite(2, LOW);\r\n}\r\n\r\nif (micValue &gt; 520)\r\n{\r\ndigitalWrite(3, HIGH);\r\n\r\n}\r\nelse\r\n{\r\ndigitalWrite(3, LOW);\r\n}\r\n\r\nif (micValue &gt; 580)\r\n{\r\ndigitalWrite(4, HIGH);\r\n\r\n}\r\nelse\r\n{\r\ndigitalWrite(4, LOW);\r\n}\r\n\r\nif (micValue &gt; 610)\r\n{\r\ndigitalWrite(5, HIGH);\r\n\r\n}\r\nelse\r\n{\r\ndigitalWrite(5, LOW);\r\n}\r\n\r\n}<\/pre>\n<p>[\/codesyntax]<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I always wanted to make something out of the microphone sensor I got, it&#8217;s just been laying in a compartment-box until recently when I got the idea of a music beat blinker. Basically it just reads the analog value from the mic and converts it to a 0-1023 value, but since the microphone sensor I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":6,"footnotes":""},"categories":[14,4],"tags":[16,236,237,235,26,95,30,238,75,239,61],"class_list":["post-332","post","type-post","status-publish","format-standard","hentry","category-arduino-electronics","category-electronics","tag-arduino","tag-beat","tag-blink","tag-disco","tag-guide","tag-how","tag-led","tag-mic","tag-sensor","tag-sound","tag-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino, LEDs that blinks to the Music! - Stigern.Net<\/title>\n<meta name=\"description\" content=\"A music beat blinker made with an Arduino and a microphone sensor: it reads the analog value from the mic and blinks LEDs in time with the music.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino, LEDs that blinks to the Music! - Stigern.Net\" \/>\n<meta property=\"og:description\" content=\"A music beat blinker made with an Arduino and a microphone sensor: it reads the analog value from the mic and blinks LEDs in time with the music.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/\" \/>\n<meta property=\"og:site_name\" content=\"Stigern.Net\" \/>\n<meta property=\"article:published_time\" content=\"2011-12-17T08:24:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-17T10:19:58+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg\" \/>\n<meta name=\"author\" content=\"Stigern\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stigern\" \/>\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:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/\"},\"author\":{\"name\":\"Stigern\",\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/#\\\/schema\\\/person\\\/a2a77157fa1facae3c843032fbc1ad3c\"},\"headline\":\"Arduino, LEDs that blinks to the Music!\",\"datePublished\":\"2011-12-17T08:24:59+00:00\",\"dateModified\":\"2026-11-17T10:19:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/\"},\"wordCount\":238,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/#\\\/schema\\\/person\\\/a2a77157fa1facae3c843032fbc1ad3c\"},\"image\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/stigern.net\\\/images\\\/2011\\\/arduinobeats.jpg\",\"keywords\":[\"arduino\",\"beat\",\"blink\",\"disco\",\"guide\",\"how\",\"led\",\"mic\",\"sensor\",\"sound\",\"tutorial\"],\"articleSection\":[\"Arduino\",\"Electronics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/\",\"url\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/\",\"name\":\"Arduino, LEDs that blinks to the Music! - Stigern.Net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/stigern.net\\\/images\\\/2011\\\/arduinobeats.jpg\",\"datePublished\":\"2011-12-17T08:24:59+00:00\",\"dateModified\":\"2026-11-17T10:19:58+00:00\",\"description\":\"A music beat blinker made with an Arduino and a microphone sensor: it reads the analog value from the mic and blinks LEDs in time with the music.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#primaryimage\",\"url\":\"http:\\\/\\\/stigern.net\\\/images\\\/2011\\\/arduinobeats.jpg\",\"contentUrl\":\"http:\\\/\\\/stigern.net\\\/images\\\/2011\\\/arduinobeats.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/arduino-leds-that-blinks-to-the-music\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/stigern.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino, LEDs that blinks to the Music!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/stigern.net\\\/blog\\\/\",\"name\":\"Stigern.Net\",\"description\":\"my little blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/#\\\/schema\\\/person\\\/a2a77157fa1facae3c843032fbc1ad3c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/stigern.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/stigern.net\\\/blog\\\/#\\\/schema\\\/person\\\/a2a77157fa1facae3c843032fbc1ad3c\",\"name\":\"Stigern\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g\",\"caption\":\"Stigern\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g\"},\"sameAs\":[\"http:\\\/\\\/www.stigern.net\"],\"url\":\"https:\\\/\\\/stigern.net\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino, LEDs that blinks to the Music! - Stigern.Net","description":"A music beat blinker made with an Arduino and a microphone sensor: it reads the analog value from the mic and blinks LEDs in time with the music.","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:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/","og_locale":"en_US","og_type":"article","og_title":"Arduino, LEDs that blinks to the Music! - Stigern.Net","og_description":"A music beat blinker made with an Arduino and a microphone sensor: it reads the analog value from the mic and blinks LEDs in time with the music.","og_url":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/","og_site_name":"Stigern.Net","article_published_time":"2011-12-17T08:24:59+00:00","article_modified_time":"2026-11-17T10:19:58+00:00","og_image":[{"url":"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg","type":"","width":"","height":""}],"author":"Stigern","twitter_misc":{"Written by":"Stigern","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#article","isPartOf":{"@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/"},"author":{"name":"Stigern","@id":"https:\/\/stigern.net\/blog\/#\/schema\/person\/a2a77157fa1facae3c843032fbc1ad3c"},"headline":"Arduino, LEDs that blinks to the Music!","datePublished":"2011-12-17T08:24:59+00:00","dateModified":"2026-11-17T10:19:58+00:00","mainEntityOfPage":{"@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/"},"wordCount":238,"commentCount":3,"publisher":{"@id":"https:\/\/stigern.net\/blog\/#\/schema\/person\/a2a77157fa1facae3c843032fbc1ad3c"},"image":{"@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#primaryimage"},"thumbnailUrl":"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg","keywords":["arduino","beat","blink","disco","guide","how","led","mic","sensor","sound","tutorial"],"articleSection":["Arduino","Electronics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/","url":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/","name":"Arduino, LEDs that blinks to the Music! - Stigern.Net","isPartOf":{"@id":"https:\/\/stigern.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#primaryimage"},"image":{"@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#primaryimage"},"thumbnailUrl":"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg","datePublished":"2011-12-17T08:24:59+00:00","dateModified":"2026-11-17T10:19:58+00:00","description":"A music beat blinker made with an Arduino and a microphone sensor: it reads the analog value from the mic and blinks LEDs in time with the music.","breadcrumb":{"@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#primaryimage","url":"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg","contentUrl":"http:\/\/stigern.net\/images\/2011\/arduinobeats.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/stigern.net\/blog\/arduino-leds-that-blinks-to-the-music\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/stigern.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Arduino, LEDs that blinks to the Music!"}]},{"@type":"WebSite","@id":"https:\/\/stigern.net\/blog\/#website","url":"https:\/\/stigern.net\/blog\/","name":"Stigern.Net","description":"my little blog","publisher":{"@id":"https:\/\/stigern.net\/blog\/#\/schema\/person\/a2a77157fa1facae3c843032fbc1ad3c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stigern.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/stigern.net\/blog\/#\/schema\/person\/a2a77157fa1facae3c843032fbc1ad3c","name":"Stigern","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g","caption":"Stigern"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/3aa89eb9119816e0e1d04b18203f0ad69ad76d42000fa3e3964838e093d03fb7?s=96&d=mm&r=g"},"sameAs":["http:\/\/www.stigern.net"],"url":"https:\/\/stigern.net\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/posts\/332","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/comments?post=332"}],"version-history":[{"count":14,"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/posts\/332\/revisions"}],"predecessor-version":[{"id":899,"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/posts\/332\/revisions\/899"}],"wp:attachment":[{"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/media?parent=332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/categories?post=332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stigern.net\/blog\/wp-json\/wp\/v2\/tags?post=332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}