Emb Lab 05

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Arduino: Introduction, I/O interfacing, Data types and variables

Objective:
The main objective of this lab is to get familiarize with basic functions and
interfacing of Arduino. Basically, the interaction of Arduino with Proteus and how
we can get a powerful environment for simulation of different applications.
Environment:
 Arduino IDE
 Proteus

Introduction:
The Proteus Design Suite is a proprietary software tool suite used primarily for
electronic design automation. The software is used mainly by electronic design
engineers and technicians to create schematics and electronic prints for
manufacturing printed circuit boards. For obtaining many embedded systems
relating applications in software we interact Arduino with Proteus. Arduino is an
open-source electronic platform based on easy-to-use hardware and software. We
install Arduino IDE library externally in Proteus. So, we perform so many
simulations of different real-world applications.
Methodology:
First of all, we installed the Arduino Desktop IDE on windows PC, then made
some important steps for installation. After that, we got familiarize with some
basic Functions, Data Types and variables. When we learned some functions of
Arduino, we installed Proteus Libraries by following some steps. Then, we
implemented some examples from Arduino examples on Proteus and did
simulation of those tasks.
Task-01: Blink LED:
In this Task, we simply implemented Arduino on-board LED blinking.
Components:
 Arduino Board
 LED
Arduino IDE Code:

Proteus Simulation:

Observation:
In this Task, we performed blinking of LED, so, we gave a delay to the LED so
that it changes its state from on to off and from off to on, after a specific defined
time.
Task-02-a: Read Analog Voltage:
This example shows you how to read an analog input on analog pin 0, convert
the values from analogRead() into voltage, and print it out to the serial monitor of
the Arduino Software (IDE).
Components:
 Arduino Board
 10k ohm Potentiometer
Arduino IDE Code:

Proteus Simulation:
Observation:
Potentiometers work by varying the position of a sliding contact across a uniform
resistance. A potentiometer has the two terminals of the input source fixed to the
end of the resistor. To adjust the output voltage the sliding contact gets moved
along the resistor on the output side. Here, when I slide potentiometer to right,
when upper side has zero resistance than output voltage is zero, when lower
resistance is zero and upper exists, then 5V drops and output voltage is 5V.
Task-02-b: Fading LED:
This example demonstrates the use of the analogWrite()  function in fading
an LED off and on. analogWrite uses pulse width modulation (PWM), turning a
digital pin on and off very quickly with different ratio between on and off, to
create a fading effect.
Components:
 Arduino Board
 LED
Arduino IDE Code:

Proteus Simulation:
Observation:
Here, LED is connected to the PWM pin, and we defined brightness of LED
and how many points to fade the LED by. So, we basically did fade of LED here.
Pulse Width Modulation, or PWM, is a technique for getting analog results with
digital means. Digital control is used to create a square wave, a signal switched
between on and off. The duration of "on time" is called the pulse width. To get
varying analog values, you change, or modulate, that pulse width.
Task-02-c: Play a Melody using a tone() function:
In this task, we defined a pitches.h file with our actual file. We ran a Buzzer
here.
Components:
 Arduino Board
 Buzzer/Sounder
Arduino IDE Code:
Proteus Simulation:

Observation:
We iterated our Souder on different notes, So, we obtained a melody on
Sounder at different notes. We also defined note duration. Note duration
calculation was done by one second divided by note type.
Conclusion:
We can perform simulation of different tasks by interacting Arduino with
Proteus. Arduino Libraries are not pre-installed in Proteus, we have to add them
externally. We learned how can we deal with different functions and Data types of
Arduino and performed simulation of different tasks. So, we can run number of
real-world application’s simulation on Arduino interacting with Proteus.
----------------------------------------------------------------------------------------------------

You might also like