Iot Notes 3
Iot Notes 3
Introduction to Arduino
• Arduino, a versatile open-source prototype platform, offers an
easily accessible combination of hardware and software. This platform
is powered by the ATmega328P microcontroller, allowing users to
create computer programs through its Integrated Development
Environment (IDE) and deploy them to a breadboard or any other
physical board for various applications.
Architecture of Arduino
1.USB connector:
• The USB connector is a fundamental
aspect of Arduino’s usability. It serves
as the gateway for communication
between your computer and the Arduino
board.
• When you connect your Arduino board
to your computer using a USB cable,
you establish a vital link that allows you
to upload code, receive data, and debug
your projects.
• This simple yet powerful feature is what
makes Arduino accessible to both
beginners and experienced developers.
It eliminates the need for specialized
hardware programmers or complex
interfaces, making the platform user-
friendly and efficient.
2. Power connector:
• Power is the lifeblood of any electronic
device, and Arduino is no exception. The
power connector on the Arduino board
ensures that it receives a stable supply of
electrical energy to operate effectively.
• While the USB connection can provide
power for many applications, the power
connector allows you to tap into mains
AC power, which can be crucial for
projects that require more substantial
power requirements.
3. Automatic power switch:
• The automatic power switch is a key
element in Arduino’s architecture
that often goes unnoticed but plays a
critical role.
• This component regulates the
voltage supplied to the Arduino
board from an external DC source. It
acts as a safety mechanism,
preventing potential damage to the
board due to voltage spikes or
fluctuations.
• This feature is particularly important
in scenarios where the power source
may not be entirely stable, such as
in portable devices or projects
connected to batteries. The
automatic power switch adds a layer
of protection, enhancing the
durability and reliability of Arduino-
based projects.
4. Digital pins:
• Arduino boards are equipped with a
set of 14 digital input/output (I/O)
pins. These pins are like the nerves of
the Arduino, allowing it to sense and
control the world around it. Arduino
Digital pins can be configured as
either inputs or outputs, providing
tremendous flexibility. When set as
inputs, they can read logic values,
which are essentially binary
information (0 or 1), from external
sensors, buttons, or other devices. As
outputs, these pins can send control
signals to various components like
LEDs, motors, or relays. This
versatility enables Arduino to interact
with a wide range of digital devices,
making it a powerful tool for
automation and control systems.
5.Analog pins:
• While digital pins handle binary data,
Arduino also offers six analog input
pins for tasks that require interfacing
with analog signals. Analog pins are
essential for applications where you
need to measure continuous values,
such as temperature, light intensity, or
sound levels. These pins can read
analog signals and convert them into
digital values through a process called
analog-to-digital conversion (ADC).
The availability of analog pins
expands Arduino’s capabilities,
allowing it to handle a broader
spectrum of sensors and inputs.
6. Power pins:
• The power pins on the Arduino UNO,
a popular Arduino variant, encompass
a total of seven pins, each serving a
specific purpose within the power
supply circuit. Understanding these
power pins is vital for designing and
troubleshooting Arduino projects.
Arduino board Specifications:
Arduino pin diagram:
• VCC (Voltage Supply): VCC stands
for Voltage Common Collector, and it
represents the digital voltage supply.
This pin ensures that the
microcontroller and connected
components receive a stable and
regulated supply of voltage. It is the
lifeline of the entire system, and
without it, the Arduino board and its
peripherals would cease to function.
• AVCC (Analog Voltage Supply):
AVCC serves as the supply voltage pin
for the analog-to-digital converter
(ADC) within the microcontroller.
Precise analog-to-digital conversion
relies on a stable reference voltage,
which AVCC provides. This pin is
critical for applications that demand
accurate analog measurements.
• GND (Ground): GND, or Ground,
plays a pivotal role in electrical circuits.
It is the reference point for all voltage
measurements and a crucial part of the
power supply circuit. Without a
common ground, voltage references
become unreliable, and the circuit’s
behavior becomes unpredictable.
• Port A, B, C, and D
• Port A (PA0 to PA7): Port A primarily
acts as analog input for the
microcontroller’s analog-to-digital
converters (ADC). When you’re not
using it for ADC, Port A transforms into
an eight-bit bidirectional input/output
(I/O) port. This dual functionality is
advantageous when you need both
analog and digital capabilities in a
single project.
• Port B (PB0 to PB7): Port B, like
Port A, is an eight-bit bidirectional
port. It also comes with internal
pull-up resistors, simplifying
interfacing with external devices.
This feature reduces the need for
additional components in certain
applications.
• Port C (PC0 to PC7): Port C offers
pins with symmetrical drive
characteristics, making it suitable
for applications that require
balanced signal outputs. These pins
can source or sink current
effectively, allowing for robust
control of connected devices.
• Port D (PD0 to PD7): Port D is another
eight-bit input/output (I/O) port, similar to
Port B. It includes internal pull-up
resistors, making it convenient for digital
input applications. When configured as
outputs, these pins can drive various
components, making them versatile for
different project requirements.
AREF (Analog Reference)
• In the realm of analog-to-digital
conversion (ADC), AREF stands as a
critical pin. It serves as an analog
reference point for the ADC. When you’re
working with analog sensors or signals,
it’s essential to have a stable reference
voltage to ensure accurate measurements.
AREF provides this reference voltage,
allowing the microcontroller to precisely
convert analog inputs into digital values.
This pin is particularly valuable for
applications like environmental sensing or
instrumentation.
Extended Arduino Tools
• Arduino’s flexibility extends beyond its core board and
components. It encompasses a vast ecosystem of tools and
boards designed to cater to specific project needs. These
extended tools include:
1. Panda Board: The Panda board is one of the many
specialized Arduino boards available. It is tailored for specific
applications, often involving robotics or advanced control
systems. The Panda board comes equipped with additional
features and connectors, making it suitable for complex
projects requiring high-level control and functionality.
2. Sensors: Arduino supports a wide array of sensors, from basic
temperature and humidity sensors to advanced gyroscopes and
accelerometers. These sensors enable Arduino to gather data from the
surrounding environment, making it a popular choice for IoT (Internet
of Things) applications. Whether you want to build a weather station or
a smart home device, there’s likely a compatible sensor available.
3. Shields: Shields are add-on boards that stack onto the Arduino and
provide specific functionalities. For example, there are shields for GPS,
Ethernet, Wi-Fi, and motor control, among others. Shields simplify the
process of adding advanced features to your project without the need for
complex wiring or additional components.
Code to blink a LED
int led_pin=13;
void setup()
{
pinMode(led_pin,OUTPUT);
}
void loop()
{
digitalWrite(led_pin,HIGH);
delay(500);
digitalWrite(led_pin,LOW);
delay(500);
}
• Program with Arduino IDE:
• Open the Arduino IDE and write the
following program to blink an LED.
After writing the program you may
save it with a file name of your
choice (find File–>Save on menu bar
of IDE)
• Select the Arduino board type in your
IDE. here we are using an Arduino
Nano board. To choose the board,
find Tools on menu bar. Choose the
option “Board” – and select your
correct Arduino board
• https://youtu.be/y5znFDmY5V4?si=
KkxUpqo8V4kPCCDD.
• https://youtu.be/ELUF8m24sZo?si=n
i1UckRiBkyD-snt
• pinMode (13, OUTPUT) − To use Arduino’s pins, we need to declare
this General pin, either as an INPUT or OUTPUT. We use a built-in
“function” called pinMode () to declare pin 13 as an output.
• digitalWrite (13, HIGH) − When you are using a pin as an OUTPUT,
you can command it to be HIGH (output 5 volts), or LOW (output 0
volts).
• HVAC systems: Humidity sensors are used to control the relative humidity
levels in buildings, which can improve air quality and reduce the risk of
mold and mildew growth.
• Weather forecasting: Humidity sensors are used to measure the moisture
content in the air, which is an important factor in weather forecasting.
• Industrial processes: Humidity sensors are used to monitor the moisture
content in materials during manufacturing processes, which can affect
product quality and consistency.
• Medical devices: Humidity sensors are used in medical devices such as
respiratory therapy equipment and incubators to control humidity levels.
• Agriculture: Humidity sensors are used in agriculture to monitor soil
moisture levels, which can help optimize crop growth and water usage.
3. Pressure Sensors
• Pressure sensors are a type of IoT sensor that measure the pressure
of gases and liquids. They are used in a wide range of industries,
including automotive, aerospace, and medical.
• Pressure sensors play a critical role in maintaining safe and efficient
operations, from monitoring tire pressure in cars to measuring the air
pressure in an airplane cabin.
• Pressure sensors are devices that measure the force exerted by a gas
or liquid on a surface area. They convert this force into an electrical
signal that can be measured and analyzed.
How they Sense Pressure
• Pressure sensors work based on the principle that the force exerted
by a gas or liquid on a surface is proportional to the pressure. They
consist of a diaphragm or other type of surface that flexes when
subjected to pressure. This flexing is converted into an electrical
signal that can be measured and analyzed.
• The following are some of the most common types of pressure sensors:
• Absolute Pressure Sensors
• These sensors measure the pressure relative to a vacuum or absolute zero
pressure. They are typically used for applications where it is necessary to
know the true pressure, such as in altitude measurement.
• Gauge Pressure Sensors
• These sensors measure the pressure relative to atmospheric pressure. They
are commonly used in industrial and automotive applications to monitor
and control pressure in systems.
• Differential Pressure Sensors
• These sensors measure the difference in pressure between two points.
They are often used in HVAC systems to measure the pressure difference
across an air filter, or in flow meters to measure the flow rate of fluids.
Applications of Pressure Sensors
• Limited range: Light sensors have a limited range and can only
measure light within a certain distance.
• Susceptible to noise: Light sensors can be affected by external factors
such as electrical noise or interference from other light sources.
• Sensitivity to temperature: Some types of light sensors can be
affected by changes in temperature, which can affect their accuracy.
• Types of IoT Sensors, Components, Applications and Future Trends
(datanext.ai)