Our assignment for Week 6 involves building and Programming a smart circuit using an Arduino UNO which reads a signal from an input component to control an action component using Code Blocks.
I chose to make a smart fan with one input and two different types of output components. When the temperature of the room become high, the fan works and the temperature of the room displays on the lcd.
Here's a list of software, machines, and materials I used for the assignment:
Tinkercad software for simulating
Arduino IDE
Temperature sensor
Avometer for troubleshooting
fan
Breadboard
LCD
Arduino uno with cable
RCA female
jumpers
5V adaptor
Tinkercad simulation Process:
In this project, I used temperature sensor as input and fan and LCD as outputs.
I used Arduino UNO to control my circuit.
I used breadboard to mount electronics and wires on it.
I connected the fan with pin 9 (signal) and the GND of Arduino.
I connected the LCD with the GND and VCC of Arduino, and connected SDA with pin A4 and SCL with pin A5 of Arduino.
I connected the temperature sensor with the GND, VCC and pin A0 of Arduino.
Finally, after simulating the circuit and uploading the code on Arduino, I used the power supply (5v - 2A) as power source.
the simulation of the circuit when the temperature is lower than 30 degree
the simulation of the circuit when the temperature is higher than 30 degree
Coding Process:
if temperature is higher than 30 degree, put the value of this new temperature in variable called "temp" and print this value in lcd in second row, and in the first raw print "temperature is".
Also, turn on the fan in pin 9.
if temperature is lower than 30 degree, turn off the fan and clear the lcd from the text.
the code blocks of the circuit
I connected the input (temp sensor) and outputs (fan - lcd) with arduino using breadboard as shown in tinkercad simulation:
I connected the fan with pin 9 and the GND of Arduino and connected the LCD with the GND and VCC of Arduino, connected SDA with pin A4 and SCL with pin A5 of Arduino and connected the temperature sensor with the GND, VCC and pin A0 of Arduino using breadboard. then I uploaded the code using the cable.
Demo of the circuit
I'd like to offer some advice when working with the temperature sensor. It's better to connect it using wires instead of fixing it to the breadboard, making it easier to control and isolate from other wires.
Another valuable tip I received from one of the lecturers is to heat the sensor using steam instead of direct flame to avoid damaging it.
One of the problems I encountered was with the LCD display. When I connected it to the Arduino, the text was not visible. However, when I adjusted the display's contrast using the screw at the back (as shown in the picture), the text reappeared.
This week, I learned how to make electrical circuits using arduino and coding, how to troubleshoot your circuit to detect the problem, and how to simulate your circuit first.
I encountered some problems and learned from them, so I think I will use them effectively in my final project.
Besides the hands-on learning experience, I thoroughly enjoyed the journey, absorbing valuable tricks and gaining in this week. The team spirit with fellow colleagues – sharing advice, capturing moments, laughter, and encouragement – created unforgettable memories.
We made this smart waving hand for end of week session 😍🤩