{"id":171,"date":"2015-05-10T00:23:15","date_gmt":"2015-05-10T00:23:15","guid":{"rendered":"http:\/\/projects.ravelox.com\/blog\/?p=171"},"modified":"2015-05-10T00:23:15","modified_gmt":"2015-05-10T00:23:15","slug":"cinderella-clock-project-part-2-the-electronics","status":"publish","type":"post","link":"https:\/\/www.raveloxprojects.com\/blog\/?p=171","title":{"rendered":"Cinderella Clock Project &#8211; Part 2 &#8211; The Electronics"},"content":{"rendered":"<p>With the clock face constructed, I turned my attention to seeing what I could do to get it moving.<\/p>\n<p>I knew it was going to have to be wirelessly-controlled because there was no way we would be able to run a control cable from a hanging beam to the side of the stage without complications.<\/p>\n<p>So I put a few ideas together. I knew that an Arduino-like controller would be simple to put together. I&#8217;d played around with building a Bareduino (\u00a0<a href=\"https:\/\/www.virtuabotix.com\/product\/bareduino-bare-minimum-16-mhz-arduino-kit\/\">https:\/\/www.virtuabotix.com\/product\/bareduino-bare-minimum-16-mhz-arduino-kit\/<\/a> ) and found it fun and, more importantly, inexpensive. I ended up buying the components in bulk on eBay. Now I&#8217;m hooked on getting electronics from China for a couple of dollars.<\/p>\n<p>The number of add-ons that are available for the Arduino market is impressive. I knew that it was possible to get wireless transceivers so I bought some nRF24L01+ transceivers from Amazon (http:\/\/www.amazon.com\/gp\/product\/B00E594ZX0). These have good Arduino library support. There are a couple of libraries on GitHub and I found that the maniacbug version worked for me (<a href=\"http:\/\/maniacbug.github.io\/RF24\/\">http:\/\/maniacbug.github.io\/RF24\/<\/a>). Also, I found his blog entry &#8220;Getting Started with nRF24L01+&#8221; really useful, particularly the pin connections from the ATmega328PU to the transceiver itself. The blog is at\u00a0<a href=\"http:\/\/maniacbug.wordpress.com\/2011\/11\/02\/getting-started-rf24\/\">http:\/\/maniacbug.wordpress.com\/2011\/11\/02\/getting-started-rf24\/<\/a>.<\/p>\n<p>I called my project a Nerduino due to the anticipated comments from my &#8220;friends&#8221;.<\/p>\n<p>Initially, I breadboarded the circuits to show that I could send and receive<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/j8SbDstDMNk?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>The wrinkle in building the circuit is that the transceiver is *powered* using 3.3v but the ATmega32PU is 5v-powered. This meant that I needed to build a voltage regulator to drop a 5v input down to 3.3v just to power it. That adds\u00a0a few more components.<\/p>\n<p>A LM317T is useful for building the regulator because it is adjustable based on the resistors that are used in the circuit. More information can be found at\u00a0<a href=\"http:\/\/www.reuk.co.uk\/Using-The-LM317T-To-Regulate-Voltage.htm\">http:\/\/www.reuk.co.uk\/Using-The-LM317T-To-Regulate-Voltage.htm<\/a>\u00a0but the schematic required to build a 5.5v to 3.3v regulator is:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/projects.ravelox.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3565.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-150\" src=\"https:\/\/i0.wp.com\/projects.ravelox.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3565-300x225.jpg?resize=300%2C225\" alt=\"IMG_3565\" width=\"300\" height=\"225\" srcset=\"https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3565.jpg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3565.jpg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3565.jpg?w=2000&amp;ssl=1 2000w, https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3565.jpg?w=3000&amp;ssl=1 3000w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>At the time I built the circuit, I didn&#8217;t have a 240 ohm resistor so I had to use a variable resistor instead but I managed to get the conversion to 3.3v<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/projects.ravelox.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3568.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-151\" src=\"https:\/\/i0.wp.com\/projects.ravelox.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3568-300x225.jpg?resize=300%2C225\" alt=\"IMG_3568\" width=\"300\" height=\"225\" srcset=\"https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3568.jpg?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3568.jpg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3568.jpg?w=2000&amp;ssl=1 2000w, https:\/\/i0.wp.com\/raveloxprojects.com\/blog\/wp-content\/uploads\/2015\/05\/IMG_3568.jpg?w=3000&amp;ssl=1 3000w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>I soldered together one Nerduino with the voltage regulator and tested again<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/v7x9bF3Ar_Y?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>After the successful test, I soldered another Nerduino and added a control panel<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/N7z9FIe2aAc?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>I added the servo output pins to one of the Nerduinos so that it became the receiver<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/IRoYOeA1Nv8?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>&nbsp;<\/p>\n<p>The servo motor was running fast and unless I added gearing to the clock hands themselves, I needed to add a speed control to the control panel and slow the motor down from there.<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/-_YUnCDJS3M?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>The circuits needed to be able to run independently of a wall power socket so I wired up a USB cable to act as a power cable from a phone charger battery that I got from work.<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/vTMkmLeuH1Q?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>Once the circuitry was working, I assembled it into the clock face with the help of a friend who was there to stop me from throwing the whole thing into the trash the moment we stumbled across minor issues.<\/p>\n<p>I made sure that the clock could be operated from the sound desk at the back of the theatre (i&#8217;m standing next to the camera operator).<\/p>\n<div class=\"jetpack-video-wrapper\"><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/3HCFfw46PNY?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/div>\n<p>For those interested, the Arduino sketches for the transmitter and receiver are at:<\/p>\n<p><a href=\"http:\/\/projects.ravelox.com\/files\/ClockTransmitter.ino\">http:\/\/projects.ravelox.com\/files\/ClockTransmitter.ino<\/a><\/p>\n<p><a href=\"http:\/\/projects.ravelox.com\/files\/ClockReceiver.ino\">http:\/\/projects.ravelox.com\/files\/ClockReceiver.ino<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p> With the clock face constructed, I turned my attention to seeing what I could do to get it moving. I knew it was going to have to be wirelessly-controlled because there was no way we would be able to run a control cable from a hanging beam to the side of the stage without complications. &#8230; <a class=\"read-more meta-nav\" href=\"https:\/\/www.raveloxprojects.com\/blog\/?p=171\">Read more &raquo;<\/a><\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[25,24,26],"tags":[],"class_list":["post-171","post","type-post","status-publish","format-standard","hentry","category-clock","category-hardware-2","category-nerduino"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8tHuw-2L","jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=171"}],"version-history":[{"count":3,"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions"}],"predecessor-version":[{"id":174,"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/171\/revisions\/174"}],"wp:attachment":[{"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.raveloxprojects.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}