The assignment for this week was to design and program a smart device that perform a certain function or solve a problem using Arduino C Text PRIMARILY to write my code in Arduino IDE.
I create a device that can determine the humidity and temperature of the around air.
Also it can detect any body in front of it and calculate the distance from the device to the body.
And there is 4 LEDs their light depend on the room light density.
I used Arduino IDE to write the code.
I used many components to create this device:
bread board
jumpers
Arduino UNO
4 LEDs (2 Yellows, 2 Reds)
I2C LCD display - to display all data
Ultrasonic sensor - to measure the distance
LDR sensor - to measure light density
DHT11 sensor - to measure temperature and humidity
Keypad - to deal with I2C LCD display
Cardboard
First step I searched how to deal with the keypad and I2C LCD display in Arduino.
I found many helpful tutorials and I make some experiments before starting the assignment
second step I start in the assignment only with these two components first (keypad, I2C LCD)
I include their library ("Keypad.h", "LiquidCrystal_I2C.h"), then I copied an example from Arduino examples and make some changes to the code to suit me
Third step I add the ultrasonic sensor and try to show the read on the I2c LCD display
also I copied the code of ultrasonic sensor from Arduino examples and use it in my code
Fourth step I add the DHT11 sensor and try to show the read on the I2c LCD display
Final step I add the four LEDs and control them with the LDR sensor
this is the code I write in Arduino:
(1)
(2)
(3)
(4)
(5)
while coding in Arduino I was connecting the components step by step till I connected to all together, after all things worked I start making enclosure using cardboard.
Finally the device worked, and I start using it...
this week my community of learning was the internet...
everything stuck with me I google it then I found someone make the same idea or explain how to use a specific component which I couldn't use.
first I couldn't use motor driver or relay module, then I google and I understand these components well
then I searched how to use the LCD to apply it in my assignment
at the beginning I didn't know what assignment I could make, so I just pick some components randomly and think of an idea that can combine between all these components till I managed to finish my assignment
I faced a problem with wiring the keypad the problem was in the order of wires, I had to try many times to get the right wiring, there is 3 columns and 4 rows each column and row has its own wire so I tried till I understand the sequence of wiring.
I faced a problem with the LCD display, I didn't know the we have I2C with the LCD display. So, when I searched about how to use LCD display I always found many wires and jumpers it was confusing. Then I note that there is a component connected to the LCD display, after searching I know it's I2C and I knew how to use it
I know better how to use ultrasonic sensor and LDR sensor and how to make a component react depending on their reading
Also I get more familiar with coding on Arduino which will help me a lot in my final project
I am so happy I managed to use sensor and use actuators or outputs to act depending on sensors reading, and building a user interface with LCD display was cool.
the coolest thing was to combine between what I learned to make my assignment
Title of Media