{"id":103,"date":"2020-06-02T15:41:16","date_gmt":"2020-06-02T15:41:16","guid":{"rendered":"https:\/\/fletch.scot\/wp\/?p=103"},"modified":"2020-09-16T10:33:14","modified_gmt":"2020-09-16T10:33:14","slug":"50-hz-strobe","status":"publish","type":"post","link":"https:\/\/fletch.scot\/wp\/?p=103","title":{"rendered":"50 Hz strobe"},"content":{"rendered":"<p>Some of my friends were in a band \u2019The Valves\u2019 in the late 70s and more recently they have been playing the occasional (and excellent) gig here in Edinburgh. This year they brought out their first album \u2014 on vinyl. It\u2019s called \u2018Better Late \u2026\u2019. You can find all about them on Facebook: search for \u2018The Mighty Valves\u2019.\u00a0<\/p>\n<p>Now I was supposed to be getting copy of the album at mates\u2019 rates. But that involved meeting one of them which is not possible during COVID lockdown here on Scotland. But to prepare for its eagerly awaited arrival I thought I\u2019d better dust off my turntable. I had ripped all my albums to MP3 ages ago and rarely used it. I found that it only worked at 45 rpm. The cure was to spray switch cleaner at the 33\/45 rpm switch which was hidden inside \u2014 the switch that you press was pressing a plastic piece at right angles to the actual switch.\u00a0<\/p>\n<p>I though I might as well check it was still at the correct speed and remembered I had a strobe \u2018disc\u2019. It\u2019s actually a piece of paper from <a href=\"http:\/\/vinylengine.com\">vinylengine.com<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"IMG_1102.jpeg\" src=\"https:\/\/fletch.scot\/wp\/wp-content\/uploads\/2020\/09\/IMG_1102.jpeg\" alt=\"Stobe disc on turntable\" width=\"600\" height=\"450\" border=\"0\" \/><\/p>\n<p>The idea of the strobe disc is that the lines on the concentric circles will normally be blurred when the disc is spinning. When you shine a light strobing at 50 Hz the lines freeze and appear to be still if the disc is turning at 33 rpm. If the disc is spinning at some other speed the lines may look like they are spinning slowly backwards or forwards. I tried to take some videos of this working but they don\u2019t show properly presumably due to the frame rate of the camera.<\/p>\n<p>So how to get a 50 Hz light in these days without incandescent bulbs? Here\u2019s a quick program for an Arduino which toggles a digital output at 50 Hz. A white LED and a 330 ohm resistor in series to ground is the entire circuit. About as simple as it gets.<\/p>\n<pre>\/*<br \/>strobe LED at 50 Hz<br \/>*\/<br \/>int ledPin = 12;<br \/><br \/>\/\/ the setup function runs once when you press reset or power the board<br \/>void setup() {<br \/>pinMode(ledPin, OUTPUT);<br \/>}<br \/><br \/>\/\/ the loop function runs over and over again forever<br \/>void loop() {<br \/>int delayms = 20\/2; \/\/ 50 Hz has a period of 1\/50 seconds = 20 ms<br \/>delay(delayms);<br \/>digitalWrite(ledPin, HIGH);<br \/>delay(delayms);<br \/>digitalWrite(ledPin, LOW);<br \/>}<\/pre>\n<p>I compiled this for an Arduino DUE which I had to hand, though I imagine it would work fine on an UNO. The ledPin value may need changed though. I compiled it using <a href=\"https:\/\/github.com\/arduino\/arduino-cli\">Arduino-cli<\/a> with this incantation:<\/p>\n<pre>arduino-cli compile -b arduino:sam:arduino_due_x_dbg -p \/dev\/cu.usbmodem141101 -u<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" title=\"IMG_1104.jpeg\" src=\"https:\/\/fletch.scot\/wp\/wp-content\/uploads\/2020\/09\/IMG_1104.jpeg\" alt=\"Arduino with shield\" width=\"450\" height=\"600\" border=\"0\" \/><\/p>\n<p>That meant I didn\u2019t need to use the Arduino IDE and could use my code editor of choice (<a href=\"https:\/\/www.vim.org\">vim<\/a>). Arduino-cli works well \u2014 thanks to the developers! BTW the Arduino IDE is fine, I\u2019m just a terminal junkie. An oscilloscope confirmed the signal was at 50 Hz.<\/p>\n<p>The picture shows me using a prototype shield on top of the Arduino. The shield is not necessary but the reset switch is easier to get at with the shield so I used it.<\/p>\n<p>Did it work? Well\u2026 My turntable is a Pioneer PL-120 and the designers decided to make the speed control impossible to use while the turntable is spinning. See the yellow screwdriver which is at the speed control adjust screw in the picture of the strobe \u2018disc\u2019. So my fond dreams of shining the strobe at the disc and simultaneously adjusting the speed were dashed. I found it really difficult to do. Also it is summer here in Scotland and the weather has been good so the sun is in the sky nearly all of the time I am awake. So the LED could have been brighter to compete with the sun. It would work fine in winter or if I had better curtains.<\/p>\n<p>In the end I put on a record and counted how long 10 revolutions took and did the arithmetic. Adjusted the speed (did I tell you the screwdriver is difficult to align with the speed control slot?) And repeated until good. So I didn\u2019t actually use the strobe in the end.<\/p>\n<p>A final test: \u2018Oh! Wot A Dream\u2019 by Kevin Ayers is billed as taking 2m 47s and I timed it at about 2m 46s. That\u2019s good enough for rock and roll. Maybe someone with perfect pitch would howl in frustration \u2014 as am I waiting for the &#8216;Better Late\u2026\u2019 album.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some of my friends were in a band \u2019The Valves\u2019 in the late 70s and more recently they have been playing the occasional (and excellent) gig here in Edinburgh. This year they brought out their first album \u2014 on vinyl. It\u2019s called \u2018Better Late \u2026\u2019. You can find all about them on Facebook: search for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/fletch.scot\/wp\/?p=103\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;50 Hz strobe&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[3,4,5],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-programming","tag-electronics","tag-music","tag-programming"],"_links":{"self":[{"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":3,"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fletch.scot\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}