0% found this document useful (0 votes)
79 views8 pages

01 - Laboratory - Exercise - 1 (Full Permission)

This document provides instructions for a laboratory exercise to familiarize students with the Arduino Uno 328 board and integrated development environment (IDE). The objectives are for students to be able to identify the characteristics of the Arduino IDE and explore the Arduino 328 board and IDE interface. The procedures describe how to download and install the Arduino IDE software, familiarize oneself with the toolbar, menu bar, and features of the IDE interface. Instructions are provided to open an example blink program, connect the board, modify the code, verify, compile and upload the code. The document also reviews the components and pinouts of the Arduino 328 board.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views8 pages

01 - Laboratory - Exercise - 1 (Full Permission)

This document provides instructions for a laboratory exercise to familiarize students with the Arduino Uno 328 board and integrated development environment (IDE). The objectives are for students to be able to identify the characteristics of the Arduino IDE and explore the Arduino 328 board and IDE interface. The procedures describe how to download and install the Arduino IDE software, familiarize oneself with the toolbar, menu bar, and features of the IDE interface. Instructions are provided to open an example blink program, connect the board, modify the code, verify, compile and upload the code. The document also reviews the components and pinouts of the Arduino 328 board.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

ECE 116-Microprocessor for ECE

Laboratory Exercise 1
Arduino Uno 328 Board and IDE
Familiarization

OBJECTIVES:

At the end of the exercise, the students should be able to:


Identify the characteristics of Arduino Integrated Development
Environment (IDE) that will be used in programming the microcontroller
ATMega328,

and explore Arduino 328 board and IDE interface.

MATERIALS:

 Arduino 328 Board

 1 Computer unit with pre-installed Windows Operating System 1 A to B Scanner/Printer cable


or a computer with internet and you can access the tinkercad.com website

PROCEDURES:

Note: Please observe safety precautions and proper handling while conducting the
laboratory experiment. This experiment is to be performed under faculty supervision.

Arduino Development Environment Familiarization

1. Download first the IDE program of Arduino at https://www.arduino.cc/en/Main/Software


depending on the OS of your computer.

2. Once the download is complete, install the program by simply following the
instructions. Once installed, run the program and a window will pop out.

3. Let us now familiarize ourselves with the Arduino development environment.


Let us begin with the toolbar. The discuss the following below, take from
http://arduino.cc/en/Guide/Environment, starts from left to right of the figure
below.

Figure 1.1 Arduino DE Toolbar

a. Verify -

b. Upload -

c. New -

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE

d. Open -

e. Save –

f. Serial Monitor -

4. Let us now familiarize ourselves with the Menu bar of the development environment. Discuss the
following words below.

Edit
Copy for Forum -

Copy as HTML -

Menu bar

Toolbar

Sketchbook

Compiling window

Figure 1.2 Arduino Development Environment

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE

 Sketch -

 Verify/Compile -

 Show Sketch Folder -

 Add File... –

 Import Library -

 Tools -

 Auto Format -

 Archive Sketch –

 Board –

 Serial Port –

 Programmer –

 Burn Bootloader -

 Sketchbook -

 Uploading-
 Serial Monitor-

4. Let us open an example to check whether we can connect to the board. Click File > Examples >
Basics > Blink. Another screen should pop out and look like what is shown below.

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE
7. Connect the board by simply inserting it to a USB port. For a new Arduino board, upon insertion, you
will notice a red LED blinking every one second. Let us now verify if we can successfully connect to the
board.

8. In the sketchbook, change the argument of the delay() function from 1000 to 5000. This will make the
red LED blink every five seconds. Your new code should look like what is shown below.

9. Verify the program by clicking . Upon a successful compilation, you should be able to see the
screenshot below.

10. We are now ready to upload our code to the ACEduino board. Click . After a successful upload,
the compiling window should look like what is shown below.

11. Notice that the blinking or the light is approximately equal to five seconds.

Arduino w/ ATmega328 Familiarization

1. Let us now familiarize ourselves with the ACEduino w/ ATmega328 board. Shown in Figure 1.3 is the
ACEduino w/ ATmega328 board. This ATmega 328 has the following peripherals and features:

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE

 14 Digital Input/Output pins (6 of which are PWM outputs)

 6 Analog Input pins (with pin for Analog reference)

 Different communication lines available - UART (Rx, Tx), I2C (SDA, SCL) and ISP (MISO, MOSI,
SCL)

 On-board solderable prototyping nodes

 32KB Flash Memory and automatic power selector between USB and DC power

2. Let us discuss the important blocks found in the figure below.

a. DC jack –Supply a Power DC jack when the Arduino is ready to be deployed. A 9-V converter
should be good enough to make this board run and at the same time provide power to other
external peripherals to be attached to the Arduino board.

b. Power supply ports –Arduino kit can provide a 3.3V or 5V

c. Analog inputs –These are analog inputs that will be converted to its digital equivalent so that the
microcontroller can process them.

d. ATmega328 microcontroller chip – This is the brain of the Arduino board that does the processing
of all inputs and outputs from and to the microcontroller.

e. Digital I/O ports –These are general input/output ports that can be use to read and write to the
external peripherals attached to the Arduino board. Note that I/O ports 9 –11 can be used as PWM
ports.

f. Digital I/O ports –These are general input/output ports that can be use to read and write to the
external peripherals attached to the Arduino board. Note that I/O ports 3, 5 –6 can be used as
PWM ports.

g. A to B printer/Scanner cable –This is not provided once you bought the Arduino kit. This cable is
used to connect the Arduino board to the IDE in the computer for debugging and uploading of
program codes.

h. Reset button –This button restarts the system.

e f

a
b c
Figure 1.3 Arduino w/ ATmega328 board

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE
3. The ATmega328 chip has the following pinouts. It would be nice to always have the figure below on
hand when developing your application-specific program.

Figure 1.4 ATmega328 chip pinouts


4. Let us now understand how to program the ACEduino using this IDE. Click on File > Examples >
Basics > BareMinimum. Refer to the figure below.

5. Note that a new window will appear just like what is shown below. A new sketch has a default file
naming system of sketch_date. What are the codes that can you see? Write it down on the space
provided.

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE
6. To develop our application using the Arduino, open this file and save it with a new filename. Files
under the Examples folder cannot be overwritten. This new window, from the filename itself,
emphasizes that the code to be developed must have this two functions. These two functions are
described below.

a. The setup() function is called when a sketch starts. Use it to initialize variables, pin modes,
start using libraries, etc. The setup function will only run once, after each powerup or reset
of the Arduino board.

b. After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops consecutively, allowing your
program to change and respond. Use it to actively control the Arduino board.

7. Let us now analyze the code we used in simply trying to make the LED in the Arduino board blink. The
code for LED blinking is re-shown below. Let us understand each line of the program code.

a. pinMode - Configures the specified pin to behave either as an input or an output. The
syntax of the said built-in function is:

Syntax: pinMode(pin, mode)

Parameters: pin: the number of the pin whose mode you wish to set mode:
either INPUT or OUTPUT

b. digitalWrite –Write a HIGH or a LOW value to a digital pin. If the pin has been configured
as an OUTPUT with pinMode(), its voltage will be set to the corresponding value: 5V (or
3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW. If the pin is configured as an
INPUT, writing a HIGH value with digitalWrite() will enable an internal 20K pullup. Writing
LOW will disable the pullup. The pullup resistor is enough to light an LED dimly, so if LEDs
appear to work, but very dimly, this is a likely cause. The remedy is to set the pin to an
output with the pinMode() function. NOTE: Digital pin 13 is harder to use as a digital input
than the other digital pins because it has an LED and resistor attached to it that's soldered
to the board on most boards. If you enable its internal 20k pull-up resistor, it will hang at
around 1.7 V instead of the expected 5V because the onboard LED and series resistor pull
the voltage level down, meaning it always returns LOW. If you must use pin 13 as a digital
input, use an external pull down resistor. The syntax of this built-in function is:

Syntax: digitalWrite(pin, value)

Parameters: pin: the pin number value: HIGH or LOW

c. delay() - Pauses the program for the amount of time (in milliseconds) specified as
parameter. (There are 1000 milliseconds in a second.)

prepared by: Engr. Jonathan Sulit


ECE 116-Microprocessor for ECE

OBSERVATION AND CONCLUSION:

References:

Arduino Development Environment. Retrieved from: http://arduino.cc/en/Guide/Environment


http://www.atmel.com/Images/doc8161.pdf

prepared by: Engr. Jonathan Sulit

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy