Week 6 - Journal

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What inspired you? (Please include images or links to sources of inspiration)

An Elevator numpad with LED display.

Image credit: iStock by Getty Images

Have you EVER had the opportunity to use an 'Elevator'? It's more likely that you saw the small LED that shows the number of the floor you want to go up/down to.

Typically, there the LED display is accompanied with a 'numpad' of the available numbers of floors at the building.

I'm thrilled to introduce you to a simulation to this LED and keypad combination using simple components in your maker's tool belt!

Tool Chain

Which software/machines/materials did you use in the assignment? Why?

Software:

Hardware:

  • Arduino UNO board

  • 3x4 keypad

  • Common Cathode 7 Segment Display

  • 5V adaptor (works safely with the 7 Segment Display in the presence of 220 ohm resistance per each LED segment)

  • Two screws adaptor plug

  • Jumpers wires

  • Eight (8) Resistances (220 ohm)

  • Breadboard

  • Digital Multimeter

Design/Preparation Process

Explain the design and/or preparation process of your assignment. How did you use the tool or software to design and/or prepare your assignment before fabrication/implementation?

I started to 'drag and drop' the components of the circuit in design workspace in Tinker CAD.

The 7 Segment display pins were connected to the correspondent pins in the Arduino board, and the display's common cathode was connected to the cathode rail in the breadboard, all, using jumper wires.

The rows and columns keypad's pins were connected to their correspondent pins in the Arduino board using male-male jumper wires.

A set of 'Eight' 220 (ohm) resistances were connected with the 7 Segment Display.

The '5V' and 'GND' pins in Arduino were connected with the common rail +Ve and -Ve in the breadboard.

The idea is when you press a given number (character) in the keypad, it's displayed on the 7 segment display for one second.

Before talking about coding, the working concept of the keypad and how Arduino controls it shall be demonstrated first as follows:

Explanation sources: link 1 and link 2


After comprehending the keypad's working concept and completing the connections between Arduino, keypad, and the display, I started use coding blocks to control the display using the keypad.

I created this MS Excel sheet to help me connecting the right pins of Arduino, 7 segment display and keypad while coding using blocks. Besides, I searched for how numbers are displayed by the 7 segment display and which LEDs are to be lit to display given numbers; this link and this link are really helpful!

Screen shots for the coding blocks in Tinker CAD are shown below ๐Ÿ˜„

Circuit simulation on Tinker CAD can be viewed from the video below ๐Ÿ˜„

Control 7 segment display with Arduino keypad using coding blocks.mp4

Development/Implementation Process

Explain the development/implementation process of your assignment. How did you use the machine/tool to manufacture or implement the design of your assignment?

I started to connect all components on breadboard as per Tinker CAD wiring as shown below

Afterwards, I copied the code text from Tinker CAD to Arduino IDE software and performed the compiling check.

Code text is as follows:


int Button = 0;


void setup()

{

pinMode(5, OUTPUT);

pinMode(4, OUTPUT);

pinMode(3, OUTPUT);

pinMode(2, OUTPUT);

pinMode(1, OUTPUT);

pinMode(0, OUTPUT);

pinMode(A5, OUTPUT);

pinMode(A4, OUTPUT);

pinMode(1, INPUT);

pinMode(9, OUTPUT);

pinMode(11, OUTPUT);

pinMode(6, OUTPUT);

pinMode(7, OUTPUT);

pinMode(8, OUTPUT);

pinMode(0, INPUT);

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(A5, INPUT);

}


void loop()

{

digitalWrite(5, LOW);

digitalWrite(4, LOW);

digitalWrite(3, LOW);

digitalWrite(2, LOW);

digitalWrite(1, HIGH);

digitalWrite(0, HIGH);

digitalWrite(A5, HIGH);

digitalWrite(A4, HIGH);

// Column one: #1

if (digitalRead(1) == LOW) {

digitalWrite(5, HIGH);

if (digitalRead(1) == HIGH) {

digitalWrite(9, HIGH);

digitalWrite(11, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(9, LOW);

digitalWrite(11, LOW);

}

// Column one: #4

if (digitalRead(1) == LOW) {

digitalWrite(4, HIGH);

if (digitalRead(1) == HIGH) {

digitalWrite(9, HIGH);

digitalWrite(6, HIGH);

digitalWrite(11, HIGH);

digitalWrite(7, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(9, LOW);

digitalWrite(6, LOW);

digitalWrite(11, LOW);

digitalWrite(7, LOW);

}

// Column one: #7

if (digitalRead(1) == LOW) {

digitalWrite(3, HIGH);

if (digitalRead(1) == HIGH) {

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(11, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(11, LOW);

}

// Column two: #2

if (digitalRead(0) == LOW) {

digitalWrite(5, HIGH);

if (digitalRead(0) == HIGH) {

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(6, HIGH);

digitalWrite(13, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(6, LOW);

digitalWrite(13, LOW);

digitalWrite(12, LOW);

}

// Column two: #5

if (digitalRead(0) == LOW) {

digitalWrite(4, HIGH);

if (digitalRead(0) == HIGH) {

digitalWrite(8, HIGH);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(8, LOW);

digitalWrite(7, LOW);

digitalWrite(6, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

}

// Column two: #8

if (digitalRead(0) == LOW) {

digitalWrite(3, HIGH);

if (digitalRead(0) == HIGH) {

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(13, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(13, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

}

// Column two: #0

if (digitalRead(0) == LOW) {

digitalWrite(2, HIGH);

if (digitalRead(0) == HIGH) {

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(13, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(7, LOW);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(13, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

}

// Column three: #3

if (digitalRead(A5) == LOW) {

digitalWrite(5, HIGH);

if (digitalRead(A5) == HIGH) {

digitalWrite(6, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(6, LOW);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

}

// Column three: #6

if (digitalRead(A5) == LOW) {

digitalWrite(4, HIGH);

if (digitalRead(A5) == HIGH) {

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

digitalWrite(13, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(8, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

digitalWrite(13, LOW);

}

// Column three: #9

if (digitalRead(A5) == LOW) {

digitalWrite(3, HIGH);

if (digitalRead(A5) == HIGH) {

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(8, HIGH);

digitalWrite(9, HIGH);

digitalWrite(11, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

}

// Column three: #

if (digitalRead(A5) == LOW) {

digitalWrite(2, HIGH);

if (digitalRead(A5) == HIGH) {

digitalWrite(6, HIGH);

digitalWrite(7, HIGH);

digitalWrite(9, HIGH);

digitalWrite(11, HIGH);

digitalWrite(13, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(6, LOW);

digitalWrite(7, LOW);

digitalWrite(9, LOW);

digitalWrite(11, LOW);

digitalWrite(13, LOW);

}

// Column one: *

if (digitalRead(1) == LOW) {

digitalWrite(2, HIGH);

if (digitalRead(1) == HIGH) {

digitalWrite(6, HIGH);

digitalWrite(8, HIGH);

digitalWrite(12, HIGH);

delay(1000); // Wait for 1000 millisecond(s)

}

} else {

digitalWrite(6, LOW);

digitalWrite(8, LOW);

digitalWrite(12, LOW);

}

}

A real circuit simulation is shown in the video below after uploading the code to the Arduino.

VID_20220225_001156.mp4
VID_kp2.mp4

Community of Learning

Did you ask for feedback? What are the ideas that others have contributed or suggested? What was someone elseโ€™s idea that you built upon? How did you help your peers? How did your peers help you?

I found a question via the #community-troubleshooting Slack channel from Huda as she wanted to also use the keypad for controlling a motor movement through pressing a certain button with the help of Arduino of course. I connected with her via Slack and offered the help to get the code done, as I think it has the same concept with my assignment here with slight differences regarding output connections and coding blocks.๐Ÿ˜„

Overcoming Challenges

When you got stuck, what/who did you turn to? At what point did you have to pause to research or learn more before moving on? What are some mistakes, pitfalls, or challenges that others can avoid if they were doing this assignment?

My first attempt ๐Ÿ˜…

I tried a lot to figure out how to code using blocks only to control the keypad with Arduino. My first trail (as shown on right) approached the task without turning off the specific LEDs after displaying the desired number, which resulted in many errors of distracting output(s). I searched a lot of websites and YouTube as well, but all available resources were using text coding rather than coding blocks. Eventually, I had an idea ๐Ÿ’ก to connect with the students of the previous batches who used the keypad for their final projects and and ask them for their thoughts and suggestions. I used the website of Maker Diploma to find the right person, and luckily I found two students and I started to chat with one of them, Aya, via her LinkedIn profile and guess what? her feedback was really helpful; thus, I managed to control the keypad with Arduino using the coding blocks only!๐Ÿ˜„

Final Project

How can you use the skills and knowledge that you've acquired this week in your final project?

Wiring Membrane-Keypad-with-Arduino

One of the essential features of my final project is to store the reorder level of the monitored inventory item. Besides, a password is necessary for device settings protection against un intentioned settings modifications. All of this wouldn't be done without using the keypad, so I took this opportunity to learn more how to use and control the keypad with Arduino.

WOW!

What is the coolest thing that you've learned this week? What is something that you will never forget from this week?

I learnt how to control a servo motor with a potentiometer to perform a 'waving' movement using coding blocks only ๐Ÿ‘‹ ๐Ÿ‘‹

EOW session exercise trial - waving hands manual mode.mp4

Weekly Digest [OPTIONAL]

Tell us about any other cool things that you've made this week: in the Hands-on activity, tutorial examples, exercises, or any other cool mini-project that you tried out aside from the assignment.


Title of Media

Assignment Design Files