Arduino Lab Manual (Asith)
Arduino Lab Manual (Asith)
By:
W.C. Deshapriya
Email: danditronic@gmail.com
Introduction
The Arduino (Uno) Board is a micro-controller board that was created to house the
ATmega328 chip. The chip is a high performance and low power 8-bit micro-controller that has 23
programmable I/O lines, 32K bytes of flash memory (of which 0.5KB is already used for the Boot
loader), 1k bytes of EEPROM and 2k bytes of RAM. The Arduino Uno board provides the user
with 6 analog input pins, 14 digital I/O pins of which 6 of them can also be used for PWM outputs,
a power jack, a USB port, an ICSP header, a reset button, a small LED connected to digital pin 13,
and a 16MHz crystal oscillator. (See Arduino Uno Component View for more details about the
parts.)
In comparison to earlier models, the board uses the Atmega8U2 programmed as a USB-to-
serial converter rather than the FTDI USB-to-serial driver chip.
It is the latest in the Arduino USB board series and the current reference model for the
Arduino platform. The board is easy to use and capable of doing a lot of things.
3. Congratulations! Arduino IDE is installed on your computer. To use it, just navigate to your
main folder directory and run the Arduino application.
Figure 3: Arduino-symbol.
B. Arduino Uno board driver (For Windows)
This part will guide you through the set-up and installation process of the Arduino Uno board
driver for the device to be recognized by the IDE.
1. Connect the Arduino UNO to the computer via USB Cable. Check if it is properly
connected by observing the green LED labeled ON on the board.
Figure 4: Arduino Uno board connected to a Computer. the board’s USB-B port.
2. Wait for Windows to try and install the device’s driver until it fails. Navigate to the Device
Manager through Start > Control Panel > Device Manager. Locate the Arduino Uno
Device. Right-click it to choose Update Driver Software.
3. Choose to browse your computer for the driver by clicking Browse my computer for
driver software.
4. A new window will open for you to indicate the location of the driver. Click Browse…
6. A Windows Security window sometimes pops up to confirm if you want to continue the
installation. Just click, Install this driver software anyway.
Component View
A pictorial view of the Arduino Uno board’s peripherals can be found in this section.
B. Questions
• How do you compile and upload a sketch file into the Arduino Board using the IDE?
• How can the configuration of the pins be specified in the programming?
• What functions are always required in a sketch?
C. Materials Needed
• 1 x Arduino Uno board and USB cable
• 1 x 5mm/3mm Red LED
• 1 x 470Ω resistor
• 1 x breadboard
3. Press Ctrl + S to save your sketch (the term for a source code in Arduino).
4. Click the Verify Button to check if the sketch has no errors. At the bottom of the screen you
should see if the sketch was successfully scanned free of problems. Moreover, the size of
the sketch file is also indicated on the black screen at the bottom to shows that it fits the
flash memory of the Arduino Uno.
3. Next, make sure that the Arduino board’s COM port is properly identified by the IDE. To do
this, connect the board to the computer then from the IDE front panel go to Tools > Serial
Port. A list of COM’s should be there, choose the COM number associated with the
microcontroller board.
Note: the microcontroller board’s COM no. is found near the name of the device’s driver in
Device Manager.
4. Finally, upload the sketch made earlier into the board by clicking the IDE. The status of
the upload can be found near the bottom of the program.
5. If the Arduino Uno is connected to the PC or power source the LED should light up for 1
second and turn off for 1 second repeatedly.
B. Questions
• In circuit theory, how is a tact switch represented when it is pressed and not?
• What function enables you to read the input from a pin?
• What function enables you to program efficiently the lighting up of several LED’s?
C. Materials Needed
• 1 x Arduino Uno board and USB cable
• 4 x 5mm/3mm Red LEDs
• 4 x 470Ω resistors and 1 x 10kΩ resistor
• 1 x breadboard
• 1 x switch or toggle switch
/****** LED on digital pin 13 */
A. Questions
• How would you change the amount of time each LED is ON?
• Why is it necessary to cause some delay applications like for example, reading values from
a sensor?
• In how many ways or units are there to configure the delay?
B. Materials Needed
• 1 x Arduino Uno board and USB cable
• 5 x 5mm/3mm LEDs (2 Red, 2 Green, 1 Orange)
• 5 x 470Ω resistors and 1 x 10kΩ resistors
• 1 x breadboard
• 1 x tact switch or toggle switch
B. Questions
• How does the LDR Work? Does the resistance increase as it receives more light?
• What is the necessary function to read analog inputs?
• How does the ADC of the analog input pins process the voltages it receives?
• What estimated range values is needed for the program to determine the light level?
C. Materials Needed
• 1 x Arduino Uno board and USB cable
• 4 x 5mm/3mm LEDs
• 4 x 470Ω resistors and 1 x 2.2kΩ (= R) resistor
• 1 x breadboard
• 1 x Light Dependent Resistor (LDR)
Figure 20: Diagram showing how a 1.25V input to the analog pin is read as 256 units.
When a 1.25V source is connected to one analog input pin, the ADC converts it in unit
which is by the conversion ratio mentioned equal to 256 (=1.25V x 1024 / 5V). Now, to activate the
ADC of the analog input pins, it is necessary to use the analogRead(pin) function. Look at the
appendix for an explanation regarding this.