{"id":160,"date":"2024-04-06T09:49:40","date_gmt":"2024-04-06T14:49:40","guid":{"rendered":"https:\/\/minnesotafriends.org\/blog\/?p=160"},"modified":"2024-04-06T09:49:41","modified_gmt":"2024-04-06T14:49:41","slug":"my-first-arduino-adventure","status":"publish","type":"post","link":"https:\/\/minnesotafriends.org\/blog\/2024\/04\/06\/my-first-arduino-adventure\/","title":{"rendered":"My First Arduino Adventure"},"content":{"rendered":"\n<p>Arduino is an embedded microcomputer that started out as an educational tool. It has been around for years and I originally wrote it off as not much more than a toy. That was probably a fair assessment in its early days. But it has grown a lot over time and you can now get some pretty powerful little computers in the Arduino form factor, along with lots of different options for interfaces to motors, sensors, servos, graphic displays, and so forth.<\/p>\n\n\n\n<p>There is a growing community of people using Arduino for model railroading. If you are on Facebook, check out the \u201cArduino for Model Railroading\u201d group. You will see some pretty advanced projects going on. There is even a community project working on creating a handheld controller with graphic touch screen for running the layout.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"785\" src=\"https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-1-1024x785.jpg\" alt=\"\" class=\"wp-image-161\" srcset=\"https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-1-1024x785.jpg 1024w, https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-1-300x230.jpg 300w, https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-1-768x589.jpg 768w, https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-1.jpg 1101w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I work with embedded computers all day, every day, professionally. Thus, when I\u2019m off work, to \u201cplay\u201d with a computer in my \u201cfree\u201d time is not high on my list. I prefer to just buy a controller to run my trains and spend my time doing other things I enjoy like scratch building diorama. Nevertheless, I found cause to join the Arduino community. If the off-the-shelf controller doesn\u2019t do exactly what you want, you just live with it. If your Arduino doesn\u2019t do what you want, you tweak the code and make it do what you want.<\/p>\n\n\n\n<p>Both the Jackson Street Roundhouse and Twin City Model Railroad Museum have a G scale layout that is interactive \u2013 meaning visitors can push a button to start the train. The problem at both museums is that the train starts off at full power since they are not DCC, and there is only a button for the visitor. There is no dial to turn speed up slowly. The sudden start is hard on G scale equipment. But you can\u2019t get DCC to respond to a simple single button. DCC always involves a controller, some more complex than others, and even experienced modelers sometimes fight with these controllers. Expecting totally inexperienced museum visitors to deal with DCC would be unreasonable. So the museum staff does the best they can \u2013 preset speed on the power pack, and put a switch or button in series with track power to turn the train on.<\/p>\n\n\n\n<p>I personally have no interest spending my time on creating my own train controller with Arduino if all I would be doing is reinventing the DCC wheel. But that part about making it do what you want comes into play here. I have created an Arduino based controller to solve the museum interactive control problem.<\/p>\n\n\n\n<p>I have put together the Arduino board stack, and finished programming it and testing it on the bench. I am now working on putting it into a finished control panel to install at the museum. The first system is going to be installed at the Jackson Street Roundhouse, followed by a second system at the Twin City Model Railroad Museum.<\/p>\n\n\n\n<p>Here is how it works: When a visitor pushes the start button, the controller ramps speed up gradually to a preset maximum speed. The train will make a predetermined number of loops, then come to a gradual stop at its original starting point. The only minor adjustment to the locomotive is that it will need a small magnet attached to its underside. There will be magnetic sensors embedded in the track. One will detect whether the train has started, and the other will detect when the train has returned to the home position. If the train fails to get moving, or fails to return home, the controller will go into fault mode. In fault mode, the track power will be shut down (assuming the possibility of a derailment), and a status light will flash calling for attention. There will be a \u201creset\u201d button accessible to staff to get the controller back in sync, and track power live, once the fault has been addressed \u2013 like maybe put the train back on the track.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-2-1024x768.jpg\" alt=\"\" class=\"wp-image-162\" srcset=\"https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-2-1024x768.jpg 1024w, https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-2-300x225.jpg 300w, https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-2-768x576.jpg 768w, https:\/\/minnesotafriends.org\/blog\/wp-content\/uploads\/2024\/04\/Arduino-2.jpg 1101w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><br><p class=\"MsoNormal\">In addition to the Arduino processor board, there is a motor<br>control board capable of handling 18 volts at 20 amps, a relay board used to<br>turn on status indicators, and a terminal board for connecting sensors and<br>switches.<\/p><p class=\"MsoNormal\">Once I started having too much fun with Arduino, I found a<br>couple more uses for an Arduino, too. I\u2019m just getting started on a G scale<br>Christmas train for the Twin City Model Railroad Museum. I plan to have it<br>rolling by Christmas 2024. In this instance, I am using Arduino to animate some<br>of the lighting. <\/p><p class=\"MsoNormal\">I should add one other comment about why Arduino is popular.<br>The processor board running the track controller described above is a $20 item.<br>Getting into Arduino is not going to cost you a fortune. However, you will need<br>to learn a little computer programming. Arduino does an pretty impressive job<br>of making that as easy as possible with lots of documentation, lots of<br>examples, and a helpful community of users. <\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arduino is an embedded microcomputer that started out as an educational tool. It has been around for years and I originally wrote it off as not much more than a&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-museums"],"_links":{"self":[{"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":1,"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minnesotafriends.org\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}