Combination Lock – Dario N (Week 4)

Goal of the Project:

The intention with this project was to learn about the capabilities of Arduino and how this platform connects to analog mediums. In this particular case, the proposal was to unlock a green LED by pressing 4 buttons with a programmed sequence. If the sequence is not pressed in the correct order, the red LED will turn on or the system is still locked.

List of Components:

  • x1 Arduino Uno
  • x1 Breadboard
  • x4 Pushbuttons
  • x6 220 kohm Resistors
  • x1 RED LED
  • x1 GREEN LED

Assembly Process:

The circuit is made of from 4 Buttons and 2 LEDs. All the components are connected in series with 220kohm resistors (in the case of the buttons, they help the charge to drain away when the button is released, for the LED, they help to limit the current flow to a safe level to the LED). Each button (INPUT) component is connected to the digital pins, and the LED (output).

How it works:

The Arduino program is constantly reading if a button is pressed and it’s telling it the sequence is correct or not. if it’s correct (true) and the previous button pressed is correct (true), then the green LED will light up; if not, until the buttonlenght (number of presses-4) is true, then the Red will turn on.

Problems:

This program is based on a program I found on internet (https://www.youtube.com/watch?v=7HeT4wvgz7w). The challenge consisted in getting to understand the code (I’m fairly new at coding), and to modify it to be more understandable and to function with the required components we had in the brief.

Circuit Diagrams:

Arduino Code (File):

https://www.dropbox.com/s/28b1s6tkrl9ltfu/Combination_Lock.ino?dl=0

Leave a Reply

Your email address will not be published. Required fields are marked *