Week 6 - Journal

Ideation

Tell us about your assignment's idea for this week. Why do you care about this idea? What were you inspired by?

This week's assignment idea was to design and build Program an Arduino UNO to read a signal from an input component (i used 2 push buttons) to control an action component (i used DC motor and LCD I2C) using Code Blocks.

My inspiration for this idea was my first feature for my final project, that is to control the DC motor with 2 push buttons to move the filament in "3D Fab Pen" forward or backwards (concept:Controlling DC motor: Setting DC Motor Direction and Speed - Using L293D Motor Driver with 2 inputs). also gave a touch of complete user feature to program the LCD with it, so that it can read the direction of the motor .(checkout this video)

i cared a lot about this idea as i wanted to challenge myself to explore new ideas with new components, at the same time preparing for my final project by doing one of it's feature efficiently.

Tool Chain

Which software/machines/materials did you use this week? Why?

This week i was introduced to a new software "Arduino IDE", which is simple easy to use/learn programming .
(The Arduino Integrated Development Environment is a cross-platform application that is written in functions from C and C++. It is used to write and upload programs to Arduino compatible boards, but also, with the help of third-party cores, other vendor development boards )
Tinkercad- was also part of big help to learn this new software, as it is easy to use "code blocks" and copy the code to upload to the board.

Last but not the least, programming helped me to automatically control outputs by given instructions, also by various inputs. For that i was able to explore more new components which can only used by programing like:
1) LDR module - which is more effective in taking light sensitive inputs to give more accurate result.
2)ultrasonic sensor module- which can read distance of an object by emitting ultrasonic waves for certain amount of time, then the distance is calculated by the coding automatically to give accurate results.
3)Microwave sensor/ IR sensor- both sensors has the same concept of detecting movement in certain range.
4) L293 Motor Driver- Controlling DC motor: Setting DC Motor Direction and Speed
5)LCD i2c- this was also explored as enthusiast in this field by the help of this
website.

All these amazing encounters are shown in this video.

Design Process

Explain the design process of your assignment. How did you use the tool/software to design and/or simulate your assignment?

For this week's assignment i used 2 types of code writing method.

1) Code Blocks- simple way of writing a code.
A- After designing the circuit on "Tinkercad", i clicked on "Code" tab on top right corner to open the code block section.
B- First deleted in built code blocks, and then started by choosing blocks from the left column.
C- Used "set pin 10 to 100" block from output tab, to set the speed of DC motor by controlling its current.
D- selected "IF" condition from "control tab", and adding in the title from "Math" tab equal equation that from input " read signal from pin 9 "which is the input of push button and added its equal to condition that's its on by adding "High" from "Math" tab.
E- Added first condition of "IF" from output tab- "to print certain characters on monitor" (i used this code to help me with codes for LCD). also to give output for DC motor which is set on pin 8 to be High.
F- As for the second condition for "IF" which is below "ELSE" i set the DC motor to be off, so only when input is given the DC Motor will work or else does not work.
G- Copy paste the "IF" condition blocks to set for my other push button and changed the pin value in each.
H- opened the "Blocks + Texts" from drop down menu to view the code and copied it and went to only "Text" tab so that i can make changes in that code manually. (added Pullup for push button inputs.)
I- as for simulation of LCD in tinkercad was different i had to use normal LCD without i2c code which i already used and copy pasted from tinkercad in built circuit.
J- merged both codes manually and simulated to get my results which is shown in this video. (arduino tinkercad code)

2)Writing the code manually in "Arduino IDE" software.
A- Opened the application and into new page.
B- Copy pasted my tinkercad text code in it with lcd codes also.
C- Deleted all codes regarding LCD on the top only and added on my own "libraries" for LCD i2c which are as shown in the picture.
D- Wrote some additional manual codes to meet my expectations. like:
added Pullup for push button inputs.
lcd.init();
lcd.Blacklight():
lcd.print("Pushbutton");
All was learned by the help from this website.
E-
Verified my code first by compiling the sketch from top left arrow button, to check for any errors.
F- When all was ready, i finally connected my Arduino UNO board with usb cable and checked that the Application read it correctly, then finally pressed the "Upload" button to transfer the code the board.

Fabrication/Implementation Process

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

I decided for my assignment to be without other fabrication method (except for actual building the circuit) as the result will not be shown clearly. (it was meant to be inside my "3D Fab Pen" cardboard prototype).

1) Fetched my components from the kit.(as shown in the pictures above)
2) Connected vcc 5V from the Arduino board to the + row of the breadboard, same for the ground from board to - row of the bread board.
3) On the breadboard i inserted 2 Push buttons (on on the 25th column and other on 30th column)
4) connected one end of each push button to the ground row on the breadboard, and the other to the Arduino board digital pin 9 and 10.
5)Added my LCD i2c (4 pins):
A- to the + row of the bread board, to give power of 5V.
B- to the - row of the bread board, to connect lcd to the ground.
C- remaining 2 wires were inserted in A4, A5 analog input as instructed in week one for assembly of the game kit.

6)As for the DC motor, it was connected to L293 motor driver module. and in that module external 9V adapter power for enough current for Motor to run. also connected ground pin. as for the connection of the board 3 pin were used.
A- to set the speed of the motor , by connecting it on Arduino board pin 3
B- other two pins for the direction of the motor, were connected to pin 5 and 6 respectively.
7)Powered on the adapter and the Arduino board so get the final result.

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?

During this week i asked for feedback from my peers and specially from my instructors along the week.
Many ideas were contributed such as instructor Menna frequently replied to my questions, and other peers were able to contribute there ideas. i.e. building circuit diagram for Controlling an LED with an input signal from a temperature sensor (LM35) , which i had used the wrong component. :)
Built upon my instructor's and fellow peer's idea i finally able to build circuit successfully.
Also was able to help my fellow peers also by giving suggestions and feedback throughout the sessions, nevertheless by helping out in anyway possible as shown in the picture.
My peers also are kind enough to help me out throughout my week by giving me support and feedback- as i am professionally new to programming, some advance features like defining certain things( making a container) was not clear to me. like using Float or #define or int. so my instructor and fellow peers helped me to give their extra support in explaining it to me in more details.


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 project?

This week was amazing and full of challenges and got stuck every step, i will discuss here the few main major ones.
1) in the assignment i wanted some specific results which was leading to complex code writing - so i had to stop and research a lot (specially for lcd codes) and also makes many trials before getting successful result.
2) I couldn't able to build actual building circuit diagram for Controlling an LED with an input signal from a temperature sensor (LM35), as i thought that the thermistor was temperature sensor :). which was finally cleared in the sessions and i finally was able to make one.

Silly mistakes by me was many i would recommend the readers to find their passion and enthusiast in this field, so that the learning method practically will be a bonus point and you will definitely have fun.
Also don't hesitate to learn new things by yourself.

Final Project

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

The deep knowledge about writing codes in various ways, also exploring more components helped me in practicing for my final project writing code feature, as they say "Practice makes perfect". i had gained lots of confidence in writing codes by blocks and begun to write it manually which is the end meet requirement.

WOW!

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

The pleasure to experiment and explore new sensors, i had so much fun with the kits and equipment that for fun i tried many different experiments as shown in this video. (this encounter of fun will never be forgotten)

Weekly Digest [OPTIONAL]

Tell us about any other cool things that you've made this week: Pre-activity, examples, exercises, or any mini-projects.

Activity for this week was very cool as it was challenging as it was involved writing codes and programming Arduino board.
without any professional background i was asked to make:
Play music with a simple push of a button! Control a Buzzer using Arduino. (For this activity you are required to build and simulate the project on TinkerCad ONLY).
also
Experiment: create your own symphony! Play around with the code and change the tones to create your own music.
Enjoy the music :)

Assignment Design Files