This week's assignment was to build and program a smart circuit using an Arduino UNO which reads a signal from at least 2 input components to control at least 2 action components using text code (Arduino C).
Since we were approaching the final project, I decided to include more components of my final project to understand how it will work and to lessen the load on myself in the future. I decided to add a switch and an LED bulb to the IR sensor and the servo motor that were already in last week's circuit.
The software used for this assignment is Arduino.
The materials used for this assignment are:
Breadboard
Arduino UNO
Jumpers
Servo Motor
IR Sensor
LED
On/Off switch
Crocodile wires
220 ohm resistor
Laptop
Kaleidoscope cardboard prototype
Kaleidoscope prototype
Arduino
Since I had already done the first part of the circuit before, I remade the circuit on the breadboard and then added the new components. I also changed the code so that it would work the way I wanted it to.
Since I had already done the first part of the circuit before, I remade the circuit on the breadboard and then added the new components. I also changed last week's code so that it would work the way I wanted it to.
I included the servo motor library to the code, put the IR sensor on a digital pin and made it an input device, and made the servo motor as the output. I also added the switch as an input device and the LED as the other output device.
The switch turns on the circuit then when the IR sensor senses something in front of it, the LED lights up and the servo motor starts to rotate. (as shown in the demo video below)
After I tested out the circuit on Tinkercad, I started assembling it in real life on my breadboard first before adding it inside the enclosure.
At first, I tested out the components to make sure that each one works on its own then I started assembling the circuit altogether. I connected the servo motor using jumpers, the LED and the resistor on the breadboard and with jumpers, the switch with crocodile wires and jumpers and finally the IR sensor was connected using jumpers. All of these components were connected to the Arduino using jumpers and the Arduino was connected to my laptop using the USB cable.
After I built the circuit on my breadboard and adjusting the code, I made sure that it is working.
After I built the circuit on my breadboard and adjusting the code, I made sure that it is working.
Then I started to include the components onto the prototype and fixing the wiring to ensure that everything is still working they way they should.
Since the previous enclosure did not meet the assignment's requirements, I had to make another one which resulted in making the circuit on the mini breadboard for it in the new box.
Then I mounted the circuit in the new box and made sure it worked.
I had a problem with understanding how to start typing up text code on my own, I couldn't figure it out. I couldn't comprehend the syntax and the language we use for coding and I also didn't know to translate the sequence I had in mind into actual text code.
During the mid-week session, I asked Sherif about that and he helped me a lot by providing several links and tips and tricks to follow in order to make it easier. I also asked Merit and she helped me a lot with the assignment. Amr also was of great help after the mid-week session as I did not fully grasp the code we used but he helped.
The biggest challenge in this assignment was the coding part as mentioned before and mounting the components on an already existing prototype. The most valuable lesson I learnt this week was that I had to practice, keep an open mind and have patience with electronics.
This assignment was practice for the actual implementation of parts of the final project. Learning how to control a servo motor using and IR sensor helped me figure out how the rotating disk will rotate on its own after sensing the eye presence.
Learning how to compile two different codes together and to be able to switch between Manual mode and Automatic mode.
Monday, 21st of February, 2022
In this week's "Hands-on, Minds-on" activity we were asked to build our first smart lamp.
I followed the steps written on the portal and made the circuit. However, I did not understand nor have time to complete the rest of the activity unfortunately.
Wednesday, 23rd of February, 2022
During Wednesday's mid-week session, we played a game as an ice breaker which was "Where's Waldo?". Then, we moved on to the activity which was posted on the portal. I was paired with Merit, we started first by searching about how the LM335 component works with the Arduino and the code required for it to work as asked. The biggest problem we faced was also the typing of the text code.
The second activity was finding the bug in the codes which was extremely helpful moving forward.
Saturday, 26th of February, 2022
In this week's end-of-week session, we spent the first hour discussing with Sherif every issue and question we had regarding the videos on the portal. Then, we were asked to make a smart home using Arduino (once manual (with push buttons and another automatic with an LDR sensor and a DHT 11 sensor) using relays for both modes. I was paired up with Mohab and we started working. We started by researching about the relays and how they work and we also then researched about the DHT 11 sensor to be able to connect them all together. Thankfully, we managed to finish the task on time and we only faced minor challenges that were easy to handle.