Introduction To IoT Lecture
Introduction To IoT Lecture
Definition:
Characteristics:
Dynamic and self-adapting: IoT devices and systems may have the capability to
dynamically adapt with the changing contexts and take actions based on their
operating conditions, user’s context, or sensed environment. For example,
consider a surveillance system comprising of a number of surveillance cameras.
The surveillance cameras can adapt their modes (normal to infra-red night
modes) based on whether it is day or night. Cameras could switch from lower
resolution to higher resolution modes when any motion is detected and alert
nearby cameras to do the same.
Self-configuring: IoT devices may have self-configuring capability, allowing a
larger number of devices to work together. These devices have the ability to
configure themselves (in association with the IoT infrastructure), setup the
networking, and fetch latest software upgrades with minimal manual or user
intervention.
Interoperable Communication Protocols: IoT devices may support a number of
interoperable communication protocols and can communicate with other devices
and also with the infrastructure.
Unique Identity: Each IoT device has a unique identity and unique identifier (such
as an IP address or URI). IoT systems may have intelligent interfaces which
adapt based on the context, allow communicating with users and the
environmental contexts. IoT device interfaces allow users to query the devices,
monitor their status, and control them remotely, in association with the control,
configuration and management infrastructure.
Integrated into information network: IoT devices are usually integrated into the
information network that allows them to communicate and exchange data with
other devices and systems. IoT devices can be dynamically discovered in the
network, by other devices and/or other network, and have the capability to
describe themselves (and the characteristics) to other devices or user
applications. For example, a weather monitoring node can describe its monitoring
capabilities to another connected node so that they can communicate and
exchange data. Integration into information network helps in making IoT systems
“smarter” due to the collective intelligence of the individual devices in
collaboration with the infrastructure. Thus the data from the large number of
weather monitoring IoT nodes can be aggregated and analysed to predict the
weather.
Introduction to Arduino
Arduino Board:
The Arduino board is a small microcontroller board, which is small circuit (the board)
which contains all the components required for this microcontroller to work properly
and to communicate with the computer. There are many types of Arduino boards
available, suitable for different requirements.
Microcontroller (MCU): The microcontroller is the heart (or, more appropriately, the
brain) of the Arduino board. Most Arduino boards consist of an Atmel 8-bit AVR
microcontroller ATmega8, ATmega168, ATmega328, ATmega1280, ATmega2560
with varying amounts of flash memory, pins, and features.
Clock Speed is the operating frequency of the microcontroller and is related to the
speed at which it can execute commands. Although there are rare exceptions, most
ATmega microcontrollers running at 3V will be clocked at 8MHz, whereas most
running at 5V will be clocked at 16MHz. The clock speed of the Arduino can be
divided down for power savings with a few tricks if you know what you’re doing.
Flash memory is the amount of program memory that the microcontroller chip has
available for storing your program.
Digital I/O: This is the number of digital input/output (I/O) pins that are broken out on
the Arduino board. Each of these can be configured as either an input or an output
using pinMode(), digitalWrite(), and digitalRead() functions. Some are capable of
PWM, and some double as serial communication pins.
Analog Inputs: This is the number of analog input pins that are available on the
Arduino board. Analog pins are labeled "A" followed by their number, they allow you
to read analog values using the analog-to-digital converter (ADC) in the ATMega
chip. Analog inputs can also be configured as more digital I/O if you need it.
PWM: This is the number of digital I/O pins that are capable of producing a Pulse-
width modulation. (PWM) signal. A PWM signal is like an analog output; it allows
your Arduino to “fake” an analog voltage between zero and the system voltage.
ADC: There are number of Analog to digital converter channels on Arduino boards.
An analog input pin gives input to particular ADC channel. The digital output is in 10
bits. Also there is one analog reference pin which determines how much maximum
analog voltage can be converted into digital.
Most widely used Arduino board is Arduino Uno. Arduino Uno is a microcontroller
board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can
be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP (In-circuit serial programming) header and a reset
button. It contains everything needed to support the microcontroller; simply connect it
to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get
started.
Each of the 14 digital pins on the Arduino Uno can be used as an input or output,
using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts.
Each pin can provide or receive a maximum of 40 mA and has an internal pull-up
resistor (disconnected by default) of 20-50 kOhms.
Serial: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the
ATmega328.
External Interrupts: pins 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value. See the
attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: The SPI (Serial Peripheral Interface) is another serial interface. The
ATmega328 has only one SPI module. Besides using it as a serial interface, it
can also be used to program the MCU using a standalone programmer. 10
(SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it’s off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide
10 bits of resolution (i.e. 1024 different values). By default they measure from
ground to 5 volts, though is it possible to change the upper end of their range
using the AREF pin and the analogReference() function. Additionally, some
pins have specialized functionality:
TWI:. The I2C or Two Wire Interface is an interface consisting of only two
wires, serial data, and a serial clock: SDA, SCL.
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add
a reset button to shields which block the one on the board.
RESET: (Reset input) A low level on this pin for longer than the 4 clock cycle will
generate a reset. Arduino Mega has inbuilt reset circuit with push button to reset system
and this pin can be used by other devices to reset controller.
XTAL1, XTAL2: Crystal (16Mhz) is connected to supply clock for controller with 2 bypass
capacitor to ground.
AREF: This pin is used, when we use Adc for analog to digital conversion with external
reference voltage for conversion and don’t want to use internal 1.1V or 5v reference.
Digital Pins: From 0-53(digital) and 0-15(analog) can be use as input or output for digital
transducer and output devices by pinMode() for pin direction, digtalWrite() to write pin
and digitalRead() to read pin status.
Analog pins: From 0-15(analog) can be used as analog input pin for adc, if not used than
it work as normal digital pin. It can be used by pinMode() for pin direction, analogRead()
to read pin status and get digital value for analog signal, care must be taken for internal
or external reference voltage selection and Aref pin.
SPI Pins:
These pins are used for serial communication with SPI protocol for communication
between 2 or more devices. SPI enable bit must be set to start communication with other
devices.
I2C Pins:
Digital pin 20 for SDA and 21 for SCK (Speed 400khz) to enable two wire
communication with others devices. Function used are wire.begin() to start I2C
conversion, with wire.Read() to read i2c data and wire.Write() to write i2c data.
PWM Pins:
Digital pin 2-13 can be used as PWM output with analogWrite() to write pwm value from
0-255.It’s alternative of DAC for low cost system to get analog signal at output by using
filter.
USART Pins :
This pin is used for serial usart communication with pc or other system for data sharing
and logging. It is used with serialBegin() to set baud rate setting and start communication
with serial.Println() to print array of char on other device output.
Digital pin 18 – 21, 2, 3 hardware interrupt is used for interrupt services. Hardware
interrupt must be enabled with global interrupt enable to get interrupt from other devices.
Picture: https://en.wikipedia.org/wiki/Arduino