Escolar Documentos
Profissional Documentos
Cultura Documentos
HISTORY
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping, aimed at students without a
background in electronics and programming. As soon as it reached a wider community, the Arduino board started changing to
adapt to new needs and challenges, differentiating its offer from simple 8-bit boards to products for IoT applications, wearable,
3D printing, and embedded environments. All Arduino boards are completely open-source, empowering users to build them
independently and eventually adapt them to their particular needs. The software, too, is open-source, and it is growing through
the contributions of users worldwide.
In 2005, building upon the work of Hernando Barragán (creator of Wiring), Massimo Banzi and David Cuartielles created Arduino,
an easy-to-use programmable device for interactive art design projects, at the Interaction Design Institute Ivrea in Ivrea, Italy.
David Mellis developed the Arduino software, which was based on Wiring. Before long, Gianluca Martino and Tom Igoe joined the
project, and the five are known as the original founders of Arduino. They wanted a device that was simple, easy to connect to
various things (such as relays, motors, and sensors), and easy to program. It also needed to be inexpensive, as students and
artists aren’t known for having lots of spare cash.
They selected the AVR family of 8-bit microcontroller (MCU or µC) devices from Atmel and designed a self-contained circuit board
with easy-to-use connections, wrote bootloader firmware for the microcontroller, and packaged it all into a simple integrated
development environment (IDE) that used programs called “sketches.” The result was the Arduino.
Since then the Arduino has grown in several different directions, with some versions.
PARTS OF ARDUINO
A. POWER RAIL
The power rail is how we get power from the Arduino to the rest of our devices.
3.3V – This pin provides 3.3 volts. This is the “positive side” of power.
5V – This pin provides 5 volts. This is also the “positive side” of power.
GND – Ground. This is the “negative side” of power. Note that there are 3 GND pins on the board. It does not matter
which one you use, they’re all connected.
Vin – This pin provides the voltage that is being supplied to the Arduino. So if a 9 volt battery is connected, it will provide
9 volts. This is also the “positive side” of power.
Be careful not to give attached devices, such as LED’s and Servos, too much power, especially when attaching external
battery packs.
Remember to mind your wires. If a wire attached to a positive pin touches a wire attached to a negative pin, you could
burn out your Arduino. This is called shorting the board.
Note:
Difference between Digital and Analog
Digital input signals are used to represent items that only have two (2) states, such as... ON (binary 1) or OFF (binary 0) states.
Similarly, Digital output signals are used to control items that again only have two states, such as.. START or STOP a device.
So, a digital signal is something like telling if a door is open or not.
Analog signals are variable, they have multiple states. Analog input signals can represent such items as temperature or level or
rate of flow. Analog output signals are also variable and can be used for such things as opening a valve to a desired position.
Then, an analog signal is something like telling how much the door is open (or closed).
In our day to day life, we mainly do analog measurements and all analog signals includes the digital ones like a door is 0%=closed
or 100%=open.
However, digital signals are more suitable for computers (PC/PLC, etc).
An analog signal can only be read by an analog I/O, but a digital one can use both analog or digital I/Os. There is sometime a
possibilities to convert an analog signal into a series of digital ones. Because, in practice, you never connect a digital signal to an
analog I/O because the analog I/Os are way more expensive than digital ones.
So for a rule of thumb,
Whenever possible use a digital I/O, since it’s cheap.
In other case, use an analog I/O if the option to convert the signal in a series of digital signals isn’t possible.
DIGITAL I/O
digitalRead() - Reads the value from a specified digital pin, either HIGH or LOW.
Syntax: digitalRead(pin)
Parameters pin: the number of the digital pin you want to read
Returns HIGH or LOW
analogRead() - Reads the value from the specified analog pin. Arduino boards contain a multichannel, 10-bit analog to
digital converter. This means that it will map input voltages between 0 and the operating voltage(5V or 3.3V) into integer values
between 0 and 1023. On an Arduino UNO, for example, this yields a resolution between readings of: 5 volts / 1024 units or,
0.0049 volts (4.9 mV) per unit. See the table below for the usable pins, operating voltage and maximum resolution for some
Arduino boards.
The input range can be changed using analogReference(), while the resolution can be changed (only for Zero, Due and MKR
boards) using analogReadResolution().
On ATmega based boards (UNO, Nano, Mini, Mega), it takes about 100 microseconds (0.0001 s) to read an analog input, so the
maximum reading rate is about 10,000 times a second.
Syntax: analogRead(pin)
Parameters pin: the name of the analog input pin to read from (A0 to A5 on most boards, A0 to A6 on MKR boards, A0 to A7 on
the Mini and Nano, A0 to A15 on the Mega).
analogWrite() - Writes an analog value (PWM wave) to a pin. Can be used to light a LED at varying brightnesses or drive a
motor at v speeds. After a call to analogWrite(), the pin will generate a steady square wave of the specified duty cycle
until t call to analogWrite() (or a call to digitalRead() or digitalWrite()) on the same pin. The frequency of the PW signal on
most pins is approximately 490 Hz. On the Uno and similar boards, pins 5 and 6 have a frequency of approximately 980
Hz.
On most Arduino boards (those with the ATmega168 or ATmega328P), this function works on pins 3, 5, 6, 9, 10, and the
Arduino Mega, it works on pins 2 - 13 and 44 - 46. Older Arduino boards with an ATmega8 only support analogWrite() on
pins 9, 10, and 11.
The Arduino DUE supports analogWrite() on pins 2 through 13, plus pins DAC0 and DAC1. Unlike the PWM pins, DA DAC1
are Digital to Analog converters, and act as true analog outputs.
You do not need to call pinMode() to set the pin as an output before calling analogWrite().
The analogWrite function has nothing to do with the analog pins or the analogRead function.
Syntax: analogWrite(pin, value)
Parameters pin: the pin to write to. Allowed data types: int.
value: the duty cycle: between 0 (always off) and 255 (always on). Allowed data types: int
Returns Nothing
analogReadResolution() - is an extension of the Analog API for the Arduino Due, Zero and MKR Family.
Sets the size (in bits) of the value returned by analogRead(). It defaults to 10 bits (returns values between 0-1023) for
backward compatibility with AVR based boards.
The Due, Zero and MKR Family boards have 12-bit ADC capabilities that can be accessed by changing the resolution to 12.
This will return values from analogRead() between 0 and 4095.
Syntax: analogReadResolution(bits)
Parameters bits: determines the resolution (in bits) of the value returned by the analogRead() function. You can set this
between 1 and 32. You can set resolutions higher than 12 but values returned by analogRead() will suffer approximation.
Returns Nothing
analogWriteResolution() – is an extension of the Analog API for the Arduino Due. It sets the resolution of the
analogWrite() function. It defaults to 8 bits (values between 0- 255) for backward compatibility with AVR based boards.
Syntax: analogWriteResolution(bits)
Parameters bits: determines the resolution (in bits) of the values used in the analogWrite() function. The value can range
from 1 to 32. If you choose a resolution higher or lower than your board’s hardware capabilities, the value used in
analogWrite() will be either truncated if it’s too high or padded with zeros if it’s too low.
Returns Nothing