Ideation
This Week's assignment
Circuits wth Arduino UNO
Build and Program a smart circuit using an Arduino UNO which reads a signal from an input component to control an action component using Code Blocks
Mercury Tilt Sensor
The first time saw a tilt sensor in my hand (the first day of Maker diploma), immediately I fell in love with it.
I worked for around 4 years with tilt sensors without Knowing how they work or what it looks like inside. 🤯🤯💙💙
so
*I searched for Projects that have tilt sensors on them.
*Taking into account the integration between the sensor and the Arduino.
* Hit the requirements that I have Single Input at least and single action at least either.
Tool Chain "Software * Materials * Machines "
Software
Tinker CAD
Arduino
Electronics Components
Tilt Sensors
LED "blue/white"
Resistors
Arduino UNO
Jumpers
Aduino UNO
LED Resistor
Tilt Sensor
Jumpers
Input Component
Tilt sensor
Action Component
White LED lights up when mercury in the tilt sensor is in a normal state.
Blue LED lights up when mercury in the tilt sensor in an Opposite state.
Tinker CAD
Make project circuits in Tinker CAD program first.
Coding
-Tilt sensor position reflects on LED.
-Taking the tilt sensor reading from Pin analog 3~ "Input"
-LEDs act like action output
-LEDs light up depending on the Mercury tilt sensor state
-Switching between them "white when it is in normal state/blue in the opposite"
Circuits On breadboard wth Arduino
setup function:
this function used to setup and intialize the input/output pin in aurdoino
loop function:
this function repeated forever
if the input pin (3) reads high signal then
give signal to output pin (2)
remove signal from output(4)
2-else // if the input pin (3) reads low signal
remove signal from output (2)
send signal to output (4)
3- delay (10 ms)
have a wardrobe mechanism.
putting a key to drop the gift "small car".
Coding with blocks on TinkerCAD.
Choose option "Blocks&Text" to take the text code to the Arduino software.
Upload the code to Arduino .
// C++ code
//
void setup()
{
pinMode(3, INPUT);
pinMode(2, OUTPUT);
pinMode(4, OUTPUT);
}
void loop()
{
if (digitalRead(3) < HIGH) {
digitalWrite(2, HIGH);
digitalWrite(4, LOW);
} else {
digitalWrite(2, LOW);
digitalWrite(4, HIGH);
}
delay(10); // Delay a little bit to improve simulation performance
}
I Put a buzzer instead of the second LED
Overcoming Ghallenge
Mercury tilt sensor doesn't excite in Tinker CAD software.
I searched for it
Try to figure out how I can connect it
after" try & error" - asking for instructor help - implementing searching results..... it works الحمد لله
Implementing Waving Hand Project "Manual Mood / Automatically Mood"
This Week I'm able to بفضل الله ^^
Program an Arduino to control a single action component (LED, Motor...etc), using Code Blocks
Program an Arduino to read signals from a single input component (Sensor, switch, and variable resistor), using Code Blocks
Differentiate between digital and analog signals and use them efficiently to program smarter devices
Understand how code blocks translate into Arduino C programming language
Tinker existing code in order to achieve a different/desired outcome
Learning how to Search for "how Electronics components Connect with Arduino"
Designing Devices with Manual Mood & Automatic Mood.
Using different sensors.