Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
INTRODUCTION TO IOT
The Internet of Things (IoT) is the network of physical devices, vehicles, home
appliances, and other items embedded with electronics, software, sensors, actuators, and
connectivity which enables these things to connect and exchange data, creating opportunities
for more direct integration of the physical world into computer-based systems, resulting in
efficiency improvements, economic benefits, and reduced human exertions.
NEED OF IOT
Today, we are seeing the electrification of the world around us. Almost any
manufactured good now includes an embedded processor (typically a microcontroller, or
MCU), along with user interfaces, that can add programmability and deterministic command
and control functionality. The electrification of the world and the pervasiveness of embedded
processing are the keys to making objects smart. After a device becomes smart through the
integration of embedded processing, the next logical step is remote communication with the
smart device to help make life easier.
Communication capability and remote manual control lead to the next step of
automating things. And, for those applications to connect with and leverage the Internet to
achieve this goal, they must first become / incorporate an MCU/embedded processor with an
associated unique ID, then connected and, finally, controlled. Those capabilities can then
enable a new class of services that makes life easier for their users.
1
For the network, sophisticated cloud-based processing requires a new generation of
communications processors that can keep track of all of those connected devices, communicate
with them and translate their functionality into useful services, all with non- linear
improvement to their performance and efficiency. The challenge will be to build secure
networks that keep up with demand, while simultaneously reducing energy consumption and
cost of equipment.
1. SMART HOME
Smart Home has become the revolutionary ladder of success in the residential spaces
and it is predicted Smart homes will become as common as smartphones. The cost of owning
a house is the biggest expense in a homeowner’s life. Smart Home products are promised to
save time, energy and money. With Smart home companies like Nest, Ecobee, Ring and
August, to name a few, will become household brands and are planning to deliver a never seen
before experience.
A home automation system will control lighting, climate, entertainment systems, and
appliances. It may also include home security such as access control and alarm systems. When
connected with the Internet, home devices are an important constituent of the Internet of
Things.
2. WEARABLES
Wearables have experienced a explosive demand in markets all over the world.
Companies like Google, Samsung have invested heavily in building such devices. Wearable
2
devices are installed with sensors and software’s which collect data and information about the
users. This data is later pre-processed to extract essential insights about user. These devices
broadly cover fitness, health and entertainment requirements.
3. CONNECTED CARS
4. INDUSTRIAL INTERNET
IoT holds great potential for quality control and sustainability. Applications for tracking
goods, real time information exchange about inventory among suppliers and retailers and
automated delivery will increase the supply chain efficiency. According to GE the
improvement industry productivity will generate $10 trillion to $15 trillion in GDP worldwide
over next 15 years.
5. SMART CITIES
Smart city is another powerful application of IoT generating curiosity among world’s
population. Smart surveillance, automated transportation, smarter energy management
systems, water distribution, urban security and environmental monitoring all are examples of
internet of things applications for smart cities.
IoT will solve major problems faced by the people living in cities like pollution, traffic
congestion and shortage of energy supplies etc.
6. IOT IN AGRICULTURE
With the continuous increase in world’s population, demand for food supply is
extremely raised. Governments are helping farmers to use advanced techniques and research
to increase food production. Smart farming is one of the fastest growing field in IoT. Sensing
for soil moisture and nutrients, controlling water usage for plant growth and determining
custom fertilizer are some simple uses of IoT.
3
7. SMART RETAIL
The potential of IoT in the retail sector is enormous. IoT provides an opportunity to
retailers to connect with the customers to enhance the in-store experience. Smartphones will
be the way for retailers to remain connected with their consumers even out of store. Interacting
through Smartphones and using Beacon technology can help retailers serve their consumers
better. They can also track consumer’s path through a store and improve store layout and place
premium products in high traffic areas.
8. ENERGY ENGAGEMENT
Power grids of the future will not only be smart enough but also highly reliable. Smart
grid concept is becoming very popular all over world. The basic idea behind the smart grids is
to collect data in an automated fashion and analyze the behavior or electricity consumers and
suppliers for improving efficiency as well as economics of electricity use.
9. IOT IN HEALTHCARE
The concept of connected healthcare system and smart medical devices bears enormous
potential not just for companies, but also for the well-being of people in general. IoT in
healthcare is aimed at empowering people to live healthier life by wearing connected devices.
The collected data will help in personalized analysis of an individual’s health and provide tailor
made strategies to combat illness. The video below explains how IoT can revolutionize
treatment and medical help.
Livestock monitoring is about animal husbandry and cost saving. Using IoT
applications to gather data about the health and well being of the cattle, ranchers knowing early
about the sick animal can pull out and help prevent large number of sick cattle.
4
Chapter 2: Introduction to Mini-Project: - Home Automation
SMART HOME: A Smart Home is one that provides its home owners comfort, security,
energy efficiency (low operating costs) and convenience at all times, regardless of whether
anyone significant is home
Objectives:
5
The user will be able to control home devices/appliances using actions and certain
events and he/she will be notified about the events. The Wifi Module can be connected to a
cloud server and can store the information regarding all the events and readings on to the cloud.
The user can then access his/her cloud account to get all the details captured by the sensors.
Also prior automation can be done using the micro-controller to sense the number of people in
a room and turn on/off devices as per. This will further ease the task of user to switch on/off
the appliances every time he/she enters the room or exits the room.
Features:
Keeping track of no. of people in a room and performing tasks as per pre-loaded
commands
Checking for any fire situation
Checking for room temperature
Keeping track of all the data and uploading it to the cloud for the user to go through it
anytime he/she wants.
6
IOT Home Automation using Arduino
First, the Arduino UNO board is connected to the appliances (3 bulbs of different
colours and 1 dc fan) by using relays. A program is written in order to take user’s input from
the website and perform particular tasks according to it. GPRS is used to connect the Arduino
board with the website and the input given to the website is thus passed on to the Arduino
board. Thus, we can give command to change our appliance’s status from anywhere using our
website. On that website, an interface is made for user to change the status of his/her appliances.
Whenever user makes any changes in the website, the changes are followed in the Arduino
board and then to the appliances themselves. This is done by writing a program to carry forward
the changes made by the user to the Arduino board and then make changes to the appliances.
Thus, we can achieve remote access to our home appliances. [1]
The first step is to select your hardware. There are several different versions available
from several different manufacturers. These manufacturers deliver to different areas of the
globe, with a full list given on the main Arduino site. The example code in this tutorial assumes
that you are using one of the models that includes a built-in temperature sensor (like the
Arduino Leonardo, for example).
Most Arduino boards interface over USB with the development computer. For those
which don’t, there are extra modules, called shields, available to provide USB communication.
When you plug it into your Linux box, it should show up as a serial device under /dev/ttyUSBX
or /dev/ttyACMX. You can check which by executing dmesg and looking for the messages
generated when you plug it in.
Installing the required software has gotten much easier recently. You should be able to
find packages in most distributions that will handle everything for you. For example, Debian-
based distros use ‘sudo apt-get install arduino’ to install the IDE, compiler and other required
packages for Arduino development.
7
Step 04: Start a new program
Now that you have your Arduino plugged in, you can start up your IDE and begin
programming your first project. Programs in Arduino speak are called sketches, and they are
stored in a sketchbook.
Since there are so many variations of the Arduino available, you need to tell the IDE
which one you will be generating code for. Clicking on Tools>Board will pull up a list of all
of the boards that it understands. We selected Leonardo for this example.
The Arduino IDE scans all of the available serial port devices on your Linux box and
presents them as options. Clicking on Tools>Serial Port will pull up this list so that you can
select the correct one. Remember to check dmesg to see which one is associated to your
Arduino.
Normally, you upload your code using the built-in bootloader. You can use an external
programmer instead. If you decide to do this, then you can select the programmer you are using
by clicking Tools>Programmer.
Clicking on File>Preferences will pop up another dialog window where you can set
preferences for the IDE. The ones you will likely want to set are the verbose outputs for
verifying and uploading. This will be helpful when you are first starting out.
The Arduino IDE includes a very complete set of examples to get you started. They are
broken down into groupings based on what they do. So there are examples for string processing,
controlling servos etc. Selecting one of these examples will open the referenced sketch in a
new window.
There are two necessary parts of every program: a setup function and a loop function.
When power is applied to the Arduino, your program starts up immediately. The setup function
runs once and is used for initialisation steps. Then the loop function starts up and continues for
ever.
8
Step 11: Setup
We are going to want to see what this temperature sensor is doing, so we will need to
set up a serial connection. ‘Serial.begin(9600)’ opens the serial connection and sets the speed
to 9600. Then you can print text out on this new serial connection.
The main loop is the part of your program that does all of the work. In this case we will
be calling a function to get the temperature and print it out. Then we sleep for 1000ms with the
function ‘delay’. At the end of this delay we circle back up to the top of the loop function.
You can define your own functions in your code. In this example, we create the function
GetTemp which takes no arguments and returns a double. This code is very C-like, so if you
have any experience with C you should be able to read and write code for the Arduino.
Once you have your program finished, you need to compile it. In the Arduino IDE, this
step is called verification. When you verify your program, it gets run through the compiler,
allowing you to check for any errors. The compiler output goes to the console and to the lower
pane in the main window. If you set verbose output for verification in the preferences, then
more complete output gets displayed in the lower pane. It is like setting verbose flags on GCC
when you compile directly on the command line. You can then go and fix any errors and check
on any warnings until your code compiles cleanly.
Once you have a program that compiles and you are confident is correct, you can then
upload it to your Arduino. Clicking on File> Upload will recompile your program and then
attempt to send it over the serial port you selected earlier.[2]
9
Block Diagram -
10
Flow Chart -
11
4.2 Hardware, Software and Cloud Platforms used
HARDWARE -
Microcontroller - ATmega2560
Operating Voltage – 5V
SRAM - 8 KB
12
EEPROM - 4 KB
LED_BUILTIN – 13[3]
2. IR Sensor(LM393)
Working voltage: 3 - 5V DC
3. Temperature Sensor(LM35)
13
Calibrated Directly in Celsius (Centigrade)
4. WiFiModule(ESP8266)
802.11 b/g/n
14
STBC, 1×1 MIMO, 2×1 MIMO
5. Smoke Sensor(LM393MQ2)
Working voltage: DC 5V
15
figure 4.7 smoke sensor(LM393MQ2)
Voltage – 2-3.5 V
Current – 20mA
Resistance – 5k ohm
SOFTWARE -
1. Arduino IDE
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file extension .ino. The
editor has features for cutting/pasting and for searching/replacing text. The message
area gives feedback while saving and exporting and also displays errors. The console
16
displays text output by the Arduino Software (IDE), including complete error messages
and other information. The bottom righthand corner of the window displays the
configured board and serial port. The toolbar buttons allow you to verify and upload
programs, create, open, and save sketches, and open the serial monitor.[8]
2. Windows OS
OTHER -
1. Internet Connection
1. We planned what all facilities are we going to provide the end user and gathered all the
required hardware and software according to it.
2. Implementing one sensor at a time, we tested our code and see if we got the desired
output. Initially we started with easy to implement sensors like buzzer, temperature
sensor, smoke sensor, etc.
3. Temperature Sensor -
I. Temperature sensor has 3 pins (vcc, input, ground), we connected the sensor pins with
the Arduino board and then burned the code onto the board. The figure 4.3 shows how
usually a temperature sensor is connected to an Arduino board.
II. The sensor takes input of the surrounding temperature and passes the readings to the
board in form of voltage.
17
III. Then we need to convert this readings into degree Celsius. For that, appropriate
calculations are required and then the output is displayed on Serial Monitor.
4. Smoke Sensor -
I. The smoke sensor has 4 pins(A0, D0, vcc, ground). We can get analog or digital
readings as per our requirement. So we connect A0, vcc and ground to our board. The
figure 4.4 shows how generally a smoke sensor is connected to an Arduino board.
II. Then in our code we set a particular threshold for smoke detection. If the readings cross
this threshold, then a certain event will trigger.
18
III. We set that threshold to 200 and the smoke sensor keep on getting readings.
5. Buzzer -
I. The buzzer performs basic task of emitting sound frequency when certain event occurs.
II. The buzzer had 2 pins (vcc, ground). We connect these pins with the Arduino board.
The figure 4.5 shows how generally a smoke sensor is connected to an Arduino board.
III. According to our code, we then decide when the buzzer should go on and when the
buzzer should be off.
6. IR -
19
II. IR Sensors have 3 pins (). We connect both the IR Sensors with the Arduino board and
place them adjacent to each other at a particular distance. The figure 4.6 shows how
generally an IR sensor is connected to an Arduino board.
III. Then we burn our code to the Arduino board which executes our logic of calculating
number of people and tell us the count of them according to people coming in or going
out of the room.
IV. Using that count, we then decide how to control the home appliances(bulb and fan).
More than 1 person in room → Leave the appliances in the same state they are
in.
7. WiFi Module -
I. Next was to connect out Arduino board with an andriod device. We used ESP8266
module to do so.
20
II. ESP8266 has 8 pins put of which only 5 pin connections are required(). We connect
those pins accordingly to Arduino board. The figure 4.7 shows how generally a
ESP8266 Module is connected to an Arduino board.
III. Initially we connected our board with ESP module through connecting wires and then
we configured the ESP module to search for Wifi by providing SSID and Password of
the mobile hotspot.
IV. After establishing the connection we can send message to the cellphone connected
whenever required.
21
4.4 Hardware Circuit Diagram
4.5 Code
IR LOGIC
int IR1_out = HIGH;
int IR2_out = HIGH;
int count = 0;
void setup() {
// put your setup code here, to run once:
pinMode(8, INPUT); // ir sensor input value for incoming Count
pinMode(13, INPUT); // ir sensor input value for Outgoing Count
pinMode(10,OUTPUT);
Serial.begin(9600);
22
}
void loop() {
// put your main code here, to run repeatedly:
int IR1_out = digitalRead(8);
int IR2_out = digitalRead(13);
int LED = digitalRead(10);
if(IR1_out == LOW) {
IN();
}
if(IR2_out == LOW) {
OUT();
}
delay(200);
}
void IN()
{
do{
IR2_out = digitalRead(13);
delay(200);
}while(IR2_out);
count ++;
Serial.print("INSIDE-COUNT:");
Serial.println(count);
delay(200);
if (count > 0){
digitalWrite(10, HIGH);
}
else {
23
digitalWrite(10, LOW);
}
}
void OUT()
{
do{
IR1_out = digitalRead(8);
delay(200);
}while(IR1_out);
count--;
Serial.print("OUTSIDE-COUNT:");
Serial.println(count);
delay(200);
if (count > 0){
digitalWrite(10, HIGH);
}
else {
digitalWrite(10, LOW);
}
}
24
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT); // Set ledPin as Output
pinMode(smokeA0, INPUT);
Serial.begin(9600); // PC Arduino Serial Monitor
Serial1.begin(115200); // Arduino to ESP01 Communication
connectWiFi(); // To connect to Wifi
}
void loop() {
// put your main code here, to run repeatedly:
float analog_val = analogRead(temp_sensor); // Read Analog Temperature
float digital_vout = (analog_val*5000.0)/1023; // Convert Analog Tempt. to Digital Value (10 bit
ADC) // mV
float tempc = digital_vout/10; // Storing value in Degree Celsius
float smokec = analogRead(smokeA0);
//j=tempc;
// TCP connection
String cmd = "AT+CIPSTART=\"TCP\",\""; // TCP connection with https://thingspeak.com server
cmd += "184.106.153.149"; // IP addr of api.thingspeak.com
cmd += "\",80\r\n\r\n"; // Port No. = 80
25
Serial.println(cmd); // Send above command to Rx1, Tx1
26
{
Serial.println("connected to Cloud"); // Display confirmation msg to PC
Serial1.print(getStr); // Send GET String to Rx1, Tx1
}
else
{
Serial1.println("AT+CIPCLOSE\r\n"); // Send Close Connection command to Rx1, Tx1
Serial.println("AT+CIPCLOSE"); // Display Connection closed command on PC
}
27
if(Serial1.find("+CWJAP"))
{
Serial.println("OK, Connected to WiFi."); // Display Confirmation msg on PC
return true;
}
else
{
Serial.println("Can not connect to the WiFi."); // Display Error msg on PC
return false;
}
}
28
figure 4.15: final temperature and smoke sensor setup
The proposed project provides a Home Automation System that uses WiFi Module and
Smartphone assistant to connect all home appliances with the user. The project provides a user-
friendly automation system with low cost and good performance. The user gives command
through the android application which is connected to Arduino Mega with the help of ESP8266
then the electrical appliances of a home can be regulated.
29
Future Scope -
Our project is just a prototype of a home automation system. There are various things
which can be implemented along with our project in order to make it a full-fledged home
automation system.
By taking the reading from the smoke sensor, we can perform various tasks. For
example, if the smoke sensors senses smoke from a fire then we can use water sprinkler to put
off the fire and save a calamity.
For improving security of the home, we could add a fingerprint scanner or a web camera
to identify the person trying to enter the house. We can create a database of existing people
living in the house and also the people who are allowed to enter the house. Every time someone
tries to enter the house, a notification will be sent to the user mentioning the image of the person
trying to enter the house.
We can make an android app or we cn connect our Arduino board with voice assistance
in order to enable the feature of voice control over cell phone or even going as far as to install
mics in the room to capture voice commands from user and perform tasks as per.
1. The main constraint will be the Arduino Mega board. Although we were able to
implement this project on a small scale, in order to implement it on a large scale – an
entire building or an office, Arduino Mega will fall short since it has less number of
pins and processing capabilities.
2. IR Sensors used here have very small range of detecting input from the surrounding
movements. So in real life, we have to use much better performing IR Sensors to get
the correct input or else it will create a major flaw in our system.
3. The temperature sensor also works on a small scale. For the temperature sensor to
measure temperature of the entire room, we require good sensors than the current one.
Or else we can user multiple temperature sensors and scatter it in the room and take the
average reading from them in order to decide the room temperature.
30
4. Connecting actual appliances like bulbs or a fan to our Arduino board might damage
our board, since the voltage required for such appliances is very large than the voltage
we provide to our board.
References -
1. https://www.youtube.com/watch?v=xTyPSPzD8-M (Accessed on: 18/08/2018 05:46
pm)
4. http://qqtrading.com.my/ir-infrared-obstacle-detaction-sensor-module-fc-5 (Accessed
on: 26/09/2018 10:35 pm)
7. https://www.alibaba.com/product-detail/LM393-ZYMQ-2-MQ2-Gas-
Sensor_60702921381.html?s=p (Accessed on: 29/09/2018 08:16 pm)
31
APPENDIX
ASSIGNMENT NO 1
DEFINITION:
Automatic meter reading (AMR) is the collection of, at a remote central location, data from
consumption meters located at customers’ premises via telecommunication links.
The meters could measure gas, water or electricity flow. These links could be Telephone lines,
powerline carrier communication (PLCC), Radio frequency CATV etc.
Automatic Meter Reading (AMR) is a telephone-based, calling outbound system, for utility
control and reliable, low-cost meter reading.
With the use of AMR, the need of a person to visit the consumer’s site and record the readings
of the meters is eliminated. This also prevents human errors in recording the reading.
WHAT'S AMR?
32
HOW DOES THE SYSTEM WORK?
This device is connected directly to a special electronic register on the water meter.
Normally, the ERT does nothing - it "sleeps," waiting for the meter reader to approach.
The meter truck-mounted reading the device sends out a continuous "wake up" signal.
When an ERT receives the signal, it checks the reading on the meter register, encodes it into a
digital signal, and begins transmitting its identification number and the current reading
After a few minutes, the ERT stops transmitting and goes back "to sleep," waiting for the next
time meter reading.
The truck-mounted computer system matches the ERT identification number with the property
and records the reading. At the end of the day, the meter reader unloads the information to our
billing system.
AMR also need Meter Interface Unit (MIU).It responds to calls initiated through the software
installed on a PC. A simple three-wire hook-up from the encoded register provides input from
the meters to the MIU.
OPERATING PRINCIPLE:
To operate the AMR, Power Line Modem (PLM) is used, Technical Seminar
Presentation AMRITA PATTNAIK EE200199180 which transmits and receives data
over the power line.
The PLMs operate in a Half Duplex, two-way, Time Division Multiplex
communication mode.
Both the MIU and the DCU contain the PLM device.
33
The binary data stream is keyed onto a carrier signal by means of the Frequency Shift
Keying (FSK) technique.
The central frequency is shifted +0.3KHz to represent 1 or 0 of the binary data stream.
s then coupled onto the power line by the PLM.
At the receiving end, an identical PLM will detect the signal and convert it back to a
binary data stream.
The remote Automatic Meter Reading (AMR) System is a host driven, multi-level network
system consisting of a Host Central Station (HCS), Data Concentrator Units (DCU) and Meter
Interfacing Units (MIU), with built-in flexibility and expandability. Technical Seminar
Presentation AMRITA PATTNAIK EE200199180
34
figure a1.1:block dig of arm
A smart card is a special type of card like device which contains an integrated circuit chip
embedded on it. The IC chip can be a microprocessor with memory or just simple memory
circuit. In simple layman’s words, a smart card is the card with which we can exchange the
data, store it and manipulate data.
A smart card is connected to the host computer or controller via a card reader which gets
information from the smart card and accordingly passes the information to the host computer
or controller.
35
A smart card reader is a device to which the smart card is connected either directly or indirectly
using RF communication. It interfaces with the PC or a microcontroller using USB port or
RS232 serial ports. It can be a contact or contactless reader.
Readers come in many form factors and in a wide variety of capabilities. Contact smart
cards have a contact area, comprising several gold-plated contact pads, that is about 1 cm
square. When inserted into a reader, the chip makes contact with electrical connectors that can
read information from the chip and write information back. The cards do not contain batteries;
energy is supplied by the card reader.
Lab Equipment with Smartcard reader and serial communication with PICKit2 UART Tool.
The serial communication lines are connected to a diode gate to form a communication mixer.
With a push button you change between upload the code to PIC16F690 (lock) or to PIC16F84A
(keys).
Since Smartcard does not have its own clock pulse oscillator, clock pulses must be provided
from outside. This is best done with a external 4 MHz crystal oscillator chip.
A Smart Card has eight contact surfaces, but in practice the user only have access to one single
pin C7 (RB7). The other interfaces are used as supply voltage, ground, reset, and clock pulses.
36
Q3) Write a note on digital clock as an embedded system.
EMBEDDED SYSTEM:
DIGITAL CLOCK:
Digital clock displays the time using numbers. This circuit is used in many applications like
cars, railway stations, houses, offices, etc. in order to provide accurate time and date. In this
type of applications, normally we use RTC (Real Time Clock) ICs to display the time and date
accurately. This circuit displays the time on LCD. For this clock, we can set the time at any
instant. Here the clock works in 24 hour mode and the RTC chip is configured by programming
8051 controller
37
A digital clock keeps track of the time and uses RTC(real Time Clock).The time is displayed
on the LCD, which is connected to Port 2.The RTC used is DS12887 and the controller used is
89v51RD2.Three switches acts as a input for seconds, minutes and hours.
The above circuit is built on proteus and crystal frequency has been internally set. The
connection of the RTC DS12C887 with the microcontroller is shown in the circuit diagram.It
uses update interrupt to keep the track of the time. Every time the update interrupt comes, the
clock is incremented by one second. The output is displayed on the LCD. The clock uses
external interrupt 2 of the microcontroller AT89C51 for setting the time. A user can set time
by pressing the switch connected to pin 13 of the microcontroller, which is interrupt 2. The
hour and minutes can be set using pin 5 and pin 6 of the controller AT89C51 respectively.
Once the time is set, the user needs to press the start pin (pin 8 of controller) to start the clock
DS12887 RTC
The real-time clock (RTC) is a widely used device that provides accurate time and date for
many applications. It provides time components of hour, minute, and second, in addition to
the date/calendar components of year, month, and day. The RTC chip uses an internal battery,
which keeps the time and date even when the power is off. One of the most widely used RTC
chips is the DS 12887 from Dallas Semiconductor/Maxim Corp. The DS 12887 supports both
12-hour and 24-hour clock modes with AM and PM in the 12-hour mode. It also supports the
Daylight Savings Time option. The DS 12887 uses CMOS technology to keep the power
consumption low and it has the designation DS12C887, where C is for CMOS. The DS12887
38
has a total of 128 bytes of nonvolatile RAM. It uses 14 bytes of RAM for clock/calendar and
control registers, and the other 114 bytes of RAM are for general-purpose data storage.
Pins of DS12887
VCC
Pin 24 provides external supply voltage to the chip. The external voltage source is +5V.
When VC9 falls below the 3V level, the external source is switched off and the internal
lithium battery provides power to the RTC.
GND
Pin 12 is the ground.
ADO-AD7
The multiplexed address/data pins provide both addresses and data to the chip. Addresses are
latched into the DS 12887 on the falling edge of the AS (ALE) signal. ADO – AD7 of the DS
12887 are connected directly to the 8051 and there is no need for any 74xx373 latches, since
the DS 12887 provides the latch internally.
AS (ALE)
AS (address strobe) is an input pin. On the falling edge it will cause the addresses to be
latched into the DS 12887. The AS pin is used for demultiplexing the address and data and is
connected to the ALE pin of the 8051 chip.
MOT
This is an input pin that allows the choice between the Motorola and Intel microcontroller bus
timings. The MOT pin is connected to GND for the Intel timing. That means when we
connect DS 12887 the 8051, MOT = GND.
DS
Data strobe or read is an input. When MOT = GND for Intel timing, the DS pin is called the
RD (read) signal and is connected to the RD pin of the 8051.
R/W
39
Read/Write is an input pin. When MOT = GND for the Intel timing, the R/W pin is called the
WR (write) signal and is connected to the WR pin of the 8051.
CS
Chip select is an input pin and an active low signal. During the read (RD) and write (WR)
cycle time of Intel timing, the CS must be low in order to access the chip. It must be noted
that the CS works only when the external VCC is connected. In other words “when VCC falls
below 4.25V, the chip-select input is internally forced to an inactive level regardless of the
value of CS at the input pin.” This is called the write-protected state. When the DS 12887 is
in write-protected state, all inputs are ignored.
IRQ
Interrupt request is an output pin and active low signal. To use IRQ, the interrupt-enable bits
in register B must be set high.
SQW
Square wave is an output pin. We can program the DS 12887 to provide up to 15 different
square waves. The frequency of the square wave is set by programming register A RESET
Pin 18 is the reset pin. It is an input and is active low (normally high). In most applications
the reset pin is connected to the Vcc pin. In applications where this pin is used, it has no
effect on the clock, calendar, or RAM if it is forced low. The low on this pin will cause the
reset of the IRQ and clearing of the SQW pin.
The DS12887 has a total of 128 bytes of RAM space with addresses 00 -7FH. The first ten
locations, 00 – 09, are set aside for RTC values of time, calendar, and alarm data. The next
four bytes are used for the control and status registers. They are registers A, B, C, and D and
are located at addresses 10-13 (OA – OD in hex). Notice that their hex addresses match their
names.
The next 114 bytes from addresses OEH to 7FH are available for data storage. The entire 128
bytes of RAM are accessible directly for read or write except the following:
1) Registers C and D are read-only.
40
2) D7 bit of register A is read-only.
3) The high-order bit of the second byte is read-only.
ASSIGNMENT NO: 2
There is a variety of embedded tools available out there for development of hardware and
software for embedded systems. These embedded tools include editors, compilers, assemblers,
debuggers, and simulators etc. for software part and soldering iron, desoldering gun, Digital
Multimeter, oscilloscope, cutter, laptop etc. as hardware tools. All of the embedded tools are
necessary and work together. After a short review of software tools, I am going to write about
hardware tools which are the main focus of my article.
1) ARDUINO:
Introduction
Arduino is an open-source platform used for building electronics projects. Arduino
consists of both a physical programmable circuit board (often referred to as
a microcontroller) and a piece of software, or IDE (Integrated Development
Environment) that runs on your computer, used to write and upload computer code to
the physical board.
The Arduino platform has become quite popular with people just starting out with
electronics, and for good reason. Unlike most previous programmable circuit boards,
the Arduino does not need a separate piece of hardware (called a programmer) in order
to load new code onto the board – you can simply use a USB cable. Additionally, the
Arduino IDE uses a simplified version of C++, making it easier to learn to program.
41
Finally, Arduino provides a standard form factor that breaks out the functions of the
micro-controller into a more accessible package.
TYPES OF ARDUINO:
1) RASPBERRY PI:
42
Generally, the raspberry pi is designed for the educational purpose and it is in small size like
a credit card. It will improve the programming skills & hardware programming at the higher
education in the schools or colleges. The raspberry pi is slower than the laptop or desktop and
it is totally in the Linux operating system. The availability of price in the market is low.
Raspberry Pi 1 model B
It is a higher-spec variant of raspberry pi. After this design of this raspberry pi, it has
extended to the next model i.e raspberry pi 2. The specifications of the raspberry pi
model B are following, the raspberry pi model B has two USB ports, having a RAM
of 512MB and its Ethernet port is 100mb.
Raspberry Pi 1 model A
Raspberry Pi 1 model B+
This model B+ is replaced in the place of raspberry pi model B in the year 2014. Model B+
Rpi is compared with the model B it has more GPIO, more USB, more SD, lower power
consumption
Raspberry Pi 1model A+
Raspberry Pi Zero
It is a half size of the model A+ with twice a utility and for any project, it has the same
specification like 1GHz, Single-core CPU, 512MB RAM, Mini-HDMI port, Micro-
USB OTG port, Micro-USB power, HAT-compatible 40-pin header, Composite video
and reset headers, CSI camera connector (v1.3 only).
Raspberry Pi 2
The basic image of the raspberry pi 2 is following and the features of the raspberry pi
2 are it has quad-core ARM cortex-A7 processor with a 900MHz, the SDRAM is about
the 1GB. It is completely compatible with the raspberry pi 1.
Raspberry Pi 3 model B
43
Raspberry Pi Zero W
Applications of Raspberry Pi
Media steamer
Tablet computer
Home automation
Internet radio
Controlling robots
Cosmic Computer
Arcade machines
Raspberry pi based projects
2) ARM CORTEX
The ARM stands for Advanced RISC machine and it is a 32-bit reduced instructions set
computer (RISC) microcontroller. It was first introduced by the Acron computers’
organization in 1987. The ARM is a family of the microcontroller developed by the different
manufacturers such as ST microelectronics, Motorola and so on. The ARM microcontroller
architecture come with a few different versions such as ARMv1, ARMv2 etc. and each one has
its own advantage and disadvantages.
44
The ARM cortex microcontroller is an advanced microcontroller in the ARM family, which is
developed by the ARMv7 architecture. The ARM cortex family divided into three sub-families
such as;
ARM-Cortex Ax-series
The ARM Cortex-A is a group of 32-bit and 64-bit RISC ARM processor cores
licensed by Arm Holdings. The cores are intended for application use. The group
consists of 32-bit cores: ARM Cortex-A5, ARM Cortex-A7, ARM Cortex-A8, ARM
Cortex-A9, ARM Cortex-A12, ARM Cortex-A15, ARM Cortex-A17
MPCore, and ARM Cortex-A32, and 64-bit cores: ARM Cortex-A35, ARM Cortex-
A53, ARM Cortex-A55, ARM Cortex-A57, ARM Cortex-A72, ARM Cortex-
A73, ARM Cortex-A75, and ARM Cortex-A76.
ARM-Cortex Rx-series
The ARM Cortex-R is a family of 32-bit RISC ARM processor cores licensed by Arm
Holdings. The cores are optimized for hard real-time and safety-critical applications.
Cores in this family implement the ARM Real-time (R) profile, which is one of three
architecture profiles, the other two being the Application (A) profile implemented by
the Cortex-A family and the Microcontroller (M) profile implemented by the Cortex-
M family. The ARM Cortex-R family of microprocessors currently consists of ARM
Cortex-R4 (F), ARM Cortex-R5(F), ARM Cortex-R7(F), ARM Cortex-R8(F), and
ARM Cortex-R52(F).
ARM-Cortex Mx-series
The ARM Cortex-M is a group of 32-bit RISC ARM processor cores licensed by Arm
Holdings. They are intended for microcontroller use, and have been shipped in tens of
billions of devices. The cores consist of the Cortex-M0, Cortex-M0+, Cortex-M1,
Cortex-M3, Cortex-M4, Cortex-M7, Cortex-M23, Cortex-M33, Cortex-M35P. The
Cortex-M4 / M7 / M33 / M35P cores have an FPU silicon option, and when included
in the silicon these cores are known as "Cortex-Mx with FPU" or "Cortex-MxF", where
'x' is the core number.
45
4) INTEL GALILEO
46
Galileo is designed to support shields that operate at either 3.3V or 5V. The core
operating voltage of Galileo is 3.3V. However, a jumper on the board enables
voltage translation to 5V at the I/O pins. This provides support for 5V Uno
shields and is the default behavior. By switching the jumper position, the
voltage translation can be disabled to provide 3.3V operation at the I/O pins.
Of course, the Galileo board is also software compatible with the Arduino
Software Development Environment (IDE), which makes usability and
introduction a snap. In addition to Arduino hardware and software
compatibility, the Galileo board has several PC industry standard I/O ports and
features to expand native usage and capabilities beyond the Arduino shield
ecosystem. A full sized mini-PCI Express slot, 100Mb Ethernet port, Micro-SD
slot, RS-232 serial port, USB Host port, USB Client port, and 8MByte NOR
flash come standard on the board.
We live in a World of Sensors. You can find different types of Sensors in our
homes, offices, cars etc. working to make our lives easier by turning on the
lights by detecting our presence, adjusting the room temperature, detect smoke
or fire, make us delicious coffee, open garage doors as soon as our car is near
the door and many other tasks
The following is a list of different types of sensors that are commonly used in various
applications. All these sensors are used for measuring one of the physical properties like
Temperature, Resistance, Capacitance, Conduction, Heat Transfer etc.
Temperature Sensor
47
One of the most common and most popular sensor is the Temperature Sensor. A
Temperature Sensor, as the name suggests, senses the temperature i.e. it measures the
changes in the temperature.
Proximity Sensor
A Proximity Sensor is a non-contact type sensor that detects the presence of an object.
Proximity Sensors can be implemented using different techniques like Optical (like
Infrared or Laser), Ultrasonic, Hall Effect, Capacitive, etc.
48
IR Sensors or Infrared Sensor are light based sensor that are used in various applications
like Proximity and Object Detection. IR Sensors are used as proximity sensors in almost
all mobile phones.
Pressure Sensor
Light Sensor
Light Sensors are photoelectric devices that convert light energy (photons) whether
visible or infra-red light into an electrical (electrons) signal
A Light Sensor generates an output signal indicating the intensity of light by measuring
the radiant energy that exists in a very narrow range of frequencies basically called
“light”, and which ranges in frequency from “Infra-red” to “Visible” up to “Ultraviolet”
light spectrum.
Ultrasonic Sensor
49
figure A2.6: ultrasonic sensor
An Ultrasonic Sensor is a non-contact type device that can be used to measure distance
as well as velocity of an object. An Ultrasonic Sensor works based on the properties of
the sound waves with frequency greater than that of the human audible range.
Color Sensor
Color sensors detect the color of a surface. The sensors cast light (red, green, and blue LEDs)
on the objects to be tested, calculate the chromaticity coordinates from the reflected radiation
and compare them with previously stored reference colors. If the color values are within the
set tolerance range, a switching output is activated.
Humidity Sensor
50
figure A2.8 humidity sensor
A humidity sensor (or hygrometer) senses, measures and reports both moisture and air
temperature. The ratio of moisture in the air to the highest amount of moisture at a
particular air temperature is called relative humidity. Relative humidity becomes an
important factor, when looking for comfort.
51