{"id":3103,"date":"2022-07-02T06:14:02","date_gmt":"2022-07-02T13:14:02","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3103"},"modified":"2022-07-02T06:14:02","modified_gmt":"2022-07-02T13:14:02","slug":"project-22-synthesizer-solderable-breadboard-large-mk04","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3103","title":{"rendered":"Project #22: Synthesizer &#8211; Solderable Breadboard &#8211; Large &#8211; Mk04"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3103-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Synthesizer #UltrasonicSynth #Arduino #ArduinoProMini #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02a.png\" alt=\"Solderable Breadboard\" width=\"720\" height=\"407\" class=\"alignnone size-full wp-image-3105\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02a-300x170.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\/2022\/07\/DL2206Mk02b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02b.png\" alt=\"Solderable Breadboard\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3106\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02b-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\/2022\/07\/DL2206Mk02c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02c.png\" alt=\"Solderable Breadboard\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3107\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2022\/07\/DL2206Mk02c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>SparkFun Solderable Breadboard &#8211; Large<\/strong><\/p>\n<p>This is the Large SparkFun Solderable Breadboard. A bare PCB that is the exact size as our full-size breadboard with the same connections to pins and power rails. This board is especially useful for preserving a prototype or experiment you just created on a solderless breadboard by soldering all the pieces in place. The large solderable breadboard also includes real estate for screw terminal connectors and a trace down the center gutter for ground.<\/p>\n<p><strong>DL2206Mk02<\/strong><\/p>\n<p>1 x Arduino Pro Mini 328 &#8211; 5V\/16MHz<br \/>\n2 x HC-SR04 Ultrasonic Sensor<br \/>\n1 x 1M Ohm Potentiometer<br \/>\n1 x Knob<br \/>\n1 x Audio Jack 3.5mm<br \/>\n1 x SparkFun Audio Jack Breakout<br \/>\n1 x SparkFun USB Mini-B Breakout<br \/>\n1 x SPDT Slide Switch<br \/>\n1 x JST Jumper 2 Wire Connector<br \/>\n1 x JST Jumper 3 Wire Connector<br \/>\n1 x Insignia Speakers<br \/>\n1 x SparkFun Solderable Breadboard &#8211; Large<br \/>\n1 x SparkFun FTDI Basic Breakout &#8211; 5V<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Arduino Pro Mini 328 &#8211; 5V\/16MHz<\/strong><\/p>\n<p>Ech &#8211; Digital 13<br \/>\nTri &#8211; Digital 12<br \/>\nEcR &#8211; Digital 11<br \/>\nTrR &#8211; Digital 10<br \/>\nSPK &#8211; Digital 9<br \/>\nCAP &#8211; Analog A0<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2206Mk02p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #22: Synthesizer - Solderable Breadboard - Large - Mk04\r\n22-04\r\nDL2206Mk02p.ino\r\n1 x Arduino Pro Mini 328 - 5V\/16MHz\r\n2 x HC-SR04 Ultrasonic Sensor\r\n1 x 1M Ohm Potentiometer\r\n1 x Knob\r\n1 x Audio Jack 3.5mm\r\n1 x SparkFun Audio Jack Breakout\r\n1 x SparkFun USB Mini-B Breakout\r\n1 x SPDT Slide Switch\r\n1 x JST Jumper 2 Wire Connector\r\n1 x JST Jumper 3 Wire Connector\r\n1 x Insignia Speakers\r\n1 x SparkFun Solderable Breadboard - Large\r\n1 x SparkFun FTDI Basic Breakout - 5V\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Mozzi\r\n#include &lt;MozziGuts.h&gt;\r\n\/\/ Oscillator\r\n#include &lt;Oscil.h&gt;\r\n\/\/ Table for Oscils to play\r\n#include &lt;tables\/cos2048_int8.h&gt;\r\n\/\/ Smoothing Control\r\n#include &lt;Smooth.h&gt;\r\n\/\/ Maps unpredictable inputs to a range\r\n#include &lt;AutoMap.h&gt;\r\n\r\n\/\/ Desired carrier frequency max and min, for AutoMap\r\nconst int MIN_CARRIER_FREQ = 22;\r\nconst int MAX_CARRIER_FREQ = 440;\r\n\r\n\/\/ Desired intensity max and min, for AutoMap, note they&#039;re inverted for reverse dynamics\r\nconst int MIN_INTENSITY = 700;\r\nconst int MAX_INTENSITY = 10;\r\n\r\n\/\/ Desired mod speed max and min, for AutoMap, note they&#039;re inverted for reverse dynamics\r\nconst int MIN_MOD_SPEED = 10000;\r\nconst int MAX_MOD_SPEED = 1;\r\n\r\n\/\/ Maps unpredictable inputs to a range\r\nAutoMap kMapCarrierFreq(0,1023,MIN_CARRIER_FREQ,MAX_CARRIER_FREQ);\r\nAutoMap kMapIntensity(0,1023,MIN_INTENSITY,MAX_INTENSITY);\r\nAutoMap kMapModSpeed(0,1023,MIN_MOD_SPEED,MAX_MOD_SPEED);\r\n\r\n\/\/ Set the input for the knob to analog pin 0\r\nconst int KNOB_PIN = A0;\r\n\/\/ Set the analog input for fm_intensity\r\nint LDR1_PIN;\r\n\/\/ Set the analog input for mod rate\r\nint LDR2_PIN;\r\n\r\n\/\/ Table for Oscils to play\r\nOscil&lt;COS2048_NUM_CELLS, AUDIO_RATE&gt; aCarrier(COS2048_DATA);\r\nOscil&lt;COS2048_NUM_CELLS, AUDIO_RATE&gt; aModulator(COS2048_DATA);\r\nOscil&lt;COS2048_NUM_CELLS, CONTROL_RATE&gt; kIntensityMod(COS2048_DATA);\r\n\r\n\/\/ Brightness (harmonics)\r\nint mod_ratio = 5;\r\n\/\/ Carries control info from updateControl to updateAudio\r\nlong fm_intensity;\r\n\r\n\/\/ Smoothing for intensity to remove clicks on transitions\r\nfloat smoothness = 0.95f;\r\nSmooth &lt;long&gt; aSmoothIntensity(smoothness);\r\n\r\n\/\/ Trigger pin 12 to pitch distance sensor\r\nconst int iTrigPitch = 12;\r\n\/\/ Echo Receive pin 13 to pitch distance sensor\r\nconst int iEchoPitch = 13;\r\n\/\/ Define the useable range of the pitch sensor\r\nconst int pitchLowThreshold = 45;\r\nconst int pitchHighThreshold = 2;    \r\n\/\/ Stores the distance measured by the distance sensor\r\nfloat distance = 0;\r\n\/\/ Trigger pin 10 to rate distance sensor\r\nconst int iTrigRate = 10;\r\n\/\/ Echo Receive pin 13 to pitch distance sensor\r\nconst int iEchoRate = 11;\r\n\/\/ Define the useable range of the pitch sensor\r\nconst int rateLowThreshold = 45;\r\nconst int rateHighThreshold = 2;    \r\n\/\/ Stores the distance measured by the distance sensor\r\nfloat rate = 0;\r\n\r\n\/\/ Mini Speaker\r\nint SPK = 9;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;22-04&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Audio Hook\r\n  audioHook();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getHC-SR04.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ HC-SR04 Ultrasonic Sensor\r\n\/\/ Setup HC-SR04\r\nvoid setupHCSR04() {\r\n\r\n  \/\/ The trigger iTrig Pitch will output pulses of electricity\r\n  pinMode(iTrigPitch, OUTPUT);\r\n  \/\/ The echo iEcho will measure the duration of pulses coming back from the distance sensor\r\n  pinMode(iEchoPitch, INPUT);\r\n\r\n  \/\/ The trigger iTrig Rate will output pulses of electricity\r\n  pinMode(iTrigRate, OUTPUT);\r\n  \/\/ The echo iEcho will measure the duration of pulses coming back from the distance sensor\r\n  pinMode(iEchoRate, INPUT);\r\n  \r\n}\r\n\/\/ Distance\r\nfloat isDistance() {\r\n  \r\n  \/\/ Variable to store the time it takes for a ping to bounce off an object\r\n  float echoTime;\r\n  \/\/ Variable to store the distance calculated from the echo time\r\n  float calculatedDistance;\r\n\r\n  \/\/ Send out an ultrasonic pulse that&#039;s 10ms long\r\n  digitalWrite(iTrigPitch, HIGH);\r\n  delayMicroseconds(10);\r\n  digitalWrite(iTrigPitch, LOW);\r\n\r\n  \/\/ Use the pulseIn command to see how long it takes for the\r\n  \/\/ pulse to bounce back to the sensor\r\n  echoTime = pulseIn(iEchoPitch, HIGH);\r\n\r\n  \/\/ Calculate the distance of the object that reflected the pulse\r\n  \/\/ (half the bounce time multiplied by the speed of sound)\r\n  calculatedDistance = echoTime * 0.034 \/ 2;\r\n\r\n  \/\/ Send back the distance that was calculated\r\n  return calculatedDistance;\r\n  \r\n}\r\n\/\/ Rate\r\nfloat isRate() {\r\n  \r\n  \/\/ Variable to store the time it takes for a ping to bounce off an object\r\n  float echoTime;\r\n  \/\/ Variable to store the distance calculated from the echo time\r\n  float calculatedDistance;\r\n\r\n  \/\/ Send out an ultrasonic pulse that&#039;s 10ms long\r\n  digitalWrite(iTrigRate, HIGH);\r\n  delayMicroseconds(10);\r\n  digitalWrite(iTrigRate, LOW);\r\n\r\n  \/\/ Use the pulseIn command to see how long it takes for the\r\n  \/\/ pulse to bounce back to the sensor\r\n  echoTime = pulseIn(iEchoRate, HIGH);\r\n\r\n  \/\/ Calculate the distance of the object that reflected the pulse\r\n  \/\/ (half the bounce time multiplied by the speed of sound)\r\n  \/\/ cm = 58.0\r\n  calculatedDistance = echoTime * 0.034 \/ 2;\r\n\r\n  \/\/ Send back the distance that was calculated\r\n  return calculatedDistance;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getMozzi.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Mozzi\r\n\/\/ Update Control\r\nvoid updateControl(){\r\n\r\n  \/\/ Variable to store the distance measured by the sensor\r\n  distance = isDistance();\r\n  \/\/ Low Threshold\r\n  if ( distance &gt;= pitchLowThreshold) {\r\n\r\n    \/\/ pitchLowThreshold\r\n    distance = pitchLowThreshold;\r\n    \r\n  }\r\n  \/\/ High Threshold\r\n  if ( distance &lt; pitchHighThreshold){\r\n    \r\n    \/\/ pitchHighThreshold\r\n    distance = pitchHighThreshold;\r\n    \r\n  }\r\n\r\n  \/\/ Variable to store the distance measured by the sensor\r\n  rate = isRate();\r\n  \/\/ Low Threshold\r\n  if ( rate &gt;= rateLowThreshold) {\r\n\r\n    \/\/ rateLowThreshold\r\n    rate = rateLowThreshold;\r\n    \r\n  }\r\n  \/\/ High Threshold\r\n  if ( rate &lt; rateHighThreshold){\r\n    \r\n    \/\/ rateHighThreshold\r\n    rate = rateHighThreshold;\r\n    \r\n  }\r\n\r\n  \/\/ Read the knob\r\n  \/\/ Value is 0-1023\r\n  int knob_value = mozziAnalogRead(KNOB_PIN);\r\n\r\n  \/\/ Map the knob to carrier frequency\r\n  int carrier_freq = kMapCarrierFreq(knob_value);\r\n\r\n  \/\/ Calculate the modulation frequency to stay in ratio\r\n  int mod_freq = carrier_freq * mod_ratio;\r\n\r\n  \/\/ Set the FM oscillator frequencies\r\n  aCarrier.setFreq(carrier_freq);\r\n  aModulator.setFreq(mod_freq);\r\n\r\n  \/\/ Read the light dependent resistor on the width\r\n  LDR1_PIN = distance;\r\n  int LDR1_value = LDR1_PIN;\r\n\r\n  int LDR1_calibrated = kMapIntensity(LDR1_value);\r\n\r\n  \/\/ Calculate the fm_intensity\r\n  \/\/ Shift back to range after 8 bit multiply\r\n  fm_intensity = ((long)LDR1_calibrated * (kIntensityMod.next()+128))&gt;&gt;8;\r\n  \r\n  \/\/ Read the light dependent resistor on the speed\r\n  LDR2_PIN = rate;\r\n  int LDR2_value= LDR2_PIN;\r\n\r\n  \/\/ Use a float here for low frequencies\r\n  float mod_speed = (float)kMapModSpeed(LDR2_value)\/1000;\r\n\r\n  kIntensityMod.setFreq(mod_speed);\r\n  \r\n}\r\n\/\/ Update Audio\r\nint updateAudio()\r\n{\r\n\r\n  \/\/ Update Audio\r\n  long modulation = aSmoothIntensity.next(fm_intensity) * aModulator.next();\r\n  return aCarrier.phMod(modulation);\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ Setup HC-SR04\r\n  setupHCSR04();\r\n\r\n  \/\/ Delay\r\n  delay( 200 );\r\n\r\n  \/\/ Mozzi Start\r\n  startMozzi();\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\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&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor and E-Mentor<\/strong><\/p>\n<ul>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>J. Luc Paquin \u2013 Curriculum Vitae &#8211; 2022 English &#038; Espa\u00f1ol<\/strong><br \/>\nhttps:\/\/www.jlpconsultants.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<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; #DonLucElectronics #DonLuc #Synthesizer #UltrasonicSynth #Arduino #ArduinoProMini #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; SparkFun Solderable Breadboard &#8211; Large This is the Large SparkFun Solderable Breadboard. A bare PCB that is the exact size as our full-size breadboard with the same connections to pins and power rails. This board is especially useful &#8230; <a title=\"Project #22: Synthesizer &#8211; Solderable Breadboard &#8211; Large &#8211; Mk04\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3103\" aria-label=\"Read more about Project #22: Synthesizer &#8211; Solderable Breadboard &#8211; Large &#8211; Mk04\">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":[205,50,49,38,59,5,7,58,10,43,51],"tags":[6,102,4,19,85,24,25,9,27,222,109,8,127,34],"class_list":["post-3103","post","type-post","status-publish","format-standard","hentry","category-synthesizer","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-musical-instruments","category-arduino-programming","category-projects","category-sparkfun","category-synth","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-musical-instruments-2","tag-programming","tag-projects-2","tag-solderable-breadboard","tag-sparkfun","tag-synth","tag-synthesizer","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3103","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=3103"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3103\/revisions"}],"predecessor-version":[{"id":4176,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3103\/revisions\/4176"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}