Lab Report No.07
Lab Report No.07
Objectives:
To get the basic knowledge of Arduino board, types of Arduino and its software named Arduino IDE.
Arduino Board:
Page 1 of 23
Power USB
Arduino board can be powered by using the USB cable from your computer.
All you need to do is connect the USB cable to the USB connection (1).
Voltage Regulator
The function of the voltage regulator is to control the voltage given to the
Arduino board and stabilize the DC voltages used by the processor and other
elements.
Crystal Oscillator
The crystal oscillator helps Arduino in dealing with time issues. Arduino
calculates the time by using the crystal oscillator. The number printed on top of
the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000
Hertz or 16 MHz.
Arduino Reset
You can reset your Arduino board, i.e., start your program from the beginning.
You can reset the UNO board in two ways. First, by using the reset button (17)
on the board. Second, you can connect an external reset button to the Arduino
pin labelled RESET (5).
Page 2 of 23
Analog pins
The Arduino UNO board has six analog input pins A0 through A5. These pins
can read the signal from an analog sensor like the humidity sensor or
temperature sensor and convert it into a digital value that can be read by the
microprocessor.
Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as the
brain of your board. The main IC (integrated circuit) on the Arduino is slightly
different from board to board. The microcontrollers are usually of the ATMEL
Company. This information is necessary about what IC your board has before
loading up a new program from the Arduino IDE. This information is available
on the top of the IC. The more details about the IC construction and functions,
the data sheet can be used.
ICSP pin
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino
consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred
to as an SPI (Serial Peripheral Interface), which could be considered as an
"expansion" of the output.
TX and RX LEDs
On the board, there are two labels: TX (transmit) and RX (receive). They
appear in two places on the Arduino UNO board. First, at the digital pins 0 and
1, to indicate the pins responsible for serial communication. Second, the TX
and RX led (13). The TX led flashes with different speed while sending the
serial data. The speed of flashing depends on the baud rate used by the board.
RX flashes during the receiving process.
Digital I/O
The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM
(Pulse Width Modulation) output. These pins can be configured to work as
input digital pins to read logic values (0 or 1) or as digital output pins to drive
Page 3 of 23
different modules like LEDs, relays, etc. The pins labeled “~” can be used to
generate PWM.
AREF
AREF stands for Analog Reference. It is sometimes, used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog
input pins.
The features of different types of Arduino boards are listed in the tabular form.
Arduino Board Processor Memory Digital I/O Analogue I/O
Arduino Uno 16Mhz ATmega328 2KB SRAM, 32KB flash 14 6 inputs, 0 output
Arduino Due 84MHz AT91SAM3X8E 96KB SRAM, 512KB flash 54 12 inputs, 2 output
Arduino Mega 16MHz ATmega2560 8KB SRAM, 256KB flash 54 16 inputs, 0 output
12 inputs, 0
Arduino Leonardo 16MHz ATmega32u4 2.5KB SRAM, 32KB flash 20 output
Page 4 of 23
Arduino Uno (R3):
The Uno is a huge option for your initial Arduino. This Arduino board depends on an ATmega328P
based microcontroller. As compared with other types of Arduino boards, it is very simple to use like
the Arduino Mega type board. .It consists of 14-digital I/O pins, where 6-pins can be used as
PWM(pulse width modulation outputs), 6-analog inputs, a reset button, a power jack, a USB
connection, an In-Circuit Serial Programming header (ICSP), etc. It includes everything required to
hold up the microcontroller; simply attach it to a PC with the help of a USB cable and give the supply
to get started with an AC-to-DC adapter or battery.
Page 5 of 23
Arduino Micro:
The Arduino Micro board mainly depends on the ATmega32U4 based Microcontroller that includes
20-sets of pins where the 7-pins are PWM pins, 12-analog input pins. This board includes different
components like an ICSP header, RST button, small USB connection, crystal oscillator-16MHz. The
USB connection is inbuilt, and this board is the shrunk version of the Leonardo board.
Page 6 of 23
Figure: LilyPad Arduino Boards
Arduino Bluetooth:
This Bluetooth mainly depends on the microcontroller like ATmega168 and this board is also called
Arduino BT. This kind of board includes different components like digital pins-16, analog pins-6,
crystal oscillator-16MHz, reset button, screw terminals, ICSP header. In this board, the screw terminals
are mainly used for power. The programming of this Bluetooth microcontroller can be done with
Bluetooth like a wireless connection.
Arduino Diecimila:
The microcontroller board like Arduino Diecimila mainly depends on the ATmega168. This board
includes digital I/O pins -14 where 6-pins can be used like PWM outputs & analog inputs-6, a USB
connection, a crystal oscillator-16 MHz, an ICSP header, a reset button & a power jack. This board can
be connected to a computer through a USB cable, and it can be activated using a battery and an AC-
DC adapter.
Page 7 of 23
the USB or FTDI chip we used and also it is entirely flat on the back. Creating it is very simple to
utilize in the project design. Just plug into the board, select the menu option to choose an Arduino
UNO and the program can be uploaded.We can control the RedBoard over a USB cable using the
barrel jack.
Page 8 of 23
Figure: Arduino Leonardo Board
Arduino Robot:
This kind of board is the first Arduino over wheels. This Arduino robot includes two processors on
each of its boards. The two boards are the motor board and control board where the motor board
controls the motors & the control board is used to read the sensors for operating. Every board is a
complete Arduino board, and its programming can be done through the Arduino IDE. These are
microcontroller boards that depend on the ATmega32u4.
The pins of this Robot are mapped to actuators and sensors onboard. The process of programming the
robot is the same as the Arduino Leonardo board. It is also named a small computer and it is
extensively used in robotics. This board includes the speaker, color screen, buttons-5, motors-2, a
digital compass, an SD card reader, potentiometers-2 & floor sensors-5. The library of this robot can
be used for controlling the sensors as well as the actuators.
Arduino Esplora:
The Arduino Esplora includes a small computer known as a microcontroller including a number of
inputs & outputs. The inputs of this board are a light sensor, four buttons, a microphone, an
accelerometer, joystick, a slider, a temperature sensor, etc. whereas the outputs are a 3 colors LED, a
buzzer. This kind of Arduino board looks like a videogame controller.
Page 9 of 23
board includes its own library so that the data from the sensors & actuators are very easy to read and
write.
Arduino Pro Mic:
The Arduino Pro Micro board is the same as the Arduino Mini board apart from the ATmega32U4
Microcontroller. This pro mic board includes digital I/O pins-12, pulse width modulation (PWM) pins-
5, serial connections of Tx & Rx &10-bit ADC.
Arduino Ethernet:
The Arduino Ethernet board depends on the microcontroller like ATmega328. This kind of
microcontroller board includes analog pins-5, digital I/O pins-14, RST button, an RJ45 connection,
crystal oscillator, a power jack, ICSP header, etc. The connection of the Arduino board can be done
through the Ethernet shield to the internet.
Arduino Zero:
This is a powerful as well as simple 32-bit board and it provides the best platform for innovative
projects like wearable technology, smart IoT devices, crazy robotics, high-tech automation, etc. This
board expands by providing improved performance, permitting a range of project opportunities &
performs like a great educational tool.
Page 10 of 23
RAM – 1 Mbyte
DMA controllers -4
Communication peripherals- Up to 35
16-bit Max Resolution with 3× ADCs
D/A converters with 2× 12-bit
Hardware with JPEG Codec
Timers -22 & Watchdogs – 200Mhz
HW Calendar & RTC with Sub-second Accuracy
Cryptographic Acceleration
Hifive1 Board Features:
The features of the Hifive1 board include the following.
Mega Form Factor or Arduino Uno
Charger for Battery
SD Card including Detection of Card Feature
Ethernet*
Optional QSPI Flash – 133Mhz
Interfaces – CAN, SWD, Camera
USB- OTG
The Arduino Shields:
Additionally, Arduino shields are pre-built circuit boards used to connect to a number of Arduino
boards. These shields fit on the top of the Arduino compatible boards to provide additional capabilities
like connecting to the internet, motor controlling, providing wireless communication, LCD screen
controlling, etc. The different types of Arduino shields are
Page 11 of 23
The comparison between different Arduino boards includes the following:
Arduino Board Voltage of System CLK Speed Digital I/O Analog Inputs PWM UART Interface of Programming
Arduino Pro
3.3V/8MHz 3.3V 8MHz 14 14 6 1 FTDI-Compatible Header
Arduino Pro
5V/16MHz 5V 16MHz 14 14 6 1 FTDI-Compatible Header
FTDI-Compatible Header or
Arduino Fio 3.3V 8MHz 14 8 6 1 Wirelessly via XBee†
LilyPad Arduino
Simple Board 3.3V 8MHz 9 4 5 0 FTDI-Compatible Header
Arduino IDE:
The Arduino IDE is an open-source software, which is used to write and upload code to the Arduino
boards. The IDE application is suitable for different operating systems such as Windows, Mac OS X, and
Linux. It supports the programming languages C and C++. Here, IDE stands for Integrated Development
Environment.
The program or code written in the Arduino IDE is often called sketching. We need to connect the Genuino
and Arduino board with the IDE to upload the sketch written in the Arduino IDE software. The sketch is
saved with the extension '.ino.'
The Arduino IDE will appear as:
Page 12 of 23
Toolbar Button:
The icons displayed on the toolbar are New, Open, Save, Upload, and Verify.
It is shown below:
Page 13 of 23
Upload:
The Upload button compiles and runs our code written on the screen. It further uploads the code to the
connected board. Before uploading the sketch, we need to make sure that the correct board and ports are
selected. We also need a USB connection to connect the board and the computer. Once all the above
measures are done, click on the Upload button present on the toolbar. The latest Arduino boards can be
reset automatically before beginning with Upload. In the older boards, we need to press the Reset button
present on it. As soon as the uploading is done successfully, we can notice the blink of the Tx and Rx LED.
If the uploading fails, it will display the message in the error window. We do not require any additional
hardware to upload our sketch using the Arduino Bootloader. A Bootloader is defined as a small program,
which is loaded in the microcontroller present on the board. The LED will blink on PIN 13.
Open:
The Open button is used to open the already created file. The selected file will be opened in the current
window.
Save:
The save button is used to save the current sketch or code.
New:
It is used to create a new sketch or open a new window.
Verify:
The Verify button is used to check the compilation error of the sketch or the written code.
Serial Monitor:
The serial monitor button is present on the right corner of the toolbar. It opens the serial monitor.
It is shown below:
When we connect the serial monitor, the board will reset on the operating system Windows, Linux, and
Mac OS X. If we want to process the control characters in our sketch, we need to use an external terminal
program. The terminal program should be connected to the COM port, which will be assigned when we
connect the board to the computer.
Menu Bar:
File
When we click on the File button on the Menu bar, a drop-down list will appear. It is shown below:
Page 14 of 23
Let's discuss each option in detail.
New
The New button opens the new window. It does not remove the sketch which is already present.
Open
It allows opening the sketch, which can be browsed from the folders and computer drivers.
Open Recent
The Open Recent button contains the list of the recent sketches.
Sketchbook
It stores the current sketches created in the Arduino IDE software. It opens the selected sketch or code in a
new editor at an instance.
Examples
It shows the different examples of small projects for a better understanding of the IDE and the board. The
IDE provides examples of self-practice.
Close
The Close button closes the window from which the button is clicked.
Save
The save button is used to save the current sketch. It also saves the changes made to the current sketch. If
we have not specified the name of the file, it will open ‘Save As...' window.
Page 15 of 23
Save As...
We can save the sketch with a different name using the 'Save As...' button. We can also change the name
accordingly.
Page Setup
It allows setting the page margins, orientation, and size for printing. The 'Page Setup' window will appear
as:
Print
According to the settings specified in the 'Page Setup', it prepares the current sketch for printing.
Preferences
It allows the customization settings of the Arduino IDE.
Quit
The Quit button is used to close all the IDE windows. The same closed sketch will be reopened when we
open the Arduino IDE.
Edit
When we click on the Edit button on the Menu bar, a drop-down list appears. It is shown below:
Page 16 of 23
Let's discuss each option in detail.
Undo
The Undo button is used to reverse the last modification done to the sketch while editing.
Redo
The Redo button is used to repeat the last modification done to the sketch while editing.
Cut
It allows us to remove the selected text from the written code. The text is further placed to the clipboard.
We can also paste that text anywhere in our sketch.
Copy
It creates a duplicate copy of the selected text. The text is further placed on the clipboard.
Copy for Forum
The 'Copy for Forum' button is used to copy the selected text to the clipboard, which is also suitable for
posting to the forum.
Page 17 of 23
Copy as HTML
The 'Copy for Forum' button is used to copy the selected text as HTML to the clipboard. It is desirable for
embedding in web pages.
Paste
The Paste button is used to paste the selected text of the clipboard to the specified position of the cursor.
Select All
It selects all the text of the sketch.
Go to line...
It moves the cursor to the specified line number.
The window will appear as:
Comment/Decomment
The Comment/ Decomment button is used to put or remove the comment mark (//) at the beginning of the
specified line.
Increase Indent
It is used to add the space at the starting of the specified line. The spacing moves the text towards the right.
Decrease Indent
It is used to subtract or remove the space at the starting of the specified line. The spacing moves the text
towards the left.
Increase Font Size
It increases the font size of the written text.
Decrease Font Size
It decreases the font size of the written text.
Find...
It is used to find the specified text. We can also replace the text. It highlights the text in the sketch.
The window will appear as:
Page 18 of 23
Find Next
It highlights the next word, which has specified in the 'Find...' window. If there is no such word, it will not
show any highlighted text.
Find Previous
It highlights the previous work, which has specified in the 'Find...' window. If there is no such word, it will
not show any highlighted text.
Sketch
When we click on the Sketch button on the Menu bar, a drop-down list appears. It is shown below:
Page 19 of 23
It is used to override the Bootloader that is present on the board. We can utilize the full capacity of the
Flash memory using the 'Upload Using Programmer' option. To implement this, we need to restore the
Bootloader using the Tools-> Burn Bootloader option to upload it to the USB serial port.
Export compiled Binary
It allows saving a .hex file and can be kept archived. Using other tools, the .hex file can also be sent to the
board.
Show Sketch Folder
It opens the folder of the current code written or sketch.
Include Library
Include Library includes various Arduino libraries. The libraries are inserted into our code at the beginning
of the code starting with the #. We can also import the libraries from the .zip file.
Add File...
The Add File... button is used to add the created file in a new tab on the existing file.
For example, let's add the ‘Blink' file to the 'Javatpoint' file. The tab will now appear as:
We can also delete the corresponding file from the tab by clicking on the small triangle -> Delete option.
Tools
When we click on the Tools button on the Menu bar, a drop-down list appears. It is shown below:
Page 20 of 23
Let's discuss each option in detail.
Auto Format
The Auto Format button is used to format the written code. For example, lining the open and closed curly
brackets in the code.
Archive Sketch
The copy of the current sketch or code is archived in the .zip format. The directory of the archived is same
as the sketch.
Fix Encoding and Reload
This button is used to fix the inconsistency between the operating system char maps and editor char map
encoding.
Manage Libraries...
It shows the updated list of all the installed libraries. We can also use this option to install a new library into
the Arduino IDE.
Serial Monitor
It allows the exchange of data with the connected board on the port.
Serial Plotter
The Serial Plotter button is used to display the serial data in a plot. It comes preinstalled in the Arduino
IDE.
Page 21 of 23
WiFi101/WiFiNINA Firmware Updater
It is used to check and update the Wi-Fi Firmware of the connected board.
Board
We are required to select the board from the list of boards. The selected board must be similar to the board
connected to the computer.
Processor
It displays the processor according to the selected board. It refreshes every time during the selection of the
board.
Port
It consists of the virtual and real serial devices present on our machine.
Get Board Info
It gives information about the selected board. We need to select the appropriate port before getting
information about the board.
Programmer
We need to select the hardware programmer while programming the board. It is required when we are not
using the onboard USB serial connection. It is also required during the burning of the Bootloader.
Burn Bootloader
The Bootloader is present on the board onto the microcontroller. This option is useful when we have
purchased the microcontroller without the bootloader. Before burning the bootloader, we need to make sure
about the correct selected board and port.
Help
When we click on the Help button on the Menu bar, a drop-down list will appear. It is shown below:
The Help section includes several documents that are easy to access, which comes along with the Arduino
IDE. It consists of a number of options such as Getting Started, Environment, Troubleshooting, Reference,
Page 22 of 23
etc. We can also consider the image shown above, which includes all the options under the Help section.
Some documents like Getting started, Reference, etc., can be accessed without an internet connection as
well. It will directly link us to the official website of Arduino.
Page 23 of 23