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)
This week's assignment is to build and program a smart circuit using an Arduino UNO which reads a signal from an input component (Sensor, Switch, or variable resistor) to control an action component (Motor, Buzzer, LED...etc) using Code Blocks.
I chose to implement for my final project idea, also, I browsed through Instructables and Arduino Project Hub to get inspired and I found some similar projects to mine like this, this, this, and this one.
Tool Chain
Which software/machines/materials did you use in the assignment? Why?
Software:
Arduino IDE: To write the codes responsible for programming Arduino compatible boards.
TINKERCAD (website): to predict and test the output of your circuits before implementing them in real life
*TinkerCad is a simple website that provides the feature of simulating electronic circuits., as well as provide explanations to some of the wiring problems that result in damaging the components in your circuit during simulation (i.e. if the current passing through a component is larger than what it can handle, etc.)
Electronics components
3 Resistor (220)
LM35 Temperature sensor
RGB LED Light
Breadboard
Arduino UNO Board
Jumper Wires (per need)
Design 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?
Explaining the idea:
The main idea of my final project contains three parts: Sensing the temperature of a cup and indicating it with LED lights, Setting the personal mode, sound alert using a buzzer.
I chose to implement the first and the main part which is Sensing the temperature of a cup and indicating it with LED lights. which is divided into 5 stages of temperature variables. Arduino begins to senes these temperature variables and indicates them in colors
First stage: when the temperature is below 15c, then the LED's color is BLUE which indicates that the cup is very cold "iced".
Second stage: when the temperature is below 20c, then the LED's color is CYAN which indicates that the cup is getting cold.
Third stage: when the temperature is below 25c, then the LED's color is GREEN which indicates that the cup is at the perfect temperature.
Fourth stage: when the temperature is below 30c, then the LED's color is MAGENTA which indicates that the cup is warm close to hot.
Fifth stage: when the temperature is above 30c, then the LED's color is RED which indicates that the cup is burning hot.
Simulating the circut on Tinkercad
Circuit design:
Before implementing the circuit in real, know how the circuit should work and what are the expected outputs. after I set all the components, I started to assemble the components to the circuit.
First: know how the components of the circuit should be connected. *check the components' datasheets if you don't know
I made sure to connect each RGB LED's color with a current limiting resistance, and connect each of them to a different Arduino pin (red goes to pin1, blue goes to pin2, green goes to pin3 and cathod goes GND Arduino pin) *using the wire color coding, mad e it easy while programming the code. The purpose of the circuit is to make the Arduino board the main controller of the circuit, to control the colors individually, and to implement the temperature variables.
I connected the temperature sensor to the breadboard and wired it to the Arduino, (GND goes to GND Arduino pin, power goes to 5v Arduino pin, Vout goes to A0 pin) *the temperature sensor is an analog item so it's connected to Arduino's analog pins.
Note: In TinkerCad simulation, there isn't LM35 temperature sensor, so I used TMP36 instead.

Coding design:
I use Code Blocks sekchen to build the code in TinkerCad.
Explaining the code:
The first step is: Read the temperature sensor on pin A0 in the celsius unit. If the temperature is below 15c, the Arduino board should Set the output pin connected to Pin2 to be HIGH, which means ON, and the other two pins to LOW to turn them off. This will make the LED's color is BLUE and indicates that the cup is very cold.
Second: If the temperature is below 20c, the Arduino board should Set Pin2 and Pin3 to HIGH, and the other pin to LOW, to turn it off. This will make LED's color is CYAN which indicates that the cup is getting cold.
If the temperature is below 25c, the Arduino board should Set only Pin3 to HIGH, and the other two pins to LOW, to turn them off. This will make LED's color is GREEN which indicates that the cup is at the perfect temperature.
If the temperature is below 30c, the Arduino board should Set Pin1 and Pin2 to HIGH, and the other pin to LOW, to turn it off. This will make LED's color is MAGENTA which indicates that the cup is warm close to hot.
Finally: If the temperature is above 30c, the Arduino board should Set only Pin1 to HIGH, and the other two pins to LOW, to turn them off. This will make LED's color is RED which indicates that the cup is burning hot.
*To make it easy and fast, After one block is completed, I right-click on the first block in the sequence and choose Duplicate, then I changed the temperature variables.
Then, I copied the Arduino C code into Arduino IDE, and uploaded it to the Arduino Board.
Uploading the code to Arduino Board:
After the simulation proves there are no more problems within the circuit, I change the viewing style of the code from code blocks to block+text and download the text file of the program in the .ino format to my computer.
Find the downloaded file and place it inside a folder with the same name for Arduino IDE to be able to open it. don't worry if you forget this step, once you double click on the file, Arduino IDE will ask you to create the folder.
*you can skip this step and just copy/past it directly into IDE.
Opened the file in IDE and verify the code. Chose the type of Arduino Board I have (UNO) and made sure that the port of my Arduino board is connected to the laptop from the tools menu.
I changed some of the code 'cause in the TinkerCad simulation I used a different sensor.
Finally, Upload the code to the Arduino board and it's done.
Preparing Process
Wiring the circuit on the physical breadboard and connected it to the Arduino UNO board.
I connected each RGB LED's color with a current limiting resistance,
connect each of them to a different Arduino pin. (red goes to pin1, blue goes to pin2, green goes to pin3)
I connected LM35 to the breadboard
then I connected it to an analog pin (A0) on the Arduino board
Finally, connected them all to a common GND and VCC from the Arduino.
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?

final implementation and prototype

serial monitor readings
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?
Wiring electronic components and coding are a little confusing, especially 'cause I am not previously familiar with the specifications of some components, as I failed to complete the Hands-on and Midweek activities in the right way, also it was diffecult for me to troubleshooting in the assignment :(.
didn't know how to arrange the code and what blocks should I use.
using the same code block in IDE although the sensor I used in the semulation is different from LM35, so that it failed in real testing
connecting RGB LED in wrong polarity.
connecting the color wires in a wrong way.
syntex wrongs in the code.


Error in color indicating because of RGB's wrong wiring of the color legs
It should start with the green color but it starts with cyan, also Ithe "Magenta Part" the color didn't turn to a magenta color.
so, I changed the wiring polarity between the green and the blue leg. (2:40 m the second video)

A beep sound came out of no where I didn't know why it apairs
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?
Because wring electronic components and coding were a little confusing for me, My instructor help me and walk through the assignment and the activities with me, and during the Midweek and EOweek session, we ended up discussing certain input devices wiring and the problems that arise when connecting them.
ABDELRAHMAN SIDKI shared this link with me, so I could understand how to program the sensor
Final Project
How can you use the skills and knowledge that you've acquired this week in your final project?
This assignment aims to learn how to control components by Arduino board through input triggers. This gives you more control over the components in your circuit and the ability to program each one of them individually to do certain tasks, That will help me controling my final project components as I need. In my final project, I tend to use a temperature sensors which I got to learn about through the exercises.
WOW!
What is the coolest thing that you've learned this week? What is something that you will never forget from this week?
I liked the temperature sensor coding and simulation part, also, I enjoyed the outcome of the EOweek session, especially the automatic mode. I was proud of myself 'cause I made it all by myself. XD
make sure that the polarity of the component is right, in order not to burn the component.
*I connected the sensor in the wrong way and it heated up.
Weekly Digest
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.
In the EOWeek session, we were asked to Build and Program a Smart Waving Hand using Arduino in two modes separately:
Manual Mode: In this mode, a single servo motor (as an Output) is controlled manually by using a potentiometer (as an Input).
Automatic Mode: In this mode, a single servo motor (as an Output) is controlled via signals received from an ultrasonic sensor (as an Input).
The process:
I Built and coded the two Modes on Tinkercad using Code Blocks. Then I built and tested the circuits for each of the Two Modes with a physical breadboard and an Arduino Board.
For the Hand sample: I Made a simple hand cutout using paper and fixed it on the Servo Motor horn using sellotape. Then I fixed the servo motor (with the Hand) on the edge of the electronic-kit box using sellotape.
Electronics components & Materials I used:
Breadboard
Arduino UNO Board
Jumper Wires (per need)
Potentiometer
Servo Motors
Ultrasonic Sensor
Paper & scissors & Pencil & Sellotape
Manual mode wiring diagram & code blocks
Automatic mode wiring diagram & code blocks
Manual & automatic circuit implemented on the physical breadboard and connected to the Arduino board.

Manual mode simulation

Automatic mode simulation

Manual mode outcome

Automatic mode outcome
Note: It was a Rainy day, I couldn't attend to IN-Person session, So I attended it as an Online session and I did the assignment with them individually and I did all the steps on my own.
Assignment Design Files
Assignment file