loading

This is a game I created on Autodesk Circuits to learn binary numbers.

A playable online version can be found at https://circuits.io/circuits/2924784-binary-game

If you want to follow along with this guide and build your own the files and code can be found on my github at https://github.com/keebie81/BinaryGame

Step 1: Playable Version

Here is a version that can be played in your web browser using Autodesk Circuits

Step 2: Parts Needed

1 Rugged Metal Pushbutton with White LED Ring - 16mm White Momentary

1 Adafruit METRO 328 with Headers - ATmega328 - Any Arduino Uno variation would also work. I like the Metro because the bottom is smooth, so I didn't need to put standoffs for the board in my design.

15 M3 x 8 Socket Head Cap Screw

3 M3 Nuts

1 16x2 LCD

4 40mm Standoffs

Silicone Cover Stranded-Core Wire - 30AWG - I used multiple colors to make wiring easy to follow.

9 Toggle Switch SPDT Panel Mount - Any style will work, but I wanted the flatted style.

9 Switch Dress Nut 1/4-40 - Optional, for appearance. You can also use the hardware the switch came with.

Step 3: Designing

I designed the case in Fusion 360. This allowed me to position all the parts and make sure they fit. Once that was done I was able to 3d print the case and see how it fits.

It fit together well so then I created an svg of the two panels. The next step was to get the files ready to be sent out for laser cutting. I followed the templates provided by Ponoko. The instructions also got put on the bottom plate so people would know how the game works.

It took a bit over a week to get my parts from Ponoko.

Step 4: Assembling Top Panel

The top panel goes together pretty easy.

First put the nine toggle switches through and tighten them down. Then put the m3 screws for the display in. Put the spacers on the other side and then thread the screws through the mounting holes on the display. Last part is the 16mm button.

Step 5: Assemble Bottom Panel

Use 3 M3 screws and nuts to fasten the board to the bottom plate. As you can see in the picture I had the holes wrong when laser cutting. I have fixed this for the template I put on github

Step 6: Wiring

To wire follow the diagram. The original design also used digital 1 and 0, but if the switches weren't in the correct position the board would have issues uploading code.

I soldered the wires to male headers plugged in to the Arduino board. This allows easy disconnecting in the future if you ever re-purpose the board. The LCD display also uses female headers to solder to.

One issue I had noticed after I wired was the wiring of the switches. You should verify the connections for a closed circuit. Using the switches I listed earlier when the lever is down the middle and top pin are closed. Since I wired mine wrong I needed to change my code. For the code I provide in this guide it is assumed yours is wired properly.

Also when wiring up the metal push button it should be in the normal open configuration.

Step 7: Powering It

You can connect the board to a computer via the usb cable to power it or use a portable phone charger batterypack such as this one https://www.adafruit.com/products/1959

Step 8: How to Play

When it turns on if it is in easy mode you will be given a random number between 0 - 15. If hard mode it will be 0 - 255.

You then flip the switches up to represent 1 or down for 0, then press the push button to see if you have it correct. If correct it will play the correct answer tone and give you a new number. If wrong it will buzz and say try again.

The value of the switches from left to right is 2^7(128), 2^6(64), 2^5(32), 2^4(16), 2^3(8), 2^2(4), 2^1(2), 2^0(1).

If the random number was 18 the binary value would be 0001 0010. That is because 2^4(16) + 2^1(2) would equal 18.

If it was 255 it would be 1111 1111, since all the numbers added up equal 255.

Step 9: Video of It Being Played

<p>hello all; I'm getting a code error and so I need your help as I'm not a code guy (wish I were).</p><p>here's the error message:</p><p> This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p><p>Arduino: 1.0.6 (Windows NT (unknown)), Board: &quot;Arduino Uno&quot;</p><p>sketch_dec10a.ino: In function 'void loop()':</p><p>sketch_dec10a:206: error: 'NOT_AN_INTERRUPT' was not declared in this scope.</p><p>Any help would be appreciated,</p><p>thanks.</p>
<p>Did you add anything to the code? I did not use NOT_AN_INTERRUPT anywhere in my code</p>
what version of IDE did you use?
<p>I used 1.6.12 I think, thats what is currently on my computer and it compiles with no errors with Arduino uno selected as board</p>
<p>Hi, I upgraded to version 1.6.5 and the sketch compiles.</p><p>very nice Instructable,</p><p>THANKS</p>
<p>I have had the same problem, but because i've used the 1.0.6 IDE of arduino. You can solve it in two ways:</p><p>- put this at the top of the code:</p><p>#define NOT_AN_INTERRUPT -1</p><p>- download the new version of arduino IDE</p><p>Let me know if it works ;)</p>
<p>Hi,</p><p>I am project but I have problems wiring the push button, can you explain how to wire this push button please?</p><p>Thank you</p>
<p>Heres a good guide on wiring it <a href="https://learn.adafruit.com/pi-thermal-printer/soldering-pre-2017#prepare-button">https://learn.adafruit.com/pi-thermal-printer/sold...</a> </p><p>Wire it in the Normal Open configuration. The NO wire to pin 2, the LED+ to 5v, Common &amp; LED- to ground</p>
<p>I've drawn a circuit of a standalone Atmel328, then i've just put together all as the tutorial explain. As soon as possible i'll made a tutorial of the stand alone =D</p>
<p>Awesome job, cant wait to check it out.</p>
<p><a href="https://www.instructables.com/id/Stand-Alone-Arduino-ATmega328p/" rel="nofollow">https://www.instructables.com/id/Stand-Alone-Arduin...</a></p><p>;)</p>
<p>Great toy, thanks</p>
<p>Very nice instructible. (I didn't find the code for the project, I must have missed it.)</p><p>Another variation would be to display the user's selections in binary, hex, and decimal useful for teaching binary number system. </p><p>Another variation may be to see if someone could sequence through all combinations without repeats by switching only one switch at a time ( i.e. a grey code).</p><p>Just for fun I sketched out a similar circuit using discrete components which really shows why using a microcontroller can replace lots of discrete chips and is more flexible should your requirements change!.</p><p>Best Wishes</p>
<p>The code is in the simulation (which is embedded into the Instructable), just click &quot;Code Editor&quot; and you'll see it and be able to copy/paste.</p>
<p>As hughker linked to, I have it listed in the section before part 1. I also have a few variants I would like to build later. I think having a hidden mode that could be accessedd by having switches in a different position at bootup. </p><p>A timer mode where you see how many correct in a row you can get within a certain time.</p><p>I also need to have it get a new random number if the number is the same as last one</p>
<p>https://github.com/keebie81/BinaryGame</p>
<p>Simulation is super cool! Wish I could vote :)</p><p>Sahas</p><p>You are in the finals! Me too :P :D</p>
<p>Great Instructable! I really like the project, excellent work. Kudos to you, voted.</p>
<p>A well presented project,it has given the motivation to build a Binary clock which will allow me to display the time in binary and convert the time to decimal.</p>
<p>I absolutely love this project, well done and thanks for sharing it</p>
<p>Nice! The cost can be lowered a little if you use an Arduino Nano. They cost less than $3 on the Internet. (Do not get the Pro Mini as it does not have the USB connector.) Also, you can simplify the LCD wiring a bunch if you get an LCD display with the I2C interface. It ties to the Arduino using only 4 wires: two for power (+5V and GND) and two for the interface (the clock and data lines on pins A4 and A5). For example:</p><p><a href="http://www.yourduino.com/sunshop/index.php?l=product_detail&p=170" rel="nofollow">http://www.yourduino.com/sunshop/index.php?l=produ...</a></p>
<p>Econjack,</p><p>I prefer not to purchase clone boards. I like to support the companies that created the products. For this project I also wanted the schematic and playable demo from circuits.io to closely match the finished project.</p><p>But you are correct there are multiple ways to lower the cost if you are looking for a less expensive option. </p>
I totally agree about the support, that's why each time I download a new version of the IDE, I give a contribution to the team. To me, that's direct support that shows up in their bank account without deducting the cost of the Arduino.

About This Instructable

9,956views

134favorites

License:

More by keebie81:RFID Door Unlock Coloring Epoxy With Laser Toner Binary Game 
Add instructable to: