{"id":31309,"date":"2024-02-02T22:59:09","date_gmt":"2024-02-02T22:59:09","guid":{"rendered":"https:\/\/www.pinballnews.com\/site\/?p=31309"},"modified":"2024-02-02T23:24:20","modified_gmt":"2024-02-02T23:24:20","slug":"pinball-ball-detector-part-one","status":"publish","type":"post","link":"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-part-one\/","title":{"rendered":"PINBALL BALL DETECTOR &#8211; PART ONE"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline;\">Introduction<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pinball add-ons, mods and toppers are increasingly popular ways to customise your machine, enhancing their appearance or adding features not included by the manufacturer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While static add-ons can sometimes work perfectly well, creating something which interacts with the gameplay takes things to a whole new level.  If, for example, you have an animated toy or additional lighting, how much better would it be if it only activated when the ball is shot into a particular location as opposed to being constantly switched on?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Manufacturers generally don&#8217;t want you attaching unofficial mods to their machines and don&#8217;t provide an easy way for you to determine the current state of the game, such as when the ball is locked or whether a specific switch has been triggered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To work out this information and react to it, we need to build our own detection and control system.  It sounds complicated, but it doesn&#8217;t need to be.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It could be as simple as an additional rollover switch connected to turn on power of the add-on, but these switches are often only activated momentarily as a ball passes over them.  Plus, how much better would it be if you could programmatically control one or more add-ons based on the detection of that ball? You could then determine how long an add-on is activated, toggle its state each time the ball is detected, switch on and off multiple add-ons together or in a sequence, and much more.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Creating this kind of interactivity was once a bulky, complicated and costly process, but the availability of cheap, small and modular microcontrollers has changed all that.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Todd Andersen has written previous Pinball News articles describing how to use Arduino Nano clone microcontroller boards along with assorted modules to control various add-ons.  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are many different types of microcontrollers available and just as many different modules which plug in and either sense certain conditions (lights being lit, sounds being made, objects in proximity, etc.) or drive particular devices (light an LED, play a tune, switch on a motor, etc.).  These microcontrollers typically only cost a couple of dollars, with the modules often available for under a dollar each.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In his latest articles, Todd firstly describes how to build a simple ball detector using a microcontroller which can activate your chosen add-on, and then shows how that microcontroller can be easily programmed to reliably detect one or more fast-moving balls and active your add-on for as long as you want.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this example he&#8217;ll initially be using an Arduino UNO microcontroller, although UNO clone boards or other types of microcontroller can be used instead and he will <a href=\"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-alternative-microcontrollers\/\" data-type=\"link\" data-id=\"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-alternative-microcontrollers\/\" target=\"_blank\" rel=\"noreferrer noopener\">describe some of those<\/a> too.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"1024\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector-747x1024.jpg\" alt=\"The Arduino Uno microcontroller board\" class=\"wp-image-31341\" style=\"width:550px\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector-747x1024.jpg 747w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector-219x300.jpg 219w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector-768x1052.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector-850x1165.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/014-pinball-ball-detector.jpg 900w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/a><figcaption class=\"wp-element-caption\">The Arduino UNO microcontroller board<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Over to Todd.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">I received two bits of feedback concerning the previous Pinball News two-part article (<a href=\"https:\/\/www.pinballnews.com\/site\/2022\/12\/24\/pinball-add-on-controller-part-one\/\" data-type=\"link\" data-id=\"https:\/\/www.pinballnews.com\/site\/2022\/12\/24\/pinball-add-on-controller-part-one\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pinball Add-On Controller: Part One<\/a> and <a href=\"https:\/\/www.pinballnews.com\/site\/2022\/12\/24\/pinball-add-on-controller-part-two\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pinball Add-On Controller: Part Two<\/a>). The first person who gave feedback remarked, \u201cLiked your articles&#8230; didn\u2019t understand a word\u201d while the second just stated, \u201cBit much\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I hope to rectify my technical overdose with a little simpler and more direct pair of articles. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As before, the first half will concentrate on the hardware while the <a href=\"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-part-two\/\" data-type=\"link\" data-id=\"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-part-two\/\" target=\"_blank\" rel=\"noreferrer noopener\">second half<\/a> will explain how to write the software.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So, let&#8217;s get started with hardware. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This itself will be split into two parts: <strong><a href=\"#input\" data-type=\"internal\" data-id=\"#input\">Input<\/a><\/strong> and <strong><a href=\"#output\">Output<\/a><\/strong>. Then, two more sections are included: <strong><a href=\"#input-tied-to-output\">Input Tied To Output<\/a><\/strong> and <strong><a href=\"#installation\">Installation<\/a><\/strong>. Lastly, a <strong><a href=\"#hints-n-tips\">Hints-n-Tips<\/a><\/strong> section will close out this Hardware article.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"input\"><strong><span style=\"text-decoration: underline;\">Input<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will be using easily-available and affordable infrared (IR)&nbsp;modules for sensing the presence of a pinball.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">IR modules use a pair of infrared light senders and receivers. These modules are chosen because they work on the principle of reflectivity to detect an object &#8211; bouncing the sender&#8217;s IR light beam off the object and then picking it up with the receiver. This makes them work well for sensing the presence of a shinny silver ball. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will be looking at two types of IR modules here &#8211; horizontal and vertical orientation &#8211; named according to the direction of the IR sender and receiver.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s an example of a horizontally-orientated IR module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-1024x341.jpg\" alt=\"Front view of the horizontally-orientated module\" class=\"wp-image-31316\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-1024x341.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-300x100.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-768x256.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-1536x512.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-850x283.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Front view of the horizontally-orientated module<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s a vertically-orientated module.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"584\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-1024x584.jpg\" alt=\"Bottom and top views of vertically-orientated module\" class=\"wp-image-31317\" style=\"width:840px;height:auto\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-1024x584.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-300x171.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-768x438.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-1536x876.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-850x485.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector-384x220.jpg 384w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/002-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Bottom and top views of vertically-orientated module<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Notice the lack of a blue sensitivity potentiometer adjuster on this vertically-orientated module.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The main difference between the two types of IR module is the orientation of the <a href=\"https:\/\/www.pinballnews.com\/site\/2022\/10\/16\/new-ir-pinball-testers-part-one\/\" target=\"_blank\" rel=\"noreferrer noopener\">IR sender\/receiver pair<\/a>. The pair are located on the right-hand end of the top side on the vertically-orientated module and are quite similar to what was used in another older previous <a href=\"https:\/\/www.pinballnews.com\/learn\/irtester.html\" data-type=\"link\" data-id=\"https:\/\/www.pinballnews.com\/learn\/irtester.html\" target=\"_blank\" rel=\"noreferrer noopener\">Pinball News article<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not all IR modules are quite alike. There is one variation with four pins instead of the three shown above. The extra pin is labelled &#8216;AO&#8217;, but it can simply be ignored for our purposes.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"568\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector-1024x568.jpg\" alt=\"A four pin IR module\" class=\"wp-image-31318\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector-1024x568.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector-300x167.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector-768x426.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector-1536x852.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector-850x472.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/003-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A four pin IR module<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Speaking of other versions, the connection pins may be labelled differently depending upon the module&#8217;s manufacturer.  Here are some possible other labels you might find:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">GND <strong>(ground)<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\">IN <strong>(input)<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\">OUT <strong>(output)<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\">VCC <strong>(power)<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Bat &#8211;<br>Batt &#8211;<br>DC &#8211;<br>G<br>GD<br>-V<br>Vs<br>Vss<\/strong><br><br><br><br><br><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>DIN<br>S<br>Sig<\/strong><br><br><br><br><br><br><br><br><br><br><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>DO<\/strong><br>(capital &#8216;D&#8217; and &#8216;O&#8217;)<br><strong>DOUT<br>S<br>Sig<\/strong><br><br><br><br><br><br><br><br><\/td><td class=\"has-text-align-center\" data-align=\"center\"><strong>5V<\/strong> <br>(or other voltage)<br><strong>B+<br>Bat +<br>Batt +<br>DC +<br>P<br>PR<br>PWR<br>+V<br>V+<br>Vd<br>Vdd<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"output\"><strong><span style=\"text-decoration: underline;\">Output<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will use a different module for controlling the output power &#8211; a \u2018dumb\u2019 relay module. This is simply a mechanical relay switch which we are using as our output device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Although this module is powered by five volts, its relay contacts are electrically isolated from the module itself. That means it can be used to switch add-ons or toppers which require a different voltage.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"422\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector-1024x422.jpg\" alt=\"A typical relay module\" class=\"wp-image-31319\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector-1024x422.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector-300x124.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector-768x316.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector-1536x633.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector-850x350.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/004-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A typical relay module<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The picture below shows how this relay module is connected.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-1024x506.jpg\" alt=\"Connections to the relay module\" class=\"wp-image-31333\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-1024x506.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-300x148.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-768x379.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-1536x758.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-850x420.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector-496x244.jpg 496w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/013-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Connections to the relay module<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The Input Interface is the part which connects to power and the signal from the microcontroller board.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Input Interface:<\/strong><br><strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">  <em>4<\/em>  <\/mark><mark style=\"background-color:#57e5e0\" class=\"has-inline-color has-white-color\">  <em>IN<\/em>  <\/mark><\/strong> is the connection from the output pin of your microcontroller board<br><strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">  <em>5<\/em>  <\/mark><mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">  <em>DC-<\/em> <\/mark><\/strong> is the negative or ground connection of your power supply<br><strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">  <em>6<\/em>  <\/mark><mark style=\"background-color:#f93131\" class=\"has-inline-color has-white-color\">  <em>DC+<\/em> <\/mark><\/strong> is positive connection of your power supply<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Output Interface is the part which provides power to your add-on or topper. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Output Interface:<\/strong><br><strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">  <em>1<\/em>  <\/mark><mark style=\"background-color:#fca400\" class=\"has-inline-color has-white-color\">  <em>NO<\/em>  <\/mark><\/strong> is the Normally Open relay contact<br><strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">  <em>2<\/em>  <\/mark><mark style=\"background-color:#fca400\" class=\"has-inline-color has-white-color\">  <em>COM <\/em> <\/mark><\/strong> is the Common relay contact<br><strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">  <em>3<\/em>  <\/mark><mark style=\"background-color:#fca400\" class=\"has-inline-color has-white-color\">  <em>NC <\/em> <\/mark><\/strong> is the Normally Closed relay contact<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With unpowered Output Interface connections, this module can be used as a direct replacement for a mechanical switch inside a pinball machine. But <strong><span style=\"text-decoration: underline;\">only<\/span><\/strong> with the output connections unpowered! In this case only the Common (COM) and Normally Open (NO) connections are used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For powered Output Interface connections, there are three relay contacts to consider: <br>Common (COM), Normally Closed (NC), and Normally Open (NO). <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"376\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector-1024x376.jpg\" alt=\"Relay wiring\" class=\"wp-image-31321\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector-1024x376.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector-300x110.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector-768x282.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector-1536x564.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector-850x312.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/006-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Relay wiring when the relay is de-energised<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The <strong>COM<\/strong> connection does not ever change.<br>The <strong>NC<\/strong> connection is closed when the relay is de-energised (shown above), and changes to open when the relay is energised.<br>The <strong>NO<\/strong> connection is open when the relay is de-energised (shown above) and changes to closed when the relay is energised. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0745e3\" class=\"has-inline-color\">Load<\/mark><\/strong> in the picture above is your add-on or topper.  In our case, the changing of the NO connection is how the Load gets powered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Power+<\/mark><\/strong> is the positive connection on your power supply and the voltage should be chosen to match the positive voltage required by your add-on or topper.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#0745e3\" class=\"has-inline-color\">Power-<\/mark><\/strong> is the negative or ground connection on your power supply.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"input-tied-to-output\"><strong><span style=\"text-decoration: underline;\">Input Tied To Output<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To re-cap, the input is the IR module while the output is the relay module. Tying the two together through an Arduino UNO is what we&#8217;ll cover in next section.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First we&#8217;ll look at the Arduino&#8217;s power and general purpose pins. Then, we&#8217;ll see how to use those pins to connect the input and output modules.  You can use pre-cut <em><a href=\"https:\/\/www.pinballnews.com\/site\/2022\/12\/24\/pinball-add-on-controller-part-one\/\" data-type=\"link\" data-id=\"https:\/\/www.pinballnews.com\/site\/2022\/12\/24\/pinball-add-on-controller-part-one\/\" target=\"_blank\" rel=\"noreferrer noopener\">Dupont Wires<\/a><\/em> which have suitable connectors already attached to make those connections, or you can make your own connecting cables.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The IR input module has three connections: <strong>VCC<\/strong>, <strong>GND<\/strong> and <strong>OUT<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-1024x341.jpg\" alt=\"Front view of the horizontally-orientated module\" class=\"wp-image-31316\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-1024x341.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-300x100.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-768x256.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-1536x512.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector-850x283.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/001-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The three connections on an IR module<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>VCC<\/strong> goes to the 5V pin on the Arduino board you are using. This is the module&#8217;s power source pin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>GND<\/strong> connects to the <strong>GND<\/strong> pin on the Arduino board you are using. This is the module&#8217;s ground pin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>OUT<\/strong> is the digital signal which goes from the IR module to the Arduino board you are using. For our purpose, many of the Arduino&#8217;s pins  &#8211; Analog A0 through A5 and Digital D0 through D13 &#8211; can be used.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"833\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector-1024x833.jpg\" alt=\"The Arduino Uno's pins\" class=\"wp-image-31322\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector-1024x833.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector-300x244.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector-768x625.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector-1536x1250.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector-850x692.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/007-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The Arduino UNOpins<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The Arduino UNO power pins are <mark style=\"background-color:#ff5050\" class=\"has-inline-color has-white-color\"><strong>3.3V<\/strong> <\/mark>and <mark style=\"background-color:#ff5050\" class=\"has-inline-color has-white-color\"><strong>5V<\/strong><\/mark><strong> <\/strong>for positive voltage output and <mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\"><strong>Ground<\/strong><\/mark> common connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Arduino has a number of general use pins. These pins are nominally designated as either <strong><mark style=\"background-color:#fffd2d\" class=\"has-inline-color\">Analog<\/mark><\/strong> or <strong><mark style=\"background-color:#99f473\" class=\"has-inline-color\">Digital<\/mark><\/strong>. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:#fffd2d\" class=\"has-inline-color\">Analog<\/mark><\/strong> pins can be used for either analog or digital signals, whereas most <strong><mark style=\"background-color:#99f473\" class=\"has-inline-color\">Digital<\/mark><\/strong> pins can only be used for digital inputs or outputs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inputs receive signals from, in our case, IR modules. Outputs send signals to, in our case, relay modules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As we will be using the in-built USB connector to communicate with the Arduino UNO, we can ignore all those <strong><mark style=\"background-color:#abb8c3\" class=\"has-inline-color has-white-color\">grey<\/mark><\/strong> secondary labels which relate to an alternative way to communicate with the board.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Arduino <a href=\"https:\/\/docs.arduino.cc\/learn\/electronics\/power-pins\">power pins<\/a> are just as they sound, pins to which power is connected. There are two types of 5 volt power pins: <strong><mark style=\"background-color:#cf2e2e\" class=\"has-inline-color has-white-color\">5V<\/mark> <\/strong>and&nbsp;<strong><mark style=\"background-color:#cf2e2e\" class=\"has-inline-color has-white-color\">VIN<\/mark><\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:#cf2e2e\" class=\"has-inline-color has-white-color\">5V<\/mark><\/strong>&nbsp;is a positive direct current (+5Vdc) supply which is only able to provide a limited amount of power. The power limitation comes from the use of a very small voltage regulator on the Arduino board which can only supply a certain amount of current.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our case, because we are powering the Uno from a +5V USB power supply, the <mark style=\"background-color:#cf2e2e\" class=\"has-inline-color has-white-color\"><strong>VIN<\/strong><\/mark> pin is a positive direct current <strong>+5Vdc<\/strong> source with power mainly limited by the type of USB power supply used. If you were powering the Uno through the board&#8217;s dedicated power socket, the <mark style=\"background-color:#cf2e2e\" class=\"has-inline-color has-white-color\"><strong>VIN<\/strong><\/mark> pin would be connected to that.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is highly recommended that a power source independent from the pinball machine&#8217;s regulated voltages be used to power any add-ons or toppers, such as a high power phone charger plugged into either the games service outlet or an external mains power socket.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">Ground<\/mark><\/strong> is the second power connection, and is the return feed from the <strong><mark style=\"background-color:#cf2e2e\" class=\"has-inline-color has-white-color\">VIN<\/mark><\/strong> supply to complete the power path.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The picture below shows an IR module, connected to an Arduino UNO, with the same connections we are going to use. Use of these physical connection and the potentiometer will be explained further in the second, software-related half of this article pair.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"756\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector-1024x756.jpg\" alt=\"A slightly different IR input module wired to Arduino\" class=\"wp-image-31323\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector-1024x756.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector-300x222.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector-768x567.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector-1536x1135.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector-850x628.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/008-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">A slightly different IR input module wired to Arduino<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The Arduino UNO features an LED which is connected to digital pin 13.  This can be used to indicate the correct functioning of the Arduino&#8217;s programming by showing when that pin is activated.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"495\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector-1024x495.jpg\" alt=\"The LED on the Arduino's pin 13\" class=\"wp-image-31324\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector-1024x495.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector-300x145.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector-768x371.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector-1536x742.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector-850x411.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/009-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The LED on the Arduino UNO&#8217;s pin 13<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Now we have the inputs and outputs all connected together. Notice the use of in-built LEDs on the Arduino and the modules for power and status indication.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">IR Module<\/th><th class=\"has-text-align-center\" data-align=\"center\">Arduino Uno<\/th><th class=\"has-text-align-center\" data-align=\"center\">Relay Module<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">Power LED = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#01aa0e\" class=\"has-inline-color\">Green<\/mark><\/strong><br>Status LED = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#01aa0e\" class=\"has-inline-color\">Green<\/mark><\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Power LED = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#01aa0e\" class=\"has-inline-color\">Green<\/mark><\/strong><br>Status LED = <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">Yellow<\/mark><\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\">Power LED = <strong><mark style=\"background-color:rgba(0, 0, 0, 0);color:#01aa0e\" class=\"has-inline-color\">Green<\/mark><\/strong><br>Status LED = <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Red<\/mark><\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"796\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector-1024x796.jpg\" alt=\"The IR input and relay output modules connected to the Arduino\" class=\"wp-image-31325\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector-1024x796.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector-300x233.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector-768x597.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector-1536x1194.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector-850x661.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/010-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">The IR input and relay output modules connected to the Arduino<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\" id=\"installation\"><strong><span style=\"text-decoration: underline;\">Installation<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These Arduino modules are very small and can easily fit inside a crowded pinball machine. With a little luck, the machine\u2019s original hardware may be used to anchor them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Alternatively, a standoff kit could easily be employed to mount the boards properly. These kits are available in several styles and using assorted materials to give a range of colour choices.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"900\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector.jpg\" alt=\"A typical standoff kit with lots of mounting options\" class=\"wp-image-31326\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector.jpg 900w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector-300x300.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector-150x150.jpg 150w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector-768x768.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/011-pinball-ball-detector-850x850.jpg 850w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><figcaption class=\"wp-element-caption\">A typical standoff kit with lots of mounting options<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Hinged standoffs and sticky-backed circuit board mounts are also available in several different sizes and styles.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"403\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector-1024x403.jpg\" alt=\"Hinged standoff and sticky-backed circuit board mounts\" class=\"wp-image-31327\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector-1024x403.jpg 1024w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector-300x118.jpg 300w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector-768x302.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector-1536x605.jpg 1536w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector-850x335.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/012-pinball-ball-detector.jpg 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Hinged standoff and sticky-backed circuit board mounts<\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\" id=\"hints-n-tips\"><strong><span style=\"text-decoration: underline;\">Hints-n-Tips<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 Above the playfield, the better IR module to use will be the vertically-oriented variety mounted above the point of detection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 IR input modules with potentiometers are the most versatile.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 Know the type of output you get from your IR input module when the ball is detected (either <strong>HIGH<\/strong> or <strong>LOW<\/strong>) and adjust your code accordingly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 Similarly, verify or set the jumper on your relay output module to the &#8216;<strong>H<\/strong>&#8216; (<strong>HIGH<\/strong>) or&nbsp;\u2018<strong>L<\/strong>\u2018 (<strong>LOW<\/strong>)&nbsp;position.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 Double-check all of your connections before powering your creation for the first time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 Ensure your creation is not electrically shorting against, or physically binding, anything in your pinball machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 Changing ambient lighting, in-game lighting or playfield flashers can sometimes give false signals which trigger the IR module. False triggering can usually be fixed by carefully adjusting the sensitivity potentiometer on the IR module. The vertically-oriented IR module has a built in baffle\/beam separator making it physically more immune to the effects of ambient light.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 If your IR input module seems to start acting strangely during gameplay, check how its output\/signal indicator LED is behaving. This may be an indication that ambient light is interfering with the sensor, in which case you may need to place a little heat shrink tubing around the bodies of the IR sensor pair. Be sure the lenses\/tips aren&#8217;t obstructed though.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"1024\" src=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector-822x1024.jpg\" alt=\"Heat shrink tubing around the IR transmitter and receiver, with un-shrunk tubing protecting the module too\" class=\"wp-image-31691\" style=\"width:550px\" srcset=\"https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector-822x1024.jpg 822w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector-241x300.jpg 241w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector-768x957.jpg 768w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector-850x1059.jpg 850w, https:\/\/www.pinballnews.com\/site\/wp-content\/uploads\/learn\/pinball-ball-detector\/256-pinball-ball-detector.jpg 900w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/a><figcaption class=\"wp-element-caption\">Heat shrink tubing around the IR transmitter and receiver, with un-shrunk tubing protecting the module too &#8211; The colour of tubing was chosen to make it look as though it were part of the original game<\/figcaption><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">In the second part of his article, Todd will show you how to upload some simple software to the Arduino, and describe what each line does so you can modify it to work as you want, or expand it to use additional input or output modules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-part-two\/\" data-type=\"link\" data-id=\"https:\/\/www.pinballnews.com\/site\/2024\/02\/02\/pinball-ball-detector-part-two\/\" target=\"_blank\" rel=\"noreferrer noopener\">You can click here to view Part Two<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pinball add-ons, mods and toppers are increasingly popular ways to customise your machine, enhancing the appearance or adding features not included by the manufacturer.<\/p>\n","protected":false},"author":2,"featured_media":31360,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1943,148,1909,149,2044,2045],"class_list":["post-31309","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","tag-add-on","tag-arduino","tag-ir","tag-led","tag-module","tag-topper"],"_links":{"self":[{"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/posts\/31309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/comments?post=31309"}],"version-history":[{"count":9,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/posts\/31309\/revisions"}],"predecessor-version":[{"id":31716,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/posts\/31309\/revisions\/31716"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/media\/31360"}],"wp:attachment":[{"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/media?parent=31309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/categories?post=31309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pinballnews.com\/site\/wp-json\/wp\/v2\/tags?post=31309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}