0% found this document useful (0 votes)
350 views31 pages

3.1 Basics of Hardware Design and Functions of Basic Passive Components

This document discusses a module on sensor interfacing with Arduino. The module objectives are to learn how to use different types of sensors with Arduino, how analog signals are converted to digital and vice versa, and how to interface with the real world using Arduino shields and libraries. It also provides background on microcontrollers, embedded systems, bootloaders, and why Arduino was developed.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
350 views31 pages

3.1 Basics of Hardware Design and Functions of Basic Passive Components

This document discusses a module on sensor interfacing with Arduino. The module objectives are to learn how to use different types of sensors with Arduino, how analog signals are converted to digital and vice versa, and how to interface with the real world using Arduino shields and libraries. It also provides background on microcontrollers, embedded systems, bootloaders, and why Arduino was developed.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 31

19IT502 EMBEDDED SYSTEMS

Academic year 2021 - 2022 ODD semester


Class: III B.Tech. IT

MODULE 3
SENSOR INTERFACING WITH ARDUINO

Basics of hardware design and functions of basic passive components-


sensors and actuators Arduino code - library file for sensor interfacing-
construction of basic applications.

Dr.M.Thillai Rani, AP/ECE


Module Objectives

Arduino senses the environment by receiving inputs from add-on devices


such as sensors, and can control the world around it by adjusting lights,
motors, and other actuators.

 To learn how and when to use the different types of sensors and how to
connect them to the Arduino.

 To learn how analog signals are converted back-and-forth and how this
must be considered as you program the device (Since the external world
uses continuous or analog signals and the hardware is digital).

 To learn about the use of Arduino-specific shields and the shields software
libraries to interface with the real world.
Microcontroller (µC, MCU)
Computer on a single Integrated Chip
 Processor (CPU)
 Memory (RAM / ROM / Flash)
 I/O ports (USB, I2C, SPI, ADC)

Common microcontroller families:


 Intel: 4004, 8008, etc.
 Atmel: AT and AVR
 Microchip: PIC
 ARM: (multiple manufacturers)

Used in:
Cell Phones, Toys, Household Appliances, Cars, Cameras, etc.
Embedded System
Embedded System
 An embedded system is a combination of computer hardware and software,
either fixed in capability or programmable, designed for a specific function or
functions within a larger system.
 Industrial machines, agricultural and process industry devices, automobiles,
medical equipment, household appliances, vending machines and toys, as well
as mobile devices, are possible locations for an embedded system.
Boot Loader
What's a boot loader?
Microcontrollers are usually programmed through a
programmer unless you have a piece of firmware in your
microcontroller that allows installing new firmware without
the need of an external programmer. This is called a boot
loader.
Why Was Arduino
Developed?

 Physical Computing – using components that can interact with people and
with the world around us
 The Arduino was originally developed for artists and designers to prototype
interactive displays at Italy by Massimo Banzi and David Cuartielles in
2005.
 Developed for non-scientists
 Minimalist programming
 “Forgiving” circuitry that can handle a wide variety of wiring errors
What is Arduino Not?

 It is not a chip (IC)


 It is not a board (PCB)
 It is not a company or a manufacturer
 It is not a programming language
 It is not a computer architecture

(although it involves all of these things...)

Official Definition: Arduino is an open-source electronics prototyping


platform based on flexible, easy-to-use hardware and software. It's
intended for artists, designers, hobbyists, and anyone interested in
creating interactive objects or environments.
So, What is
Arduino?

 An open-source electronics platform based on easy-to-


use hardware (electronic board) and software (IDE).
www.arduino.cc

 A electronic board, with on-board regulated power supply,


USB
port to communicate with PC, and an Atmel microcontroller chip.

 Anyone can get the details of its design and modify it or make his
So, What is
Arduino?
 It’s a movement, not a microcontroller
 Founded by Massimo Banzi and David Cuartielles in 2005 based
on “Wiring Platform”, which dates to 2003
 Open-source hardware platform
 Open source development environment

 Easy-to learn language and


libraries (based on Wiring
language)
 Integrated development
environment(based on
Processing programming
environment)
 Available for Windows
Mac / Linux
Why
 Arduino?
For whatever reason, Arduino microcontrollers have
become the de facto standard
 Strives for the balance between ease of use
and
usefulness
1. Programming languages seen
as major obstacle
2. Arduino C is a greatly simplified version of C+
+
 It is an open-source project, software/hardware is
extremely accessible and very flexible to be
customized and extended
 Arduino is backed up by a growing online
community, lots of source code is already available
and we can share and post our examples for others to
use, too!
 It is inexpensive and comes with free authoring
software
Original Arduino.cc Manufactured Arduino Uno: ₹
2,400.00 Electrical & Code compatible Arduino Uno
Different Arduino
Boards
 Arduino Uno
 Arduino Leonardo
 Arduino LilyPad
 Arduino Mega
 Arduino Nano
 Arduino Mini
 Arduino Mini Pro
 Arduino BT
 Arduino Due
Types of Arduino

Arduino Uno : 16MHz Arduino Nano : 16MHz


LilyPad Arduino : 8MHz

Arduino Pro Mini


: 8 (3.3 V)/16
Arduino Mega2560 : 16MHz Arduino Ethernet : 16MHz (5 V) MHz
Types of Arduino

Arduino MKR1000 : 48MHz Arduino 101 : 32MHz Arduino Zero : 48MHz

Arduino Due : 84MHz Arduino Yún : 16MHz and 400MHz Arduino Leonardo : 16MHz
Types of Arduino

Arduino Fio : 8MHz


Arduino Pro : 16MHz
Arduino Mega ADK : 16MHz

Arduino Esplora : 16MHz Arduino Micro : 16MHz


Arduino Uno & Its Parts
Key features of Arduino Uno
 An open source design. The advantage of it being open source is that it has a
large community of people using and troubleshooting it. This makes it easy to
find someone to help you debug your projects.

 An easy USB interface. The chip on the board plugs straight into your USB port
and registers on your computer as a virtual serial port. This allows you to
interface with it as through it were a serial device. The benefit of this setup is that
serial communication is an extremely easy (and time-tested) protocol, and USB
makes connecting it to modern computers really convenient.

 Very convenient power management and built-in voltage regulation. You can
connect an external power source of up to 12V and it will regulate it to both 5V
and 3.3V. It also can be powered directly off of a USB port without any external
power.

 An easy-to-find, and cheap, microcontroller "brain." The ATmega328 chip


retails for about $2.88 on Digikey. It has countless number of nice hardware
features like timers, PWM pins, external and internal interrupts, and multiple
sleep modes.
Key features of Arduino Uno
 A 16MHz clock. This makes it not the speediest microcontroller around, but fast
enough for most applications.

 32KB of flash memory for storing your code.

 13 digital pins and 6 analog pins. These pins allow you to connect external
hardware to your Arduino. These pins are key for extending the computing
capability of the Arduino into the real world. Simply plug your devices and
sensors into the sockets that correspond to each of these pins and you are good to
go.

 An ICSP connector for bypassing the USB port and interfacing the Arduino
directly as a serial device. This port is necessary to re-bootload your chip if it
corrupts and can no longer talk to your computer.

 An on-board LED attached to digital pin 13 for fast an easy debugging of code.

 And last, but not least, a button to reset the program on the chip.
Arduino Shields

Boards plugged on top of the Arduino PCB to extend its


capacities.
Different Arduino
Shields
 TFT Touch Screen
 Data Logger
 Motor/Servo Shield
 Ethernet Shield
 Audio Wave Shield
 Cellular/GSM Shield
 Wifi Shield
 Proto-shield, etc.
Electricity \ Electronics Basic Concepts
 Voltage (V)
Voltage, also called electromotive force, is the potential
difference in
charge between two points in an electrical field.
It is measured in Volt (V).
 Current (I)
Current is the rate at which electric charge flows past a point in a circuit. In
other words, current is the rate of flow of electric charge.
It is measured in Ampere (A).
 Resistance (R)
Resistance is a measure of the
opposition to current flow in an
electrical circuit.
It is measured in ohms, symbolized
by the Greek letter omega (Ω).
Alternating Current & Direct Current
 Alternating Current (AC)
Alternating current is defined as the flow of charge that changes direction
periodically. The result obtained will be, the voltage level also reverses along with
the current. Basically, AC is used to deliver power to industries, houses, office
buildings, etc.
 Direct current (DC)
Direct current is the movement of electric charge carriers, i.e. electrons in a
unidirectional flow. In DC, the intensity of the current will vary along with time,
but the direction of movement stays the same in all time. Here DC is referred to a
voltage whose polarity never reverses. DC power is widely used in low voltage
applications such as charging batteries, automotive applications, aircraft
applications.
Ohm’s Law
 The relationship between Voltage, Current and Resistance in
any DC electrical circuit was firstly discovered by the German
physicist Georg Ohm.
 Ohm's law states that the current through a conductor between
two points is directly proportional to the voltage across the two
points

The Ohm’s Law Triangle The Power Triangle


Current Flow , Voltage Flow & Resistance Analogies

 Water = Charge
 Pressure = Voltage (V)
 Flow = Current (I)
 Size of the Pipe = Resistance (R)
Circuit
 An electronic circuit is composed of individual electronic
components, such as resistors, transistors, capacitors, inductors
and diodes, connected by conductive wires or traces through
which electric current can flow. To be referred to as electronic,
rather than electrical, generally at least one active component
must be present.
 The word “circuit” is derived from the circle. An Electrical
Circuit must have a continuous loop from Power (Vcc) to
Ground (GND).
Electronic Components

 Active Components
Those devices or components which
required external source to their
operation is called Active Components.
For Example: Diode, Transistors, SCR,
ICs, etc.

 Passive Components
Those devices or components which do
not required external source to their
operation is called Passive Components.
For Example: Resistor, Capacitor,
Inductor, LDR, etc.
Resistor
 A resistor is a passive two-terminal electrical component that
implements electrical resistance as a circuit element.
 In electronic circuits, resistors are used to reduce current flow,
adjust signal levels, to divide voltages, bias active elements, and
terminate transmission lines, among other uses.
Breadboard
 A breadboard is a solder-less device for
temporary prototype with electronics and test
circuit designs.
 Because the solder-less breadboard does not
require soldering, it is reusable.
 This makes it easy to use for creating
temporary prototypes and experimenting with
circuit design.
Analog & Digital Signals
What is analog ?
 It is continuous range of
voltage values (not just 0 or
5V)
 Analog has many (infinite)
values

Why convert to digital ?


 Because our microcontroller
only
understands digital.
 Digital has two values: on and
off
Communication: I2C,
SPI
1. I2C (Inter-Integrated Circuit)
 Speed = 100 kHz, 400 kHz, and 3.4
MHz (not supported by Arduino)
 Two bi-directional lines: SDA
& SCL
 Multiple slaves can share same bus

2. SPI (Serial Peripheral Interface


Bus)
 Speed = 1-100 MHz (clock/
device limited)
 Four-wire bus: SCLK, MOSI, MISO &
SS
 Multiple slaves can share same bus (but
each needs a dedicated SS, slave select)
PWM & Duty Cycle
 Pulse-width modulation (PWM) is used for
controlling the amplitude of digital signals in
order to control devices and applications
requiring power or electricity.
 Duty cycle = Pulse Width / Wave Period
Additional Resources
1. https://www.arduino.cc/ - Arduino.cc is the home of Arduino platform. It
has extensive learning materials such as Tutorials, References, code for
using Arduino, Forum where you can post questions on issues/problems
you have in your projects, etc.
2. http://makezine.com/ - Online page of Maker magazine, with lots of
information on innovative technology projects including Arduino.
3. http://www.instructables.com/ - Lots of projects on technology and
arts
(including cooking), with step-by-instructions, photographs, and videos
4. http://appinventor.mit.edu/ - It allows the budding computer
programmers to build their own apps that can be run on Android devices. It
used a user-friendly graphical user-interface that allows drag-and-drop
technique to build applications that impacts the world.
5. http://fritzing.org/ - Fritzing is open source computer aided design (CAD)
software for electronic circuit design and printed circuit board (PCB)
fabrication, especially with Arduino prototyping. It is an electronic design
automation (EDA) tool for circuit designers.

You might also like