Module 5
Module 5
5) Introduction to ARDUINO
• Arduino is an open-source advancement prototyping (development model) platform
which depends on simple to utilize equipment and programming.
• Instructions to the microcontroller are given by the use of Arduino programming.
• Arduino software(IDE-Integrated improvement environment)
• The Arduino is a small computer that you can program to read information from the
world around you and to send commands to the outside world.
• Arduino is a tiny computer that you can connect to electrical circuits.
• The brain of this board (Arduino Uno) is an ATmega328p chip (Micro controller) where
you can store your programs that will tell your Arduino what to do.
5.1) Why Arduino?
5) Arduino is easy to use, connected to a computer via a USB and communicates using
serial protocol .
6) Inexpensive around 500 rupees per board with free authoring software.
7) Ardunio has growing online community where lots of source code is available for use .
• In the ten years since Arduino was released , hundreds of “Arduino boards” are available
in the market serving every kind of purpose.
• We focus on Arduino UNO .
• Some of the Boards from Arduino family are given below.
• Arduino mega is a big sister to the UNO with more memory and pins with a different chip
the Atmega2560,useful when your project doesn”t fits in an UNO.
• Arduino Micro is bit smaller with a chip Atmega32u4 that can act like a keyboard or
mouse which does its task with native USB.
• Its slim with downward pins which can be plugged into a breadboard.
• The Arduino MKR1000 is a little like an Arduino Micro but has a more powerful 32-bit
ATSAM ARM chip and built-in WiFi.
• A great upgrade for when you want to do internet of Things projects.
• Flora is an Arduino compatible from Adafruit which is a round wearable which can be
sewed (attach) into clothes.
• In order to keep your circuit organized you need to use a breadboard, pictured below in
Figure 5-6.
• The breadboard allows you to connect components together by plugging them into the
little holes.
• The key is to understand how the holes are connected.
• It can be associated with a system or web utilizing a standard LAN link on the
Ethernet port.
❖ CSI connector (CSI) – Camera Serial interface is a serial interface outlined (define) by
MIPI (Mobile Industry Processor Interface) organization together went for interfacing
cameras with a portable processor.
❖ HDMI- High Definition Multimedia Interface to give both video and sound yield.
6) Simple interfaces includes ADCs (Analog and Digital Converter) and DACS( Digital and
Analog Converter)
Accessories
❖ Camera: On 14 May 2013 , the establishment and the merchants RS Components and
Premier Farnell/ Element 14 propelled the Raspberry pi camera board with a firmware
redesign to bolster it.
❖ Gertboard- A Raspberry Pi Foundation authorized gadget intended for instructive
purpose, and grows the Raspberry Pi’s GPIO pins to permit interface with of LEDs ,
switches, sensors and different gadges.
❖ Serial :- The serial interface on Raspberry Pi has receive(rx) and transmit(Tx) pins for
communication with serial peripherals.
❖ SPI:- Serial Peripheral interfaces( SPI) is a synchronous serial data protocol used for
communication with one or more peripheral devices.
• MISO (Master In Slave Out): Master line for sending data to the peripherals.
• MOSI(Master out Slave In): Slave line for sending data to the master.
❖ I2C:- The I2C interface pins on Raspberry Pi allow you to connect hardware
modules.
5.8.5) Recalbox
• The default login for Raspbian is username “pi” with the password “raspberry”.
• To load the graphical user interface, type “Startx” and press Enter.
5.10) RaspberryPI Commands
• The DS18B20 also has an alarm function that can be configured to output a signal when
the temperature crosses a high or low threshold that’s set by the user
• A 64 bit ROM stores the device’s unique serial code. This 64 bit address allows a
microcontroller to receive temperature data from many sensors with identity.
• The DS18B20 temperature sensor is perfect for projects like weather stations and home
automation systems
• The size is same as a transistor and use only one wire for the data signal
• 0.5°C (9 bit); 0.25°C (10 bit); 0.125°C (11 bit); 0.0625°C (12 bit) resolution
• sudo reboot
• cd /sys/bus/w1/devices
• ls
• cd 28-xxxx
• cat w1_slave
• a3 01 4b 46 7f ff 0e 10 d8 : crc=d8 YES
• a3 01 4b 46 7f ff 0e 10 d8 t=32768
• You can access the command line of a Raspberry Pi remotely from another computer or
device
• The Raspberry Pi will act as a remote device: you can connect to it using a client on
another machine.
• If you are using wireless networking, this can be enabled via the desktop's user interface,
or using the command line
• You will need to note down the IP address of your Pi in order to connect to it later.
• Using the ifconfig command will display information about the current network status,
including the IP address, or you can use hostname -I to display the IP addresses associated
with the device
2. Enable SSH
• For headless setup, SSH can be enabled by placing a file named ssh, without any
extension, onto the boot partition of the SD card from another computer.
• When the Pi boots, it looks for the ssh file. If it is found, SSH is enabled and the file is
deleted
• SSH is built into Linux distributions and Mac OS. For Windows and mobile devices,
third-party SSH clients are available.
• With the cloud approach shown in Figure 5.14 , smart cities can also take advantage of
operating expense–based consumption models to overcome any financial hurdles in
adopting solutions to their most critical issues.
• Critical data, such as air condition (humidity, temperature, pollution) levels monitoring,
can be processed initially.
• Then, as the efficiency of IoT is scaled up, richer data processing can be enabled in the
cloud applications.
• For example, the humidity level can be used to regulate the color and luminosity of street
lights. In times when city budgets are strained, data processing can be scaled down to
essential services.
4) Services Layer
• Ultimately, the true value of ICT connectivity comes from the services that the measured
data can provide to different users operating within a city.
• Smart city applications can provide value to and visibility for a variety of user
types, including city operators, citizens, and law enforcement.
• The collected data should be visualized according to the specific needs of each consumer
of that data and the particular user experience requirements and individual use cases.
• For example, parking data indicating which spots are and aren’t currently occupied can
drive a citizen parking app with a map of available spots, as well as an enforcement officer’s
understanding of the state (utilization and payment) of the public parking space,
while at the same time helping the city operator’s perspective on parking problem areas in
the city at any given time.
• With different levels of granularity and scale, the same data performs three
different functions for three different users.
• Along the same lines, traffic information can be used by individual car drivers to find
the least congested route.
• A variation of the same information can be made available to public transportation users
to estimate travel times.
• Public transportation systems, such as buses, can be rerouted around known congestion
points.
• The number of subway trains can be increased dynamically to respond to an increase in
traffic congestion, anticipating the decisions of thousands or even millions of commuters
to take public transportation instead of cars on days when roads are very congested.
• Here again, the same type of data is utilized by different types of users in different ways
based on their specific use cases.
On-Premises vs. Cloud
• Different cities and regions have different data hosting requirements based on security or
legal policies. A key consideration in developing ICT connectivity solutions is whether a
city has requirements about where data should be hosted.
• Data can be hosted on-premises or in the cloud. Fog architectures provide an intermediate
layer.
• The data resulting from fog processing can be sent to the cloud or to a data center
operated locally (on-premises).
• On-premises encompasses traditional networks, and all their limitations, whereas cloud
hosting encompasses a whole host of security risks if the proper measures are not taken to
secure citizen data.
• When data is sent to the cloud, data sovereignty (supremacy) laws may restrict the
physical location where this data is actually stored.
• Ideally, a smart city utilizing ICT connectivity would use the cloud in its architecture, but
if this is impossible, the city would need to invest far more in the city layer’s networking
components (for example, switches, routers) and still may not be able to drive the same
cross-domain value propositions and scalability in its design.
5.17) Smart City Security Architecture
• A serious concern of most smart cities and their citizens is data security.
• Vast quantities of sensitive information are being shared at all times in a layered, realtime
architecture, and cities have a duty to protect their citizens’ data from unauthorized access,
collection, and tampering.
• In general, citizens feel better about data security when the city itself, and not a private
entity, owns public or city-relevant data.
• It is up to the city and the officials who run it to determine how to utilize this data.
• When a private entity owns city-relevant data, the scope of the ownership may initially be
very clear.
• However, later considerations or changes in the private entity strategy may shift the way
the data is used.
• It may then be more difficult for city authorities or the citizens to oppose this new direction,
simply because they do not have any stake in the decision-making process ofthe private
entity.
• For example, suppose that a private contractor is in charge of collecting and managing
parking sensor data.
• One possible way to increase the profitability of such data is to sell it to insurance
companies looking to charge an additional premium to car owners parking in the street (vs.
in a covered and secured garage).
• Such deviations from the original mandate are less likely to happen when cities own the
data and when citizens have a way to vote against such usages.
• A security architecture for smart cities must utilize security protocols to fortify each layer
of the architecture and protect city data.
• Figure 5.15 shows a reference architecture, with specific security elements highlighted.
Security protocols should authenticate the various components and protect data transport
throughout.
• For example, hijacking traffic sensors to send false traffic data to the system regulating
the street lights may result in dramatic congestion issues.
• The benefit for the offender may be the ability to get “all greens” while traveling, but the
overall result would typically be dangerous and detrimental to the city.
• The security architecture should be able to evolve with the latest technology and
incorporate regional guidelines (for example, city by-laws, county or regional security
regulations).
• Network partners may also have their own compliance standards, security policies, and
governance requirements that need to be added to the local city requirements.
54
• In the architecture shown in Figure 5.19, a video analytics sensor computes traffic events
based on a video feed and only pushes events (the car count, or metadata, not the
individual images) through the network.
• These events go through the architectural layers and reach the applications that can drive
traffic services.
• These services include traffic light coordination and also license plate identification for
toll roads.
• Some sensors can also recognize abnormal patterns, such as vehicles moving in the wrong
direction or a reserved lane. In that case, the video feed itself may be uploaded to traffic
enforcement agencies.