Project 1 Documentation
In this project, I decided to create a combination lock which lights up a green LED if the ineracting person pressed a series of buttons in the correct order, and a red LED if the person makes a mistake anytime during the process. I also tried to add in a servo motor while working on the project, but faced some challenges and didn’t end up including it for the time being.
List of Materials Used
For circuit: Full size breadboard x 1; Arduino Nano V3.0 x 1; pushbuttons x 4; LEDs x 2 (red & green); 220 ohms resistors x 2 (for LEDs); 10K ohms resistors x 4 (for pushbuttons); jumper wires
For project housing: 4mm foam board; acrylic paint; mini flowers for arts and crafts; miniature fences; bunny and tiger miniature animals (for video); styrofoam glue; double-sided tape
I started out by visualizing the circuit and breadboard digitally in Fritzing, and updated the breadboard after making adjustments and working on the code. Bellow is the visualization of my circuit:
Planning out the circuit was fairly straight forward to me, but it took me quite a while to figure out the code. I searched online and in the Arduino project hub to find references to refer to, which I find very helpful as they allowed me better understand the logic of applying conditionals to multiple pushbuttons. I was then able to layout my code through applying the logic of the references.
Bellow is the final code which works with my circuit:
Building My Circuit
Testing My Circuit with Code
The photos above show the red and green LEDs lighting up after the wrong(red)/correct(green) buttons were pressed. In the video above, the wrong buttons were pressed during the first try and second try, causing the red LED to light up immediately after a wrong button was pressed. In the third try, the buttons were pressed in the correct order (b3, b4, b2, b1), which triggered the green LED to light up. The circuit rests itself right after a wrong button is pressed (the red LED lighting up), and is also resettable once it has done its task (the green LED lighting up) by pressing on any of the buttons.
Building an outer box: I decided to build an outer box for my project using 4mm foam board since it happened to be the material accessible to me (as I currently don’t have access to any fabrication lab and have very limited tools around me). I measured the height of my LEDs after placing them onto the breadboard and built the height of my box according to the this measurement as I want to have the LEDs popping out and laying exactly on the lid / on top of the box. I also tried to get measurements of the placements of both the LEDs and the 4 pushbuttons as accurately as possible and poked holes for them respectively on the lid.
Testing circuit in the box: I find the jumper wires slightly annoying as I had to push them down a little and also make sure I don’t accidentally disconnect or mess up anything during the process. But other than that, the holes worked perfectly with my LEDs and pushbuttons and I didn’t face any issues after putting my breadboard inside the box. The video bellow captures me testing the circuit inside with a pencil:
Painting my box: I used acrylic paint to cover the foam boards creating a front yard environment with grass and a walk way. I also planned on making a mini 3D house and place it at the end of the walk way. Adding onto the environment, I was able to obtain miniature fences and flowers and decorated the environment with those. I also created and attached stems to 4 flowers (with foam board) for them to be placed into holes for contacting the pushbuttons (and be able to be pressed).
Putting it together: I mainly combined the painted foam boards with styrofoam glue and tried to make my environment look fairly polished. The 2 LEDs are placed beside the door of my house to indicate it being unlocked or not as the 4 flowers get pressed. The 4 flowers (with the stems) are attached to the pushbuttons underneath with a little bit of glue to prevent them from tilting off the pushbuttons. I also happen to have a few miniature animals lying around and thus created the house for my bunny (shown in one of the images bellow) with an open-able door according to its size.
Challenge Faced – Incorporating a Servo Motor
I thought about incorporating a servo motor as an additional output to the LEDs while building the project housing, for it to create a physical opening movement of unlocking / opening of the door of the house as the green LED lights up. However, I realized that my house is fairly small and thus wasn’t sure how to manage to include the servo motor inside (as it doesn’t fit). I ended up temporarily scratching this idea as I wasn’t able to figure out the fabrication due to my size constraints affecting the motion / movement, and with the short time frame I had. Despite not being able to successfully incorporate a servo motor to add in a physical movement to the output before my in class demonstration and presentation, I focused on create an indication of a door unlocking (as the green LED lights up) through creating an environment for my circuit with its outer housing.
Final Project Presentation
I wanted to create a narrative for my combination lock circuit and thus ended up building a house and yard for my bunny. To show how my circuit works along with its purpose, I decided to create a short stop-motion video demonstrating my combination lock. I captured my bunny pressing the four flowers according to the correct sequence (yellow, pink, blue, purple), successfully unlocking the door (with the green LED lighting up) and entering into its house. I included another miniature tiger and set it as the “villain” character, capturing it trying to unlock the combination lock but failing to do so (as the red LED kept on lighting up). The tiger was not able to unlock the door and the bunny was able to stay safe inside the house. Bellow are a few frames (out of the total 180-ish images) which I used to create my stop-motion video:
The final stop-motion video is at the very top of this project documentation blog post. Overall, I wanted to create a context for my combination lock and thus thought of putting together this short narrative to demonstrate it with a bunny and tiger. I focused on trying to embed the circuit into my environment through hiding the breadboard underneath, attaching flowers to the pushbuttons, and only showing the 2 LEDs from my circuit. Despite not ending up adding in a servo motor as the output along with the LEDs for this project, I tried to represent the “combination lock” aspect and purpose through the set up of my environment, bunny character, and my video.
Project Update – Incorporating a Servo Motor
I struggled to get the servo motor to work prior to my project presentation but tried to come up with an alternative solution to incorporate it afterwards. Since the house is too small to fit servo motor with its turning motion inside, I tried connecting the fan of the motor to a stick (with tape temporairily) and letting the stick extend inside to poke open the door instead. After testing the movement, I realized I only have enough space for the motor to turn roughly 45 degrees (as the stick would hit the wall and get stuck with a larger movement). After adjusting the degrees and placement, I was able to get the stick to push open the door a little (indicating the door unlocking), but felt that I should plan in the movement at the beginning stage of the project to design a housing that works better with it. Bellow are some photographs of me testing the movement with the servo motor on the outside (removing the back wall of the house) and stick extending inside: