{"id":1402,"date":"2017-02-25T21:21:01","date_gmt":"2017-02-25T19:21:01","guid":{"rendered":"http:\/\/borkedcode.com\/wp\/?p=1402"},"modified":"2018-02-20T17:25:03","modified_gmt":"2018-02-20T15:25:03","slug":"the-uss-enterprise-refit-from-star-trek-the-motion-picture-15","status":"publish","type":"post","link":"https:\/\/borkedcode.com\/wp\/?p=1402","title":{"rendered":"The USS Enterprise (Refit) from Star Trek: The Motion Picture"},"content":{"rendered":"<h1>Build Log: \u00a0Part 15<\/h1>\n<p>This update is going to be about some of the electronics that I\u2019m designing and working with to control special effects on the model \u2013 the lighting of the torp launcher and the sounds that go along with the lighting effects.<\/p>\n<p>First off, let\u2019s spell out my requirements \u2013 there are three basic sound effects I want to establish:<\/p>\n<p>First:\u00a0 an ambient noise that will operate at all times that will provide a low-level of background effects.\u00a0 I\u2019ve mixed a 13-minute MP3 of various clips from ST:TMP of scenes from the engineering deck and the shuttle bay.<\/p>\n<p>Second:\u00a0 a music track \u201cEnterprise Clears Moorings\u201d from ST:WOK that will accompany a power-up lighting procedure that I have on a separate board purchased from Tenacontrols (given what I know now about programming the Arduino, I didn\u2019t really need to buy this, but I\u2019ve got it so I\u2019ll use it).<\/p>\n<p>Third:\u00a0 a torpedo sound effect that will accompany the firing sequence of lights.<\/p>\n<p>(I might decide to add a fourth for going to Warp, but I haven\u2019t decided yet.)<\/p>\n<p>These sounds fit into the actions I want the little computer to do:<\/p>\n<ol>\n<li>Start-up. When the power comes on, it should power basic lights and take us directly into\u2026<\/li>\n<li>Idle State. Start the ambient background noise on a cycle, which will loop endlessly when nothing else is going on.<\/li>\n<li>Power-Up. This will halt whatever else is going on, then begin a process that will match the lighting sequence as seen on ST:WOK when the Enterprise leaves drydock, and will also play the theme tune \u201cEnterprise Clears Moorings.\u201d\u00a0 After the tune is done the computer will return to (2), the idle state.<\/li>\n<li>Torpedo launch. Whatever else is going on, it should stop that and kick off the lighting sequence for launch while synchronizing the torpedo sound with the lighting.\u00a0 Afterwards, return to (2), idle state.<\/li>\n<\/ol>\n<p>So how are we going to do this?<\/p>\n<p>I\u2019m going to assume you aren\u2019t big on electronics, so if you know this stuff already, skip this part.<\/p>\n<p>The Arduino is a small computer, with a series of input and output pins.\u00a0 You can program it to trigger the outputs based on what it might receive from inputs.<\/p>\n<p>Certain electronic components produce current as a result of conditions around it \u2013 like changes in light, temperature, buttons being pressed, rheostats being turned, etc.\u00a0 These are considered \u201csensors\u201d \u2013 you have several natural sensors of your own:\u00a0 eyes, skin, smell, etc.<\/p>\n<p>Other electronic components do things when they receive current \u2013 like spin gears, light up, etc.\u00a0 These are called \u201cactuators,\u201d but more often they\u2019re referred to by their specific function.\u00a0 LEDs, servomotors, transistors, etc. are all actuators.<\/p>\n<p>So the Arduino, as a microcontroller, receives inputs from sensors and issues on\/off to actuators.\u00a0 There are about a jillion other add-ons that are built specifically for the Arduino, in many cases that snap onto the Arduino itself.\u00a0 These are called \u201cshields\u201d, and they are pin-compatible with the Arduino\u2019s rows of pins so they easily slide onto and off of the little computer.<\/p>\n<p>The Arduino\u2019s controlling circuits have \u201con\u201d and \u201coff\u201d functions, \u201con\u201d being represented by the board sending 5 Volts of current out the particular pin of the circuit.\u00a0 \u201cOff\u201d receives no current.\u00a0 All the outputs can operate in \u201cdigital\u201d on\/off style, and some of them can operate in \u201canalog\u201d mode \u2013 they\u2019re still on\/off, but they can emulate analog output by cycling a percent of the time by switching much faster than a human can perceive.\u00a0 So to be completely \u201con\u201d they turn on 100% of the time, and to be \u201chalf\u201d on they cycle on\/off 50% of the time, etc.<\/p>\n<p>Remember the lighting from the Neck section that I made for the torpedo launcher?\u00a0 Five lights \u2013 one for the background, then a red and white for each torpedo.\u00a0 The background will light up, then to simulate a torpedo launch, the red on each side will cycle up, and at the point of launch the white behind it will flash.\u00a0 See this video for an example:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/9EKuuq4Eo8I\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>In the video above, you see the torpedo red LEDs fade in and then go off \u2013 the fade-on is accomplished by using the analog outputs this way.<\/p>\n<p>So I want to make sounds, and the easy way would normally be to pick up an MP3 player shield, but I\u2019m a bit of a masochist, and the form factor of a full sized Arduino plus a shield is a bit tall for what I want to build as a base.\u00a0 Plus, it\u2019ll be cooler this way.<\/p>\n<p>What I did instead, is I bought some el-cheapo MP3 players from Amazon \u2013 they were about $2-$3 each, self-contained little units that were meant for thumb-control.\u00a0 I ended up with two different kinds (the first one shipped from Hong Kong and took longer than expected, so I ended up ordering a different set and when all was said and done I had both kinds).\u00a0 One was a bare-bones model with just controls, the second had a similar layout for its controls, and had a tiny little LCD display in it.<\/p>\n<div id=\"attachment_1405\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2375-resized.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1405\" class=\"size-medium wp-image-1405\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2375-resized-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2375-resized-300x225.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2375-resized-768x576.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2375-resized-1024x768.jpg 1024w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2375-resized.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1405\" class=\"wp-caption-text\">Remarkably similar internally, these two players retail for between $2 and $3 on Amazon&#8230;often shipped from Hong Kong at no charge.<\/p><\/div>\n<p>Internally they are both very similar, small circuit boards with a set of five button pads.\u00a0 Each button pad has an internal and an external connection pad, and there\u2019s a connector disc held in place by some tape that makes it into a momentary switch (momentaries are on for a \u201cmoment,\u201d only on so long as they\u2019re held connected).\u00a0 When the buttons on the unit are pressed, the connector disc bends in and makes a connection between the inner and outer sections which results in an \u201con\u201d result for as long as the button is held down.<\/p>\n<div id=\"attachment_1406\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2377-resized.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1406\" class=\"size-medium wp-image-1406\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2377-resized-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2377-resized-300x225.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2377-resized-768x576.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2377-resized-1024x768.jpg 1024w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2377-resized.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1406\" class=\"wp-caption-text\">I already did a little surgery on the board to the left, but you can figure out where the parts are.<\/p><\/div>\n<p>Each one also has a 16-pin controller chip, a tiny flat battery pack, an earphone jack, an on-off dip switch, and a micro-SD card slot.<\/p>\n<p>A lot of these connector pads are hooked up to the same circuit inside the MP3 player, some of them being ground, and others connecting to pins on the 16-pin chip.\u00a0 The connector disc shorts the pads when the button is pushed.\u00a0 We\u2019re going to use this principle to make the Arduino pretend to be fingers pressing buttons.\u00a0 There\u2019s only so many outputs from the Arduino though, and fortunately we only need a few functions of the MP3 player.<\/p>\n<p>Those functions are:<\/p>\n<ul>\n<li>Navigation (forward or back)<\/li>\n<li>Pause\/Play<\/li>\n<\/ul>\n<p>We might also have need of:<\/p>\n<ul>\n<li>Power<\/li>\n<li>Volume +\/-<\/li>\n<\/ul>\n<p>There are a few sites on the net that describe how to hack an MP3 player like these, and they show some of the connector pin-outs and which pins they connect to on the MP3 chip.\u00a0 These may or may not be correct \u2013 I found a few errors when testing.<\/p>\n<p>I picked up a pair cheap 2GB micro-SD cards (important to get the kind with adapters, or you may not be able to use them) for $5 on eBay, and these will serve just fine for my purpose here.\u00a0 Also important is to note the capacity of your MP3 player, some can handle large SDs and some can\u2019t.\u00a0 You don\u2019t need an expensive high-cap model for this purpose, and don\u2019t blow money on SDs that are too big for your player.<\/p>\n<p>As you saw in the video I\u2019ve got the Arduino set up to trigger those lights in the right sequence for the firing, which I used transistors to control (I got five of them in a starter kit, but you can buy them really cheap on eBay or at an electronics store \u2013 they are unit \u201cBC 547 K7 E\u201d).<\/p>\n<p>A transistor is a special actuator that basically operates as a switch.\u00a0 It has three legs, called collector, base, and emitter.\u00a0 When a little bit of current is applied to the base, the collector and the base are connected to one another.\u00a0 These little gems enable you to control something considerably more power-hungry than your controller board can supply.\u00a0 So if you were going to run a big motor and wanted to control it with the Arduino, you wouldn\u2019t be able to get it powered up with the Arduino itself \u2013 but you\u2019d power it from another source and run that power through the transistor.\u00a0 You supply the positive through the collector arm, and connect the emitter to the positive of the motor, then connect the ground for the motor to the ground for the whole system.<\/p>\n<p>The base on the transistor isn\u2019t built to take a lot of current, it only needs a little tiny trickle to trigger it.\u00a0 Easiest way to do that for these models of transistor is to put a 1k Ohm resistor in the path of the current from your Arduino\u2019s pin.<\/p>\n<p>Let\u2019s go into the details of which pads do what for each of the MP3 players.\u00a0 We\u2019ll start with the simpler one, which doesn\u2019t have a display (the number represents the pin on the chip):<\/p>\n<div id=\"attachment_1407\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Base-MP3-Pads-to-Pins.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1407\" class=\"size-medium wp-image-1407\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Base-MP3-Pads-to-Pins-300x131.jpg\" alt=\"\" width=\"300\" height=\"131\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Base-MP3-Pads-to-Pins-300x131.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Base-MP3-Pads-to-Pins.jpg 366w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1407\" class=\"wp-caption-text\">Your mileage may vary &#8211; different factories might program their functions differently.<\/p><\/div>\n<p>I think it\u2019s important to note that you might end up with a different board or circuit layout \u2013 these things might be mass-produced in China, but they have a lot of different variations.\u00a0 Seriously I\u2019d recommend creating a table as I\u2019ve done in the next example, and finding the right wiring solution from studying that.<\/p>\n<p>Each time a button is pressed, it shorts the connection between the inner and outer pad, which connects two pins on the chip to one another \u2013 and the chip responds with the function given.\u00a0 So, when you press \u201cPlay\u201d on this model, it connects pins 7 and 8, so for this chip 7 + 8 = Play.<\/p>\n<p>I snipped the battery off and connected leads to its wires \u2013 when the time came I\u2019d link these to the Arduino\u2019s 3.3V output.\u00a0 I also soldered new leads to the inner and outer pads of the Vol +, and the inner and outer pads of the Next button.\u00a0 This gives me leads attached to pins 6,7,8 and 16 of the chip.\u00a0 Notice that using a combination of two of any of these, I can generate any of the commands available on the control board of the player.<\/p>\n<p>Using a transistor on each wire, I could wire all the emitter arms of the four transistors to a common line (which would be a \u201cbus\u201d), and by turning on two transistors at a time I could pretend I was pressing buttons.<\/p>\n<p>Here\u2019s the problem \u2013 this model player has a convenience feature programmed into it that turns out to be really inconvenient for me:\u00a0 it remembers where it left off when you last turned it off.\u00a0 If it\u2019s in the middle of playing a track, it\u2019ll remember and when you turn it back on, and it\u2019ll resume playing in the track where it left off.\u00a0 My Arduino has no such memory unless I program one into it, which requires a persistent storage that would just be a huge pain in the ass to wire up and write to.<\/p>\n<p>So if I had only one track that needed playing, this unit would be fine.\u00a0 But I need several, and that memory feature is a real bugger.<\/p>\n<p>That\u2019s where the next model came in much more handy.<\/p>\n<p>The one with the LCD display happens to reset itself to \u201czero\u201d when it\u2019s powered down and then up.\u00a0 Whew!\u00a0 That makes life a lot easier for me.\u00a0 An added benefit, the volume control is set at a reasonable level by default, which is great (extra great since it has a weird volume control \u2013 you have to hold down the Vol while pressing &gt;&gt; or &lt;&lt; to adjust the volume).\u00a0 Slightly less convenient, the \u201czero\u201d state powers up to a menu, but this is only a minor problem because once you tap the menu button once it begins to play at the first track.<\/p>\n<p>Since I have the option of starting from a zeroed state, I basically only need three functions here:<\/p>\n<ul>\n<li>Tap the menu button<\/li>\n<li>Move (forward or back doesn\u2019t matter)<\/li>\n<li>Pause\/Play<\/li>\n<\/ul>\n<p><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2373-numbered.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-1411 alignright\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2373-numbered-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2373-numbered-300x225.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2373-numbered-768x576.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2373-numbered-1024x768.jpg 1024w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2373-numbered.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>I wasn\u2019t able to trace which pad went to which pin on the chip this time, so instead I used a jumper wire to map out what happens when I short any of the various pads against each other.\u00a0 In my map, the pads are represented by a number &#8211; 1 for the 12 O\u2019clock button and going clockwise, 5 being for the center button, plus \u201ci\u201d for inner and \u201co\u201d for outer, see the image here:<\/p>\n<p>Using that jumper wire (holding one end to one pad, and touching the other pad to the other), here are the functions:<\/p>\n<div id=\"attachment_1412\" style=\"width: 436px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Alternate-MP3-Pad-Mapping-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1412\" class=\"wp-image-1412\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Alternate-MP3-Pad-Mapping-1-300x98.jpg\" width=\"426\" height=\"139\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Alternate-MP3-Pad-Mapping-1-300x98.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Alternate-MP3-Pad-Mapping-1-768x251.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Alternate-MP3-Pad-Mapping-1.jpg 969w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/a><p id=\"caption-attachment-1412\" class=\"wp-caption-text\">For some reason this table didn&#8217;t come through very clear, sorry. You shouldn&#8217;t take my word for this anyway, since different factories are likely to have different code for their chip, even if the board looks similar.<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Pl\/Pa = Play \/ Pause<\/p>\n<p>&gt;&gt; = Next<\/p>\n<p>&lt;&lt; = Back<\/p>\n<p>Vol = Volume toggle (this plus &gt;&gt; or &lt;&lt; adjusts volume)<\/p>\n<p>Menu = Menu button<\/p>\n<p>X = no function<\/p>\n<p>Other things I noticed while I was making this map that I\u2019ll need to keep in mind while programming controls for this unit:<\/p>\n<ul>\n<li>Back does a jump to the prior track \u2013 it does not return to zero on the current track.<\/li>\n<li>Pause only holds within a track \u2013 advancing or backing up a track takes it off pause.<\/li>\n<li>Volume, as mentioned, is a toggle that changes the &lt;&lt; and &gt;&gt; circuits to change volume.<\/li>\n<li>Boot of the MP3 player takes about 2s, and lands in a menu that takes one Menu tap to exit and start playing track 1.<\/li>\n<li>Left Idle, after 30-40 seconds the LCD display turns off and requires a single button press (any button) to \u201cwake up\u201d and be receptive to further commands. The wake up tap elicits no response.<\/li>\n<\/ul>\n<p>Based on this map, I really only need transistor-enabled connections to 1o, 2o, and 3i to produce the actions I require \u2013 I will connect the emitters of all three to 5o, which will give me <strong>Menu<\/strong>, <strong>Back<\/strong>, and <strong>Play\/Pause<\/strong> function.<\/p>\n<p>I\u2019ll also put a transistor switch on the power for this player.\u00a0 I\u2019ll snip the battery off and connect it to the Arduino\u2019s 3.3V output and stick a transistor control on that.\u00a0 This gives me the ability to turn off the MP3 player and <strong>Reset<\/strong> it to \u201czero\u201d state when I need to.<\/p>\n<p>Additionally, the Tenacontrols board uses a momentary switch to trigger its power-up sequence.\u00a0 I\u2019ll slap a transistor there instead of a momentary switch, and control that through the Arduino too.\u00a0 That enables me to control the <strong>Power-Up<\/strong> through software.<\/p>\n<p>So now my functions are starting to shape up.\u00a0 I\u2019ll need two reference points:\u00a0 what track I\u2019m on, and whether I\u2019m currently playing something.\u00a0 (This second one is not really necessary since I\u2019ll be playing something all the time, but there\u2019s a slight chance that something might go askew and since I have no ability to handle exception cases post-facto in this code, I need to establish solid control up-front.)\u00a0 I will have to have assumed knowledge in this little application that there are three tracks, and the order in which they appear on the storage card, because I have no real means by which to figure that out (technically I could hack further into the device to find where the LCD display gets length-of-track information and track # info, and use that, but I\u2019m not <em>that <\/em>much of a masochist).<\/p>\n<p>I\u2019ll need to code the Arduino to do the actions described earlier in the following ways:<\/p>\n<ol>\n<li>Start-up. Always-on lights will be wired to the power directly so no action required there, the Arduino will <strong>Reset<\/strong> the MP3 player, tap <strong>Menu<\/strong> once, then <strong>Pause <\/strong>(tapping the menu automatically starts playing, so I\u2019m establishing known control here and Pausing it). \u00a0Record the play-state as paused, and record what track we\u2019re on (the first one), then enter Idle state.<\/li>\n<li>Idle State. Check the reference sites to find what track we\u2019re on and whether we\u2019re currently playing or paused.\u00a0 Navigate to the ambient background noise by pressing the <strong>Back<\/strong> button an appropriate number of times, and then every 13 minutes use the <strong>Back<\/strong> button to re-navigate to the ambient track.<\/li>\n<li>Power-Up. Figure out where we are and whether we\u2019re playing or paused.\u00a0 If playing, <strong>Pause<\/strong>, then navigate to the \u201cEnterprise Clears Moorings\u201d track.\u00a0 <strong>Pause<\/strong>\u00a0 Trigger the <strong>Power-Up <\/strong>sequence on the Tenacontrols board.\u00a0 Delay the right amount of time and <strong>Play <\/strong>the track when it will synch up properly with the lighting as seen on ST:WOK when the Enterprise leaves drydock.\u00a0 1 second before the tune is done, <strong>Pause <\/strong>and enter (2) the idle state.\n<ol>\n<li>I may amend this depending on whether I decide to \u201cpower down\u201d, too. Not sure yet.<\/li>\n<\/ol>\n<\/li>\n<li>Torpedo launch. Figure out where we are and whether we\u2019re playing or paused.\u00a0 If playing, <strong>Pause<\/strong>, then navigate to the Torpedo track.\u00a0 <strong>Pause<\/strong>\u00a0 Trigger the code for the torpedo cycle (which will include synching the sound effects with the lights).\u00a0 If we\u2019re in the middle of Powering Up, all that matters is that we disable the sound \u2013 let the lighting finish on its own, the torp will launch normally independent of all that.\u00a0 Afterwards, return to (2), idle state.<\/li>\n<\/ol>\n<div id=\"attachment_1418\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2378-resized.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1418\" class=\"size-medium wp-image-1418\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2378-resized-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2378-resized-300x225.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2378-resized-768x576.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2378-resized-1024x768.jpg 1024w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2378-resized.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1418\" class=\"wp-caption-text\">Extra-cheap and available in a wide range of sizes, these prototyping boards can be had all over the Internet.<\/p><\/div>\n<p>Some of the timing above will require manually observing and hard-coding times to get things right (particularly where buttons have to be pressed in rapid succession \u2013 I don\u2019t know how sensitive that MP3 chip is).\u00a0 Once I\u2019m satisfied that the whole thing works on my breadboard and proof-of-concept harness, I\u2019ll move the circuitry onto a permanent board and solder it up.<\/p>\n<p>I\u2019ve also bought some inexpensive computer speakers that run on their own wall-socket plug, and a headphone extension cable.\u00a0 Inside the base of the model, I\u2019ll secure the headphone cable so that it shows a port on the outside of the base.\u00a0 The computer speakers will plug into that, and they\u2019ll have their own volume control, so I can adjust according to the needs of the room.<\/p>\n<div id=\"attachment_1416\" style=\"width: 310px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2379-resized.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1416\" class=\"size-medium wp-image-1416\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2379-resized-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2379-resized-300x225.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2379-resized-768x576.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2379-resized-1024x768.jpg 1024w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/DSCF2379-resized.jpg 1824w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1416\" class=\"wp-caption-text\">A little size reference &#8211; the top left board is an Arduino Nano (cheap Chinese knock-off, actually)<\/p><\/div>\n<p>I\u2019ll also probably try to move the code onto a different Arduino platform \u2013 the standard \u201cMega\u201d version is about the size of a credit card, and although this is perfectly acceptable, I\u2019d like to see if I can get all this working with a \u201cNano\u201d size board.\u00a0 The \u201cNano\u201d is about 2cm x 8cm, so from a form-factor perspective I could potentially move all my circuitry outside of main power directly into the secondary hull.\u00a0 That\u2019s not my intention, but it\u2019d be neat if I could manage it.\u00a0 The Nano also consumes less amperage than the Mega, which might be advantageous.\u00a0 I haven\u2019t added up the total Amps this whole affair will draw \u2013 lights, computer boards, MP3 player \u2013 and I\u2019m pretty sure it\u2019ll be &lt;2.0, but I\u2019d still like to conserve what energy I can.<\/p>\n<p>Now this is all well and good, you\u2019re probably thinking \u2013 but I\u2019m missing a very, very important piece to this whole puzzle.\u00a0 In the IT industry it\u2019s called \u201cHMI,\u201d or \u201cHuman-Machine Interface.\u201d\u00a0 That amounts to the method by which I or other persons will tell this system to do the stuff it knows how to do, for us.\u00a0 When I want it to do a power-up sequence, how do I tell it?\u00a0 When I want it to fire torpedoes, how do I tell it?\u00a0 I haven\u2019t said anything at all about that stuff here.<\/p>\n<p>I\u2019ll settle one thing first off \u2013 there will be a main on\/off switch to control the power for the entire operation.\u00a0 But these other items?<\/p>\n<p>That\u2019s going to be a hell of a lot cooler, and I\u2019ll cover that in the next installment, because I haven\u2019t got all the parts yet.<\/p>\n<div id=\"attachment_1419\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Nav-Display.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-1419\" class=\"size-medium wp-image-1419\" src=\"http:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Nav-Display-300x137.jpg\" alt=\"\" width=\"300\" height=\"137\" srcset=\"https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Nav-Display-300x137.jpg 300w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Nav-Display-768x352.jpg 768w, https:\/\/borkedcode.com\/wp\/wp-content\/uploads\/2017\/02\/Nav-Display-1024x469.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-1419\" class=\"wp-caption-text\">&#8230;and it might end up looking a little bit like this :).<\/p><\/div>\n<p><a href=\"http:\/\/borkedcode.com\/wp\/?p=1392\">USS Enterprise \u2013 Build Log Part\u00a014<\/a>\u00a0\u00a0<a href=\"http:\/\/borkedcode.com\/wp\/?p=1516\">USS Enterprise \u2013 Build Log Part\u00a016<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build Log: \u00a0Part 15 This update is going to be about some of the electronics that I\u2019m designing and working with to control special effects on the model \u2013 the lighting of the torp launcher and the sounds that go &hellip; <a href=\"https:\/\/borkedcode.com\/wp\/?p=1402\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[58,57,44,73,1],"tags":[64,74,76,75],"class_list":["post-1402","post","type-post","status-publish","format-standard","hentry","category-build-log","category-model-kits","category-pc-stuff","category-sci-fi","category-uncategorized","tag-model-kit","tag-polar-lights","tag-star-trek","tag-uss-enterprise"],"_links":{"self":[{"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1402"}],"version-history":[{"count":6,"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1402\/revisions"}],"predecessor-version":[{"id":1530,"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1402\/revisions\/1530"}],"wp:attachment":[{"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borkedcode.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}