Maker Uno (Level 1)
Maker Uno (Level 1)
Uno
Get the slides at this link : bit.ly/MU_InnoTech2024
Introduction
Munawwir
QUESTION...
1. Is it in the syllabus?
2. Why Maker Uno?
3. Tech Dome Penang...?
Maker Uno
Arduino Uno
Maker Uno
Arduino Uno
Let's start !
"Install" Arduino
1 Search for "Arduino" in Google and press the first search
result or press this link.
PIR sensor
Cable Maker Uno
Light sensor
+ Ultrasonic sensor
Vibration sensor
LED, LDR,
Resistor, Touch sensor
Transistor, Breadboard
Adjust Preset, Smoke sensor
Brush Motor
Motor Propeller
...and few others.
2 Maker Uno display
3 Breadboard
Long legs
Short legs
( + ) Positive
( - ) Negative
5 Resistor & "Ohm's Law"
Voltage 9V Voltage 9V
Current Current
0.041A 0.009A
2 Sound
4 Adjustable switch
6 Piano
1 Turn on LED
Void setup(): This is a function in Arduino code that is called once when the program starts.
It is typically used for initialization tasks such as setting pin modes, initializing serial
communication, or defining initial variables.
Pin Mode: This is a function used to configure a specific pin on the Arduino board as either
an INPUT or an OUTPUT. For example, pinMode(13, OUTPUT); sets digital pin 13 as an output
pin, allowing you to send signals (e.g., turning an LED on or off) through that pin.
Void loop(): This is another function in Arduino code that runs continuously after the
setup() function. Anything inside the loop() function will execute repeatedly until the
Arduino is powered off or reset. This is where you typically put the main logic or tasks that
you want your Arduino to perform continuously, such as reading sensors, processing data,
or controlling outputs.
digitalWrite(): This is a function used to set the state (HIGH or LOW) of a digital output pin.
It is commonly used to turn LEDs, motors, or other devices on or off. For example,
digitalWrite(13, HIGH); would set the digital pin 13 to a HIGH state, turning on whatever
device is connected to it (e.g., an LED).
Challenge !
cont.
Project 2 Song
LDR
Refer here !
10k /
Explaination:
const int: In Arduino code, const int is used to declare a constant integer variable and it
cannot be changed during the execution of the program. This is commonly used to define
pin numbers or other fixed values that won't change throughout the program's execution.
ledPin is a variable name that is typically used to represent the pin number to which an LED
(Light Emitting Diode) is connected.
analogRead is a function used to read the value of an analog pin on the Arduino board.
Unlike digital pins which can only be in an on or off state (HIGH or LOW), analog pins can
read a range of values between 0 and 1023, representing voltages between 0 and 5 volts.
Serial.println is a function used to send data over the serial port for debugging or
communication purposes. It prints the specified data to the serial monitor in the Arduino
IDE
4 Adjustable switch
Potentiometer
Refer here!
Explaination:
readvalue represents the value read from an analog sensor connected to one of the analog
input pins of the Arduino board. The analogRead() function is used to read the analog
voltage present at the specified pin and convert it into a digital value ranging from 0 to
1023. This value is then stored in a variable (in this case, readvalue) for further processing,
such as mapping using the map() function or making decisions based on the sensor
reading.
ledvalue is often used in conjunction with analogWrite() to specify the brightness level of
the LED. The value of ledvalue ranges from 0 (fully off) to 255 (fully on).
The map() function is used to convert a value from one range to another. It takes five
arguments: the value to map, the current minimum and maximum range of that value, and
the desired minimum and maximum range for the output.
For example, ledvalue = map(readvalue, 0, 1023, 0, 255); would map a readvalue ranging
from 0 to 1023 (common for analog sensor readings in Arduino) to a new range from 0 to
255 (brightness level of LED).
5 Turn the fan
NPN Transistor
6 Piano
10
9
7
6
5
4
3
Push Button
6 Piano
cont.
cont.
Contact
Munawwir Syazilli
012-5492710
[email protected]
Thank You