As a computer geek myself I'm always interested by anything related to computers and when I was in collage one of the first things I learned was to convert binary numbers to decimal numbers and me and my classmates were always struggling doing this conversion at first to I was always practicing by playing a similar game online that give my a decimal number and I have to answer with binary and yea it make a little bit better in this numbers conversion and today I still like to play that game.
My project is a binary game but not an app on your phone... no it's physical device with toggle switches and and button and it so nice to hold while playing with it.
So the game will give you a decimal number and waiting for you to input you binary number but not using a keypad but using toggle switches on or off... 1 or 0 and then submit your answer then the game will tell you if your answer was correct or not.
For CAD I used Autodesk Fusion 360.
I already made a cardboard prototype before so it as easy having some measurement of it as a reference for me while designing my project
I start by sketching starting by the front part of my design with taps and place for screws then I sketched the sides with T-slot so I could assemble the project using screws and nuts then then I sketched the bottom. One of the best tools I used while sketching was the Mirror as most of my sketches were symmetric. And also While I was sketching I made sure that every sketch is fully defined using some constraints like horizontal/vertical, coincident, perpendicular & etc.
After I finished all the sketches I start extruding my sketches into 3mm parts to match the thickness of the plywood that I'm gone use during fabrication.
I joined some the parts together to make sure that all the part would fit together without problem or misalignment.
I start to insert other components that I'm gone need in my design like screws and nuts from McMaster-CARR & other components like Arduino, breadboard, LCD screen , taggle switches and metal push button from GrabCAD .
I used the components that I inserted into the design and do a projection of some parts of it to help me extrude cut so I can assemble it in the design later
I assembled all the part and and do a projection of the parts that gone be fabricated later and export it as DXF files to be prepared for fabrication.
Sketches
Assembling
For Fabrication I used:
Morn MT3050D CO2 Laser Cutter
3mm plywood
LaserWork (Software)
I used LaserWork to prepare my design to be cut using laser cutter. I imported the DXF files into LaserWork and nested all the part next to each other minimizing the spaces between them and I added some text to my design.
My Laser cutting Parameters:
Cutting Speed: 15 mm/s
Cutting Power 70%
Scanning Speed: 300 mm/s
Scanning Power 36% (I have no idea why I set it to 36% power 😂)
In the Fab Lab's maker space I did the following:
I Power up the laser cutter.
I copied the *.rld file on flash drive and connect it to the laser cutter computer.
I placed plywood & secure it with tape just to make sure it will stay in place.
I redefined the origin point that the laser would start from.
I download the *.rld file to the laser cutter machine. Using the laser cutter controls I navigate to my file and trace the model frame and run it. After all the pieces were cut I remove it and assemble it using screws and nuts
Note: I skipped adjusting the laser focus as it was already adjusted.
I used Wokwi to build my circuit diagram.
Wokwi Components that I used during designing:
Arduino UNO
LCD Screen + I2C Module
Buzzer
Bush button
9 x Toggle switches
Braking Down:
I connect the LCD Screen to the Arduino by connecting VCC to 5V pin, GND to GND pin, SDA to A4 pin and SDL to A5 pin.
I connect the Push Button to D2 and GND
I connected the to Toggle switches all to pins from D3 to D11 and GND
I connect the the anode terminal of the Buzzer to D12 and cathode to GND pin.
I used 9V 2A adaptor for my game because the battery that is available is big and a little bit heavy for my project and need to be charged with specific charger so I decided to go with 9V adaptor as the Arduino is powered in range of 7V to 12V and all my components will be powered via Arduino pins and also I made sure in my design that the power input wouldn't bother the play while holding the game and playing by making it comes in from the bottom side of the game.
I used Arduino IDE to program my Arduino UNO
I start by install and including the libraries needed for the LCD Screen, then defined some variables that I'm gone need during writing my code and also assign pins numbers to variables to make it easier to debug later if needed.
Then I start by creating some functions that would make my life easy as It would reduce the line of code by write the function code once and re-use it every time I need it instead of writing it all over again when I need the same part of code.
Functions quick brake down:
screenupdate() : It checks for the toggle switches state and update it's value on the LCD screen by printing 1 or 0
getsum() : Just a punch of if condition that check of the toggle switches is on or off and depend on the switch it adds specific value on the total variable.
newround() : It start by setting "correct" variable to zero and then checks if a specific switch is on or off and then if it is on it generate random number between 1 & 15 and if it is off it generate random number between 1 & 255 and assign it to a variable then print a text and a number on the LCD Screen.
setup() : It start by initialize communication between the Arduino and the LCD screen, then set pin mode and set the serial communication speed and set "random seed" then call "newsround()" function to start a new round once the Arduino is powered up.
loop(): Here all the previse functions are used with each other in a infinity loop first it define an interruption function that only when it triggered it call specific function "getsum()". After that there are two if conditions that check if the user enter the correct answer or not and depending of those if conditions it print CORRECT & INCORRECT on the LCD screen and call the right functions to execute its code from the tunes.h file . Also inside the loop it reads the serial data that would be send via the GUI and if the specific condition is true the LCD will update to specific values.
Note:
pitches.h file & tunes.h are ready made code that I used and tinker with to fit my needs in this project.
GitHub Gist of all the code
I also worked on GUI application for the BinaryGame to add more features for my game such as score.
I used Visual Studio 2022 as my IDE and I write the the code using C#
Here is part of the application code and the rest is available on GitHub.
form_game.cs file
And here it is a flow chart showing the logic of the application
Simulation on Wokwi
Spaghetti Wiring 😂
I used Wokwi to simulate my circuit & to test and debug my code before using any electronic components as it has all the components that I need including LCD screen with I2C and I can import the library needed for it to work so that after everything has tested in a simulation so I was already sure that once wire my circuit everything should run smoothly right away.
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
Amani showed me how use terminal crimping tool to make jumpers with terminal endings so I could connect the toggle switches & the bush button to the Arduino.
I had presented my project for all the Maker Diploma students in our last weekly meeting
Amani , Ibrahim, A. Saeed & M. Asker and the rest of my group had tested and enjoyed playing with my project and they all give my feedback and even ideas to enhance my project.
I happily helped my colleagues with their problems.
Also me and colleagues, we all like to talk and sharing knowledge & ideas.
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
While I was working on the GUI code using C# there was a library "System.IO.Ports" that I should use to communicate via serial port but when I try to use it give me an error that the library I need is not found and that strange for me as it should be already installed by default when the visual Studio is installed after some search I found out that in visual Studio 2022 the library I need is not installed and I have to install it manually.
I would enhance the GUI application and add more features.
I would search for a suitable battery add to the project.
I would work on iteration 2 of the project and design encloser and printed using 3D Printer.