{"id":2575,"date":"2021-01-26T08:08:58","date_gmt":"2021-01-26T16:08:58","guid":{"rendered":"http:\/\/www.donluc.com\/?p=2575"},"modified":"2021-01-26T08:08:58","modified_gmt":"2021-01-26T16:08:58","slug":"project-16-sound-microphone-sparkfun-sound-detector-mk15","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2575","title":{"rendered":"Project #16: Sound &#8211; Microphone SparkFun Sound Detector &#8211; Mk15"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2575-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#donluc #microphone #sound #arduino #fritzing #sparkfun #project #programming #software #electronics #microcontrollers #consultant #vlog<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03a.png\" alt=\"SparkFun Sound Detector\" width=\"720\" height=\"447\" class=\"alignnone size-full wp-image-2577\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03a-300x186.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03b.png\" alt=\"SparkFun Sound Detector\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2578\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03c.png\" alt=\"SparkFun Sound Detector\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2579\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03d.png\" alt=\"SparkFun Sound Detector\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2581\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/01\/DL2101Mk03d-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Microphone<\/strong><\/p>\n<p>A microphone is a device a transducer that converts sound into an electrical signal. Microphones are used in many applications. They are also used in computers for recording voice, speech recognition, VoIP, and for non-acoustic purposes such as ultrasonic sensors or knock sensors.<\/p>\n<p>Electret microphone is a type of electrostatic capacitor-based microphone, which eliminates the need for a polarizing power supply by using a permanently charged material. Unlike other condenser microphones, electret types require no polarizing voltage, but they normally contain an integrated preamplifier, which does require a small amount of power. <\/p>\n<p><strong>SparkFun Sound Detector<\/strong><\/p>\n<p><strong>SparkFun Item:<\/strong> SEN-12642<\/p>\n<p>The SparkFun Sound Detector is a small and very easy to use audio sensing board with three different outputs. The Sound Detector not only provides an audio output, but also a binary indication of the presence of sound, and an analog representation of its amplitude. The 3 outputs are simultaneous and independent, so you can use as many or as few as you want at once.<\/p>\n<p>The envelope output allows you to easily read amplitude of sound by simply measuring the analog voltage. Gain can be adjusted with a through-hole resistor, to change the threshold of the binary output pin as well.<\/p>\n<p><strong>DL2101Mk03<\/strong><\/p>\n<p>1 x SparkFun RedBoard Qwiic<br \/>\n1 x SparkFun Sound Detector<br \/>\n3 x Jumper Wires 6in M\/M<br \/>\n1 x Half-Size Breadboard<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>SparkFun RedBoard Qwiic<\/strong><\/p>\n<p>MIC &#8211; Analog A0<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2101Mk03p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"asm\">\r\n\/\/ ***** Don Luc Electronics \u00a9 *****\r\n\/\/ Software Version Information\r\n\/\/ Project #16: Sound - SparkFun Sound Detector - Mk15\r\n\/\/ 01-03\r\n\/\/ DL2101Mk03p.ino 16-15\r\n\/\/ DL2101Mk03\r\n\/\/ 1 x SparkFun RedBoard Qwiic\r\n\/\/ 1 x SparkFun Sound Detector\r\n\/\/ 3 x Jumper Wires 6in M\/M\r\n\/\/ 1 x Half-Size Breadboard\r\n\/\/ 1 x SparkFun Cerberus USB Cable\r\n\r\n\/\/ Include the Library Code\r\n\r\n\/\/ Microphone\r\nunsigned int iMic = A0;\r\n\/\/ Sample window width in mS\r\nconst int sampleWindow = 250;\r\n\/\/ Volume\r\nunsigned int iVol;\r\n\/\/ Peak-to-peak level\r\nunsigned int peakToPeak = 0;\r\n\/\/ Max - Min\r\nunsigned int signalMax = 0;\r\nunsigned int signalMin = 1024;\r\n\/\/ Convert to volts\r\ndouble volts = 0;\r\n\r\n\/\/ Software Version Information\r\nString sver = \"16-15\";\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Microphone\r\n  isMic();\r\n\r\n}\r\n<\/pre>\n<p><strong>getMic.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"asm\">\r\n\/\/ getMic\r\n\/\/ is Microphone\r\nvoid isMic() {\r\n\r\n  \/\/ Start of sample window\r\n  unsigned long start = millis();\r\n  \r\n  \/\/ Peak-to-peak level\r\n  peakToPeak = 0;\r\n\r\n  \/\/ Max - Min\r\n  signalMax = 0;\r\n  signalMin = 1024;\r\n\r\n  \/\/ Collect data for 250 miliseconds\r\n  while ( millis() - start < sampleWindow )\r\n  {\r\n    \r\n    iVol = analogRead( iMic );\r\n    \r\n    \/\/ This is the max of the 10-bit ADC so this loop will include all readings\r\n    if (iVol < 1024)  \r\n      {\r\n         if (iVol > signalMax)\r\n         {\r\n           \r\n           \/\/ Save just the max levels\r\n           signalMax = iVol;\r\n           \r\n         }\r\n      else if (iVol < signalMin)\r\n        {\r\n          \r\n          \/\/ Save just the min levels\r\n          signalMin = iVol;\r\n          \r\n         }\r\n     }\r\n  }\r\n\r\n  \/\/ Max - Min = peak-peak amplitude\r\n  peakToPeak = signalMax - signalMin;\r\n  \r\n  \/\/ Convert to volts\r\n  volts = ( peakToPeak * 3.3 ) \/ 1024;\r\n\r\n  \/\/ Serial\r\n  Serial.println( volts );\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"asm\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ Setup Serial\r\n  Serial.begin (9600);\r\n\r\n}\r\n<\/pre>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc...)<\/li>\n<li>Robotics<\/li>\n<li>Research & Development (R & D)<\/li>\n<li>Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc...)<\/li>\n<li>Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc...)<\/li>\n<li>Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc...)<\/li>\n<li>Social Media Programming & Integration (Facebook, Twitter, YouTube, Pinterest, etc...)<\/li>\n<li>Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc...)<\/li>\n<li>Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc...)<\/li>\n<li>eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc...)<\/li>\n<\/ul>\n<p><strong>Instructor<\/strong><\/p>\n<ul>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<li>DOS, Windows, OSX, Linux, iOS, Android, Multi-OS<\/li>\n<li>Linux-Apache-PHP-MySQL<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>J. Luc Paquin \u2013 Curriculum Vitae<\/strong><br \/>\nhttps:\/\/www.donluc.com\/DLE\/LucPaquinCVEngMk2021a.pdf<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> http:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.donluc.com\/DLE\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.donluc.com\/DLHackster\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.hackster.io\/neosteam-labs<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #donluc #microphone #sound #arduino #fritzing #sparkfun #project #programming #software #electronics #microcontrollers #consultant #vlog &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Microphone A microphone is a device a transducer that converts sound into an electrical signal. Microphones are used in many applications. They are also used in computers for recording voice, speech recognition, VoIP, and for non-acoustic &#8230; <a title=\"Project #16: Sound &#8211; Microphone SparkFun Sound Detector &#8211; Mk15\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2575\" aria-label=\"Read more about Project #16: Sound &#8211; Microphone SparkFun Sound Detector &#8211; Mk15\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119,50,38,59,5,58,10,43],"tags":[6,102,4,19,85,24,9,27,120,109,33,34,108],"class_list":["post-2575","post","type-post","status-publish","format-standard","hentry","category-sound","category-arduino","category-digitalelectronics","category-fritzing","category-microcontrollers","category-arduino-programming","category-projects","category-sparkfun","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-programming","tag-projects-2","tag-sound","tag-sparkfun","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2575"}],"version-history":[{"count":7,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2575\/revisions"}],"predecessor-version":[{"id":3638,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2575\/revisions\/3638"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}