“The World Of Arduino”
At this phase of diploma, we were required to dealing with Arduino and in this week we begin programming using code blocks in Tinkercad. Which was very interesting to me, so the assignment was simply about making an output programmed in Arduino from an input.
Inspired by Alfred, the English butler and Palace manager for Bruce Wayne (Batman).
For me, I choose to make a Smart Home Assistance that can control the lights, air conduction, protect important things and even can prepare the car for me before going out*. :D
And all of this can be done wirelessly by an app in mobile*, you can say I want to make the robotic version of Alfred. XD
*Part of this Project will be made Later Weeks
Alfred J. Pennyworth (Batman: The Animated Series)
Software:
Electronics:
1x (330 Ohm) Resistor.
1x LED.
1x Slider Switch.
1x Arduino UNO R3.
1x IR Sensor. (HW-201)
1x LDR Sensor.
1x Temperature Sensor. (LM35).
1x 5v DC Fan.
In this Part, I Used Tinkercad to simulating the circuit wiring and design like circuit below:
Note that the red LED reference to the fan because Tinkercad doesn't have a fan module on it.
Then I implement the real circuit:
The code was Really Simple, and it's running as follows:
Define Two Variables for TMP-36, LDR Sensor in Analog pin A2 and A1 Named Temp_Value and Light_Value respectively and read the input from them.
Make If else statement, where the condition is if digital pin 5 is High or Low.
If Pin 5 is High, then Set Pin 11 to map (merge) Values of Variable Light_Value from 0 to 255 then print it in the serial monitor of the program in newline.
And inside it there's another if condition that if the temperature is above 70 c Set Pin 10 to HIGH else Set Pin 10 to LOW.
If Pin 5 is Low, then switch to else condition and set Pin 10 & 11 to LOW.
The code :
Click on Start Simulation and change the IR sensor Parameters to see the output :-)
Testing in Tinkercad
Testing the Real Circuit
This Video from was recommended during the lecture, and it was very useful for an overview about Arduino World.
If you implement the two terminal sensor form Tinkercad in real circuit, you will face A problem with the LDR sensor in inputs readings unlike Tinkercad simulation.
And after searching a little, I Found that the problem because of PULL Up and PULL DOWN Resistor.
This problem is a common when we deal with switches, push buttons and any input has two terminals only.
Solution: just connect a large resistance between the GND and the terminal over your connection.
(like the Photo)
My Light sensor Module has three terminals, so I wasn't facing this problem, but if you face it here is the solution :-)
Pull Down connection
Bunch of RC Cars with an Arduino UNO Board
Of course Arduino is the heart of my final Project, so yea it will definitely help me on it :-D
I Made the Identical Real Circuit in Program Named Fritzing :-)
Note that the fan in this circuit will not run because of low voltage from Arduino, it's just for illustrate.
7 Segments LED Count Circuit