ArduinoModule_Beginner v4 Flipbook PDF


20 downloads 121 Views 6MB Size

Story Transcript

Arduino Projects for

Beginners

Fadzli Syed Abdullah

Getting Started A. Install Arduino IDE Please follow the following steps to install your Arduino IDE: 1. Go to https://www.arduino.cc/en/software 2. Select a download option that is suitable for your machine 3. Download the suitable installer to your local drive 4. Once finished, run the installer and follow the instructions.

B. Connect the Arduino board to your computer using USB cable

C. Launch Arduino IDE and Select Board and Port 1. Go to Tools > Board > Arduino AVR Board and select Arduino UNO.

2. Go to Tools > Port and select the relevant port that connect to your Arduino UNO Arduino Projects for Beginners

1

3. Now you are ready to write your first Arduino program!

D. Let's try your Arduino 1. To try your Arduino, let's upload a sample code to your board. Go to File > Examples > 01.Basics > Blink.

2 1

Upload button: Click this button to upload your program code to the Arduino Board.

Verify button: Click this button to check for any syntax errors in the program code.

2. Click the Verify button to check for any syntax error. Then click the Upload button to upload the program code into your Arduino Board. 3. If the upload is successful, the LED on the Arduino board will starts to blink. 4. Congratulations! You had successfully run your first Arduino program.

Arduino Projects for Beginners

2

Project #01: Melody # 1 2 3 4

Item Arduino UNO R3 Breadboard Buzzer Short male-to-male Jumper Wire

2

Quantity 1 1 1 2

1

Step 1 Prepare these items.

Step 2 Setup the following circuit

3

Step 3 Write the following sketch

4

Step 4 Click the upload button and hear the melody.

Fun Exercise Compose your own melody using the following notes. Note Frequency

Arduino Projects for Beginners

DO 262

RE 294

MI 330

FA 349

SO 392

LA 440

TI 494

3

Project #02: Melody with LED # 1 2 3 4 5 6

Item Arduino UNO R3 Breadboard Buzzer LED Resistor 10 W Short male-to-male Jumper Wire

2

Quantity 1 1 1 1 1 4

Step 1

1

Prepare these items.

Step 2 Setup the following circuit

Step 3

3

Write the following sketch

4

Step 4 Click the upload button and see how it works!

Fun Exercise Add an Orange LED. Try to light it on when the Red LED is off and vice versa.

Arduino Projects for Beginners

4

Project #03: LED Control # 1 2 3 4 5 6 7

Item Arduino UNO R3 Breadboard Potentiometer LED Resistor 10 W Short male-to-male Jumper Wire Long male-to-male Jumper Wire

2

Quantity 1 1 1 1 1 4 2

1

Step 1 Prepare these items.

Step 2 Setup the following circuit

3

Step 3 Write the following sketch. Please note that we start to use variables in this project (potpin, ledpin and val). Variables are used to represent a value.

4

Step 4 Click the upload button and see how it works. Turn the potentiometer knob to adjust the LED blinking speed.

Fun Exercise Add a buzzer. Try to light make the buzzer sound when every time the LED is on.

Arduino Projects for Beginners

5

Project #04: Knight Rider # 1 2 3 4 5

Item Arduino UNO R3 Breadboard LED Resistor 10 W Short male-to-male Jumper Wire

2

Quantity 1 1 5 5 5

1

Step 1 Prepare these items.

Step 2 Setup the following circuit

Step 3

3

Write the following sketch

Step 4

4

Click the upload button and see how it works. The LEDs will light up just the Knight Rider car!

Fun Exercise Add a potentiometer to control the light transition speed.

Arduino Projects for Beginners

6

Project #05: Automatic Light # 1 2 3 4 5 6 7

Item Arduino UNO R3 Breadboard LDR Sensor LED Resistor 10 W Short male-to-male Jumper Wire Long male-to-male Jumper Wire

2

Quantity 1 1 1 1 2 6 1

Step 1

1

Prepare these items.

Step 2 Setup the following circuit

Step 2

2

Write the following sketch. Please note that we start to use Serial to observe the LDR reading value.

Step 3

3

Click the upload button and see how it works. Open Serial Monitor to observe the LDR reading value. Cover the LDR with your hand to block the light until the LDR value is below 10. The LED will automatically turned on.

Arduino Projects for Beginners

7

Project #06: Car Wiper # 1 2 3 4

Item Arduino UNO R3 Servo Short male-to-male Jumper Wire Long male-to-male Jumper Wire

2

Quantity 1 1 2 1

1

Step 1 Prepare these items.

Step 2 Setup the following circuit

Step 3

3

Write the following sketch. Please note that we start to use library by including Servo.h. Library is used to help us develop the code easier.

Step 4

4

Click the upload button and see how it works. The LEDs will light up just the Knight Rider car!

Fun Exercise Add a potentiometer to control the wiper speed.

Arduino Projects for Beginners

8

Project #07: Ultrasonic Ruler # 1 2 3 4 5

Item Arduino UNO R3 Breadboard Ultrasonic Sensor - HC-SR04 Short male-to-male Jumper Wire Long male-to-male Jumper Wire

2

Quantity 1 1 1 4 2

1

Step 1 Prepare these items.

Step 2 Setup the following circuit

3

Step 3 Write the following sketch

4

Step 4 Click the upload button and see how it works. Point your ultrasonic sensor towards an object and read the distance from your serial monitor.

Fun Exercise Add a buzzer and make it sound differently to indicate different distance.

Arduino Projects for Beginners

9

Project #08: Automatic Doorbell # 1 2 3 4 5 6

Item Arduino UNO R3 Breadboard Ultrasonic Sensor - HC-SR04 Buzzer Short male-to-male Jumper Wire Long male-to-male Jumper Wire

2

Quantity 1 1 1 1 6 2

Step 1

1

Prepare these items.

Step 2 Setup the following circuit

Step 3

3

Write the following sketch

4

Step 4 Click the upload button and see how it works. Wave your hand in front of the ultrasonic sensor to ring the bell.

Fun Exercise Add an LED and an LDR. Try to turn on the LED every time these two (2) conditions are met: a. the ultrasonic sensor detects a close object b. the LDR detects low lighting

Arduino Projects for Beginners

10

Get in touch

Social

© Copyright 2013 - 2024 MYDOKUMENT.COM - All rights reserved.