{"id":75,"date":"2015-10-29T22:56:14","date_gmt":"2015-10-29T22:56:14","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=75"},"modified":"2020-10-12T16:20:33","modified_gmt":"2020-10-12T16:20:33","slug":"arduino-sound-activated-flash-or-camera-trigger","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=75","title":{"rendered":"ARDUINO sound activated flash or camera trigger"},"content":{"rendered":"<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/ft489g3ifcdf1hr_medium.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-77\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/ft489g3ifcdf1hr_medium.jpg?w=300\" alt=\"FT489G3IFCDF1HR_MEDIUM\" width=\"704\" height=\"469\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/ft489g3ifcdf1hr_medium.jpg 620w, https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/ft489g3ifcdf1hr_medium-300x200.jpg 300w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>This\u00a0tutorial will show you how to build a simple circuit to connect to a <a href=\"http:\/\/www.dx.com\/s\/arduino?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">ARDUINO<\/span><\/a> micro controller that will detect sound and trigger your camera or flash for high speed photography. This is easy to assemble and only cost a few $$$ for the parts&#8230;<\/p>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem.jpg\">\u00a0<\/a><\/p>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-83\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem.jpg?w=300\" alt=\"flash_triger_schem\" width=\"805\" height=\"314\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem.jpg 1995w, https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem-300x117.jpg 300w, https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem-768x300.jpg 768w, https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flash_triger_schem-1024x400.jpg 1024w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The picture above is the schematic for the circuit you will need to build&#8230; if you click on\u00a0the picture\u00a0it will enlarge so you can see it better&#8230;.<\/p>\n<p><strong>The parts you will need:<\/strong><\/p>\n<p>#affiliate links#<\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/resistors?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">220\u03a9 resistor X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/resistors?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">10K\u03a9 resistor X 2<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/resistors?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">100K\u03a9 resistor X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/resistor?category=410&amp;Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">1M\u03a9 resistor X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/capacitor?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">0.1\u00b5f capacitor X 2<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/diode?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">1N4001 (or allmost any diode will work) X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/transistor?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">MPS2222A ( or any similar transistor like 2N2222 will work) X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/p\/sharp-1-channel-4-pin-pc817-optocoupler-black-20-pcs-163822?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">optocoupler ( any 4 pin type should work, I used a Sharp PC817) X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/p\/jtron-2-pin-mini-electret-microphone-modules-silver-4-x-1-5mm-5-pcs-375924?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">Microphone X 1<\/span><\/a><\/p>\n<p><a href=\"http:\/\/www.dx.com\/s\/arduino?category=472&amp;Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">any ARDUINO board X 1<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flkvdnrifdsviq6_medium.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-79\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flkvdnrifdsviq6_medium.jpg?w=279\" alt=\"FLKVDNRIFDSVIQ6_MEDIUM\" width=\"584\" height=\"626\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flkvdnrifdsviq6_medium.jpg 422w, https:\/\/thezhut.com\/wp-content\/uploads\/2015\/10\/flkvdnrifdsviq6_medium-279x300.jpg 279w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>copy and paste the following code into your ARDUINO IDE&#8230;<\/p>\n<p>int flash = 9;\u00a0\u00a0 \/\/flash or camera trigger pin<br \/>\nint mic;<br \/>\nint lvl = 0;<br \/>\nint trig;<br \/>\nvoid setup() {<br \/>\npinMode(flash, OUTPUT);<br \/>\nSerial.begin(9600);<br \/>\n}<br \/>\nvoid loop() {<br \/>\nif (lvl == 0)<br \/>\n{<br \/>\nSerial.println(&#8220;What Sound Trigger LVL do you want? &#8220;);<br \/>\nlvl = 9000;\u00a0 \u00a0\/\/sets trigger lvl high so it wont trigger till you enter a value<br \/>\n}<br \/>\nif (Serial.available())<br \/>\n{<br \/>\nlvl = Serial.parseInt();<br \/>\nlvl = constrain(lvl, 25, 9000);\u00a0\u00a0 \/\/stops you from setting sound detection lvl to low and cause continuous<br \/>\nSerial.print(&#8220;Sound Trigger LVL is &#8220;);\u00a0\u00a0 \/\/triggering, you can change the 25 to a lower # but don&#8217;t go under 15<br \/>\nSerial.println(lvl);<br \/>\nSerial.println(&#8220;What Sound Trigger LVL do you want? &#8220;);<br \/>\ntrig = 0;<br \/>\n}<br \/>\nmic = analogRead(A0);<br \/>\nif (mic &gt;= lvl)<br \/>\n{<br \/>\ndigitalWrite(flash, HIGH);<br \/>\ndelay(1);<br \/>\ndigitalWrite(flash, LOW);<br \/>\ntrig = trig + 1;<br \/>\nSerial.print(&#8220;Flash has been Triggered &#8220;);<br \/>\nSerial.print(trig);<br \/>\nSerial.println(&#8221; Times!&#8221;);<br \/>\ndelay(1000);\u00a0\u00a0 \/\/delay so your camera or flash only triggers one time from a sound<br \/>\n}<br \/>\n}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>After you get the code loaded onto the arduino power it up then plug it into your flash or camera. It wont hurt the camera or flash to have it connected when you power up the arduino but it will trigger it one or two times when its first starting up&#8230;<\/p>\n<p>Next open up your serial monitor, you can use the one on your computer or if you have a android smart phone &amp; a <a href=\"http:\/\/www.dx.com\/p\/micro-5pin-to-usb-female-otg-data-cable-black-129671?Utm_rid=99156049&amp;Utm_source=affiliate\" rel=\"nofollow\"><span style=\"color: #0066cc;\">USB OTG cable<\/span><\/a> you can down load a free <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.mdeveloper.serialtool\" rel=\"nofollow\"><span style=\"color: #0066cc;\">serial monitor from the play store<\/span><\/a>.. Just follow the instructions on the serial monitor and your good to go, if you have any problems or questions\u00a0leave a comment on our Facebook Page and ill try to help you out&#8230;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; This\u00a0tutorial will show you how to build a simple circuit to connect to a ARDUINO micro controller that will detect sound and trigger your camera or flash for high speed photography. This is easy to assemble and only cost &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=75\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":10,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-75","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":1,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/75\/revisions"}],"predecessor-version":[{"id":1585,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/75\/revisions\/1585"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/10"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}