0% found this document useful (0 votes)
3 views

Arduino For 6 Hours

Uploaded by

asalangsang45
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Arduino For 6 Hours

Uploaded by

asalangsang45
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

### Taught and facilitated a six-hour course on basic Arduino programming for novices

**In response:**
In six hours, introduce students to Arduino programming and hardware interface through hands-
on projects that include switches, LEDs, potentiometers, and ultrasonic sensors. Students will not
only acquire practical experience but also understand the principles of electronics and coding.

**Needed Supplies:**
A board called Arduino Uno
- Circuit board
- LEDs
- Press buttons or switches.
- Potentiometers
- Sonar detecting devices
- Extension wires
- Resistors (220 ohms and 10k).

---

### Breakdown of Lesson Plans

#### **Hour 1: Setup and Introduction**


- **A Synopsis of Arduino:**
Explain Arduino and how it may be used for electronics projects.
- Run through a few fundamental Arduino operations.
**Setting Up the Arduino IDE**:
- Help students download, install, and set up the Arduino IDE.
- Explain the fundamentals of the Arduino board's interface and demonstrate how to upload a
basic "Blink" application to it.

**Second Hour: Basic LED Management**


**Objective:** Learn the skills required to turn on and off an LED using an Arduino.
- **Action:**
- Go over the code step-by-step, focusing on how to set pin modes and use `digitalWrite}.
**Code Example:**
{{{cpp
void setup() {
pinMode (13, OUTPUT);
~

void loop() {
digitalWrite (13 HIGHS);
delay(1000);
digitalWrite(13), LOW;
delay(1000);
~
{~
**Activity:** Students change the code to change how quickly the lights blink and check it on
their boards.

#### **Hour 3: Operating an LED with a Switch**


**Objective:** Learn how to operate an LED switch.
- **Action:**
- Describe digital input and the workings of a switch.
**Code Example:**
{{{cpp
Int buttonState = 0;

void setup() {
pinMode(2, INPUT);
pinMode (13, OUTPUT);
~

void loop() {
buttonState and digitalRead(2) are equal.
If buttonState is set to HIGH, then
digitalWrite (13 HIGHS);
If not, ~
digitalWrite(13), LOW;
~
~
{~
**Activity:** Using the circuit connected, students modify the code to add a second LED that
can be controlled by a single switch or a separate one.

#### **Hour 4: Modulating LED Brightness with a Potentiometer**


- **Objective:** Learn how to use a potentiometer to control LED brightness.
- **Action:**
Go over how potentiometers work and analog inputs.
**Code Example:**
{{{cpp
The value of int potValue is 0;

void setup() {
pinMode(9, OUTPUT);
~

void loop() {
An analogRead(A0) must equal potValue.
brightness; int map(potValue, 0, 1023, 0, 255);
analogueWrite(9, brightness);
~
{~
- **Active Assignment**: Students explore Arduino's mapping feature and experiment with
adjusting the potentiometer to adjust the brightness of the LED.

#### **Hour 5: Determining Distance with an Ultrasonic Sensor**


- **Objective:** Learn how to use an ultrasonic sensor to measure distance.
- **Action:**
- Explain the usage of sound waves for distance measurement and the ultrasonic sensor.
**Code Example:**
{{{cpp
trigPin = int const 9;
const int echoPin = 10;
prolonged duration;
the separation in t;

void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode (13, OUTPUT);
Serial.begin(9600);
~

void loop() {
digitalWrite(trigPin, LOW);
a delay of microseconds (2);
digitalWrite(trigPin, high);
ten microseconds of delay;
digitalWrite(trigPin, LOW);

length = echoPin + pulseIn(high);


distance = time * 0.034 / 2;

When (distance < 10)


digitalWrite (13 HIGHS);
If not, ~
digitalWrite(13), LOW;
~

"Distance:" Printing Using Serial


println(length) within a Serial
pause (500);
~
{~
- **Hands-on Task:** Students modify the code to trigger different events based on distance
after building the circuit and testing the sensor.
#### **Review and Project Hour 6**
- **Project:** Give students the chance to put what they've learned to use on a simple project,
such as controlling many LEDs with switches and sensors.
- **Review and Q&A:** Discuss possible next steps or more challenging tasks, go over the key
concepts you learned, and answer any issues you may have.

---

### Assessment
- **Project Evaluation:** Assess students based on the creativity and usefulness of their final
projects.
- **Concept Understanding:** Ask them to explain the circuit structure and coding in order to
gauge their understanding.

Students who complete this six-hour course will have a thorough understanding of Arduino as
well as useful abilities that they can use to other projects.

You might also like