Arduino_Introduction_YA_Spring 25
Arduino_Introduction_YA_Spring 25
Inputs Outputs
LEDs
Potentiometer TemperaturePushbutton
Photoresistor 7
Buzzer
Sensor Segmen
Part 1: What is Arduino?
Reset button:
Resets the ATmega microcontroller.
Microcontroller:
ATmega328P
https://store-usa.arduino.cc/products/arduino-uno-rev3?sele
Part 2: Arduino Hardware
USB port:
Used for powering your Arduino
Classic Family: UNO Rev 3 UNO, uploading your sketches to
your Arduino, and for
communicating with your
Arduino sketch (via Serial.
println() etc.).
Power connector:
This is how you power your
Arduino when it's not plugged
into a USB port for power. Can
accept voltages between 7-12V.
Power LED:
Indicates that your Arduino is
receiving power. Useful for
debugging.
Part 2: Arduino Hardware
General Purpose Input/Output Pins
Classic Family: UNO Rev 3 GPIO
Operate at 5V, and can provide/receive
20mA
20 pins
Note:
Use these pins with digitalRead(),
digitalWrite(), and analogWrite().
- analogWrite() works only on the pins with
the PWM symbol.
Part 2: Arduino Hardware
Classic Family: UNO Rev 3
Power:
GND, 3.3 V, and 5V pins Use
these pins to provide +3.3 V,
+5V power, and ground to your
circuits.
Analog In:
6 input pins:
Note: Use these pins with analogRead().
Part 3: Arduino software
•pin: The analog pin (A0, A1, A2, etc.) from which to read the
value.
•Returns: An integer between 0 and 1023 (for 10-bit ADC on
most Arduino boards).
•0 → 0V
•1023 → 5V (or 3.3V on some boards)
Basic Code to Read
Temperature
void setup() {
Serial.begin(9600); // Start serial monitor
}
void loop() {
int sensorValue = analogRead(A0); // Read analog value from LM35
float temperatureC = sensorValue * 0.488; // Convert to °C (simplified formula)
Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");
Results:
•LED1 should blink continuously.
•LED2's brightness should gradually increase and decrease, creating a fading
effect.
•Make sure to comment your code explaining the logic behind each section.