0% found this document useful (0 votes)
236 views80 pages

Project Report Final

This document describes the development of a data acquisition robot called Kroto Finder for detecting cracks and conditions inside oil pipes. It consists of sensors like a camera, temperature sensor and pressure sensor that detect cracks and transmit the data wirelessly via WiFi. Chapter 1 introduces the objectives and problem formulation. Chapter 2 discusses related literature on pipe inspection robots and modular robots. Chapter 3 presents the block diagram of the robot which includes sensors, a wireless camera, motor driver and microcontroller to process and transmit the sensor data.

Uploaded by

Shyam Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
236 views80 pages

Project Report Final

This document describes the development of a data acquisition robot called Kroto Finder for detecting cracks and conditions inside oil pipes. It consists of sensors like a camera, temperature sensor and pressure sensor that detect cracks and transmit the data wirelessly via WiFi. Chapter 1 introduces the objectives and problem formulation. Chapter 2 discusses related literature on pipe inspection robots and modular robots. Chapter 3 presents the block diagram of the robot which includes sensors, a wireless camera, motor driver and microcontroller to process and transmit the sensor data.

Uploaded by

Shyam Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Chapter 1
Introduction
This project is mainly implemented for industrial applications. Mainly for detecting
the damages inside the oil pipe that cannot be detected by human beings. Kroto is the Greek
word meaning to crack. Inside the pipe, there is very heavy temperature, pressure and toxic
gases. So we are implementing a robot that have a camera, temperature sensor, pressure
sensor etc which is used to detect the crack and conditions inside the pipe. This data from
all the high precision sensors will be transmitted using Wi-Fi protocol from the robot to the
control station. The robot incorporates a wireless camera and the data from the camera is
transmitted to the PC
There are a multitude of standards like WiFi that address mid to high data rates for
voice, PC LANs, video, etc. However, up till now there hasn't been a wireless network
standard that meets the unique needs of sensors and control devices. Sensors and controls
don't need high bandwidth but they do need low latency and very low energy consumption
for long battery lives and for large device arrays.
The Wifi Alliance is not pushing a technology; rather it is providing a standardized
base set of solutions for sensor and control systems...Wireless connectivity of a vast number
of industrial and home applications has modest transmission data requirements, but
demands reliable and secure communication using simple low-cost and low-power radio
systems. In the quest for high-bandwidth, multimedia-capable wireless networks, the need
for cost and power-effective radio solutions for this vast number of fairly simple
applications was only recently addressed by a standardized technology.
The IEEE 802.15.4 standard and Wifi wireless technology are designed to satisfy
the market's need for a low-cost, standard-based and flexible wireless network technology,
which offers low power consumption, reliability, interoperability and security for control
and monitoring applications with low to moderate data rates.
1.1 Objective Of The Project
To design and analyse a robot for detecting the damages inside the oil pipe that can
not be detected by human beings. Inside the pipe, there is very heavy temperature, pressure
and toxic gases. So we are implementing a robot that have a camera, temperature sensor,
pressure sensor etc. which is used to detect the crack and conditions inside the pipe.

8TH SEM |B.E | DEPT OF ECE | AIT-B 1


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

1.2 Problem Formulation


In certain industries, there is a mandatory requirement to maintain crack free pipes
to avoid leakages. The workers use to dismantle the pipes and it becomes mandatory for
them to dig the ground if necessary to check the crack. In few chemical industries we have
to maintain constant temperature, pressure. People were using some risky operations to
keep the system constant.
To overcome the above situations, we are implementing a robot that have a camera,
temperature sensor, pressure sensor etc which is used to detect the crack and conditions
inside the pipe.

8TH SEM |B.E | DEPT OF ECE | AIT-B 2


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Chapter 2
Literature Survey
There are many robots for pipe inspection, but generally they are conceived for
pipes of industrial applications, which have a diameter bigger than 80cm, like gas pipelines
or hydroelectric power stations. In this article we propose a small robot to explore pipes
with a camera to detect breakages, holes, leaks and any kind of defects in pipes of less than
30mm diameter. Due to the great variety of pipes that can be found, it is very useful to
reconfigure the micro robot depending on the task being performed. Multi configurable
systems are systems capable of having their modules rearranged. This characteristic makes
multi configurable robotic systems capable of performing much more types of tasks than
conventional systems (non-configurable). These systems can be classified according to the
configuration type into manual or automatic, depending on the different number of modules
they have into homogenous(only one type of module) and heterogeneous (several
types),and according to the configuration, into mobile, lattice or chain. The robotic system
described in this paper is manually reconfigurable, heterogeneous and has a chain
configuration.
One of the most important issues in modular robotics is the control of the modules.
In the robotic system described in this paper a centralized control has been chosen. There
is one master module that controls the other modules, but for some actions all modules have
to cooperate and take decisions at the same time. In the development of the modules three
lines of investigation have been taken: worm-like micro robots, SMA based micro robots
and planar micro motor drive module.
Regarding the purpose for which this system was design, low diameter pipe
inspection, the size of every module is minimized as much as possible, achieving a final
diameter for each module of less than 26mm. This miniaturization adds agreat complexity
to the design of the modules, because of the limitation in components, electronics and
fabrication techniques. Two fabrication techniques used in these prototypes are stereo
lithography and micromachining.
Most pipelines operate for many years without much attention to mechanical
changes in the pipe. Some of these pipes are left partially full for some period and this can
lead to corrosion as some of these products that are being transported are corrosive in
nature. The design and construction of the pipeline could lead to leakages at some poor
construction joints. Likewise, the operation design guidelines need to be studied. There are
times where the pipes are designed for a certain maximum temperature and pressure and
usage under a higher degree can lead to the pipeline failure. Intentional damage
unfortunately seems to be on the high side than the unintentional or accidental damage.
This is more common with pipelines transporting high-value products and is usually highly
flammable and this has led to loss of lives and properties in so many regions. Therefore,
the oil and gas industries and other fluid transport based industries tend to pay attention to
leakage detection as failure to detect can lead to loss of life and property, direct cost of loss
of products and lie down time leading to direct financial loss to the industry, environmental
pollution and this will necessitate the need for environmental clean-up thereby incurring
more production/management cost.

8TH SEM |B.E | DEPT OF ECE | AIT-B 3


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Chapter 3
Block Diagram

Fig 1 : Block Diagram

8TH SEM |B.E | DEPT OF ECE | AIT-B 4


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

3.2.2 Temperature Sensor

Temperature is a Physical parameter which is converted into Electrical parameter


by device called Temperature Transducer. Transducer is also referred to as SENSOR. The
most common transducer produces an output voltage, current, capacitance and resistance.
However we need to convert these signals to voltage in order to send input to an A- D
converter. This conversion (modification) is commonly called signal conditioning. Signal
conditioning can be a current to voltage conversion or signal amplification. For example,
the thermistor changes resistance with temperature. The change of resistance must be
translated into voltages in order to be of any use to an ADC.

3.2.3 Pressure Sensor


A pressure sensor measures pressure, typically of gases or liquids. Pressure is an
expression of the force required to stop a fluid from expanding, and is usually stated in
terms of force per unit area. A pressure sensor usually acts as a transducer, it generates a
signal as a functionof the pressure imposed. For the purposes of this article, such a signal
is electrical.Pressure sensors can also be used to indirectly measure other variables such as
fluid/gas flow, speed, water level, and altitude.
3.2.5 Wireless camera
Wireless cameras are basically described as a wireless transmitter carrying a camera
signal. The Camera is wired to a wireless transmitter and the signal travels between the
camera and the receiver. Wireless cameras have a channel also. The receiver has channels
to tune in and then you get the picture. The wireless camera picture is sent by the transmitter
the receiver collects this signal and outputs it to your Computer OR TV Monitor depending
on the receiver type.
3.2.6 Motor Driver

The Device is a monolithic integrated high voltage,high current four channel driver
designed toaccept standard DTL or TTL logic levels and drive inductive loads (such as
relays solenoides, DC and stepping motors) and switching power transistors. To simplify
use as two bridges each pair of channelsis equipped with an enable input. A separate supply
input is provided for the logic, allowing operation at a lower voltage and internal clamp
diodes are included.This device is suitable for use in switching applicationsat frequencies
up to 5 kHz.

3.2.7 DC Motor
A DC motor is a mechanically commutated electric motor powered from direct
current (DC). The stator is stationary in space by definition and therefore so is its current.
The current in the rotor is switched by the commutator to also be stationary in space. This

8TH SEM |B.E | DEPT OF ECE | AIT-B 5


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

is how the relative angle between the stator and rotor magnetic flux is maintained near 90
degrees, which generates the maximum torque.

8TH SEM |B.E | DEPT OF ECE | AIT-B 6


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Chapter 4
Hardware Required

➢ Microcontroller
➢ Gas Sensor
➢ Temperature sensor
➢ Relay circuit
➢ DC motors
➢ Motor Driver
➢ Pressure sensor
➢ Wireless camera

8TH SEM |B.E | DEPT OF ECE | AIT-B 7


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.1 The Node MCU


4.1.1 Introduction
The Node MCU (Node Microcontroller Unit) is an open source software and
hardware development environment that is built around a very inexpensive System-on-a-
Chip (SoC) called the ESP8266. The ESP8266, designed and manufactured by Espressif
Systems, contains all crucial elements of the modern computer: CPU, RAM, networking
(Wi-Fi), and even a modern operating system and SDK. That makes it an excellent choice
for IoT projects of all kinds.

NodeMCU is an open source IoT platform. It includes firmware which runs on the
ESP8266 Wi-Fi SoC from Espressif , and hardware which is based on the ESP-12 module.
The term "NodeMCU" by default refers to the firmware rather than the development kits.

NodeMCU was created shortly after the ESP8266 came out. On December 30,
2013, Espressif Systems began production of the ESP8266. The ESP8266 is a Wi-Fi Socket
integrated with a Tensilica Xtensa LX106 core, widely used in IoT applications. NodeMCU
started on 13 Oct 2014, when Hong committed the first file of nodemcu-firmware to
GitHub. Two months later, the project expanded to include an open-hardware platform
when developer Huang R committed the gerber file of an ESP8266 board, named devkit
v0.9. Another important update was made on 30 Jan 2015, when Devsaurus ported to
NodeMCU project, enabling NodeMCU to easily drive LCD, Screen, OLED, even VGA
displays.

In summer 2015 the creators abandoned the firmware project and a group of
independent but dedicated contributors took over. By summer 2016 the NodeMCU
included more than 40 different modules. Due to resource constraints users need to select
the modules relevant for their project and build a firmware tailored to their needs.

However, as a chip, the ESP8266 is also hard to access and use. You have to solder
wires, with the appropriate analog voltage, to its PINs for the simplest tasks such as
powering it on or sending a keystroke to the "computer" on the chip. And, you have to
program it in low-level machine instructions that can be interpreted by the chip hardware.
While this level of integration is not a problem when the ESP8266 is used as an embedded

8TH SEM |B.E | DEPT OF ECE | AIT-B 8


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

controller chip in mass-produced electronics, it is a huge burden for hobbyists, hackers, or


students who want to experiment with it in their own IoT projects.

Borrowing a page from the successful playbooks of Arduino or a Raspberry Pi, the
Node MCU project aims to simplify ESP8266 development. It has two key components.

• An open source ESP8266 firmware that is built on top of the chip manufacturer's
proprietary SDK. The firmware provides a simple programming environment based
on eLua (embedded Lua), which is a very simple and fast scripting language with
an established developer community. For new comers, the Lua scripting language
is easy to learn.

• A DEVKIT board that incorporates the ESP8266 chip on a standard circuit board.
The board has a built-in USB port that is already wired up with the chip, a hardware
reset button, Wi-Fi antenna, LED lights, and standard-sized GPIO (General Purpose
Input Output) pins that can plug into a bread board. Figure 1 shows the DEVKIT
board, and Figure 2 shows the schema of its pins.

Fig 2. The Node MCU DEVKIT board

8TH SEM |B.E | DEPT OF ECE | AIT-B 9


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.1.2 Why Node MCU?

Development boards, such as Arduino and Raspberry Pi, are common choices when
prototyping new IoT devices. Those development boards are essentially mini-computers
that can connect to and be programmed by a standard PC or Mac. After it has been
programmed, the development boards can then connect to and control sensors in the field.

Because the "I" in IoT stands for internet, the development boards need a way to
connect to the internet. In the field, the best way to connect to the internet is by using
wireless networks. However, Arduino and Raspberry Pi do not have built-in support for
wireless networks. Developers will have to add a Wi-Fi or cellular module to the board and
write code to access the wireless module.

One of its most unique features of NodeMCU is that it has built-in support for wifi
connectivity, and hence makes IoT application development much easier.

Some of the features include:

➢ 10 digit Analog-Digital converter


➢ Uses IPV4, HTTP, FTP, UDP & TCP network protocols
➢ Operating voltages: 3-3.6V
➢ Operating Frequency range: 2.4-2.6 GHz
➢ On board power management modules, PLL, regulator, Power amplifier, Noise
filters which makes it less external circuitry interface.
➢ Configured in both Android & iOS devices
➢ Programmable WiFi module.
➢ Arduino-like (software defined) hardware IO.
➢ Can be programmed with the simple and powerful Lua programming language
or Arduino IDE.
➢ USB-TTL included, plug & play.
➢ 10 GPIOs D0-D10, PWM functionality, IIC and SPI communication, 1-Wire
and ADC A0 etc. all in one board.
➢ Wifi networking (can be used as access point and/or station, host a web server),
connect to internet to fetch or upload data.

8TH SEM |B.E | DEPT OF ECE | AIT-B 10


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

➢ Event-driven API for network applications.


➢ PCB antenna.

Applications:

• Home Automation
• Home Appliances i.e TV, Refrigerators, Light Bulbs, Fans etc. Control
• Motor Speed control
• Can be used in IP Cameras , Sensor Networks, Wearable electronics
• Security ID tags & Baby Monitors
• Wi-Fi location aware devices and Wi-Fi position systems etc.

4.1.3 Pin Configuration

General-purpose input/output (GPIO) is a pin on an IC (Integrated Circuit). It can


be either input pin or output pin, whose behaviour can be controlled at the run time.

Fig 3. Node MCU DevKit GPIOs

8TH SEM |B.E | DEPT OF ECE | AIT-B 11


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Node MCU Development kit provides access to these GPIOs of ESP8266. The only
thing to take care is that Node MCU Dev kit pins are numbered differently than internal
GPIO notations of ESP8266 as shown in below figure and table. For example, the D0 pin
on the Node MCU Dev kit is mapped to the internal GPIO pin 16 of ESP8266.

Below table gives Node MCU Dev Kit IO pins and ESP8266 internal GPIO pins
mapping.

Table 1 - Node MCU Dev Kit IO pins and ESP8266 internal GPIO pins mapping

Pin Names on Node MCU Development Kit ESP8266 Internal GPIO Pin number
D0 GPIO16
D1 GPIO5
D2 GPIO4
D3 GPIO0
D4 GPIO2
D5 GPIO14
D6 GPIO12
D7 GPIO13
D8 GPIO15
D9/RX GPIO3
D10/TX GPIO1
D11/SD2 GPIO9
D12/SD3 GPIO10

The GPIO’s shown in table (1, 3, 9, 10) are mostly not used for GPIO purpose on
Dev Kit

ESP8266 is a system on a chip (SoC) design with components like the processor
chip. The processor has around 16 GPIO lines, some of which are used internally to
interface with other components of the SoC, like flash memory.

Since several lines are used internally within the ESP8266 SoC, we have about 11
GPIO pins remaining for GPIO purpose.

8TH SEM |B.E | DEPT OF ECE | AIT-B 12


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Now again 2 pins out of 11 are generally reserved for RX and TX in order to
communicate with a host PC from which compiled object code is downloaded. Hence
finally, this leaves just 9 general purpose I/O pins i.e. D0 to D8.

As shown in above figure of NodeMCU Dev Kit. We can see RX, TX, SD2, SD3
pins are not mostly used as GPIOs since they are used for other internal process. But we
can try with SD3 (D12) pin which mostly like to respond for GPIO/PWM/interrupt like
functions.

Note that D0/GPIO16 pin can be only used as GPIO read/write, no special functions
are supported on it.

Fig 4- The Node MCU Pin Configuration

8TH SEM |B.E | DEPT OF ECE | AIT-B 13


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.1.4 Pin Definition

Table 2 - Pin Definition

Name Type Function

VCC P Power 3.0 ~ 3.6V

GND P Ground

RESET I External reset signal (Low voltage level: Active)

ADC(TOUT) I ADC Pin Analog Input 0 ~ 1V

Chip Enable. High: On, chip works properly; Low: Off,


CH_PD I
small current

General purpose IO, If low while reset/power on takes


GPIO0(FLASH) I/O
chip into serial programming mode

GPIO1(TX) I/O General purpose IO and Serial TXd

GPIO3(RX) I/O General purpose IO and Serial RXd

GPIO4 I/O General purpose IO

GPIO5 I/O General purpose IO

GPIO12 I/O General purpose IO

GPIO13 I/O General purpose IO

GPIO14 I/O General purpose IO

General purpose IO, Connect this pin to ground through


GPIO15(HSPI_CS) I/O
1KOhm resistor to boot from internal flash.

8TH SEM |B.E | DEPT OF ECE | AIT-B 14


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 5 - The Node MCU pin schematic

4.1.5 Electrical Characteristics

➢ Working Voltage: 3.3V


➢ Maximum IO Driving Power IMAX: 12 mA
➢ Maximum IO Voltage Level VMAX: 3.6V
➢ Current Consumption: 100mAmp

8TH SEM |B.E | DEPT OF ECE | AIT-B 15


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.2 Gas Sensor ( MQ5 )

In current technology scenario, monitoring of gases produced is very important.


From home appliances such as air conditioners to electric chimneys and safety systems at
industries monitoring of gases is very crucial. Gas sensors are very important part of such
systems. Small like a nose, gas sensors spontaneously react to the gas present, thus keeping
the system updated about any alterations that occur in the concentration of molecules at
gaseous state.

Gas sensors are available in wide specifications depending on the sensitivity levels,
type of gas to be sensed, physical dimensions and numerous other factors.

The Grove - Gas Sensor (MQ5) module is useful for gas leakage detection (in home
and industry). It is suitable for detecting H2, LPG, CH4, CO, Alcohol ranging frpm 100ppm
to 3000ppm. Due to its high sensitivity and fast response time, measurements can be taken
as soon as possible. The sensitivity of the sensor can be adjusted by using the potentiometer.

Fig- Gas sensor MQ5

Pin Connection

➢ VCC ↔ 2.5V ~ 5.0V


➢ GND ↔ Power supply ground
➢ AOUT ↔ Analog output
➢ DOUT ↔ Digital output

8TH SEM |B.E | DEPT OF ECE | AIT-B 16


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Specifications

➢ Supply Voltage: 5V
➢ Detecting concentration :200-10000ppm LPG,LNG,Natural gas,Iso-butane
➢ Analog and Digital Output
➢ Digital Out is High or Low based on a adjustable preset threshold.

Features

➢ Wide detecting scope


➢ Stable and long life
➢ Fast response and High sensitivity
➢ High sensitivity to LPG, natural gas , town gas
➢ Small sensitivity to alcohol, smoke.
➢ Simple drive circuit

4.2.1 Working Principle of Gas Sensor

When a gas interacts with this sensor, it is first ionized into its constituents and is
then adsorbed by the sensing element. This adsorption creates a potential difference on the
element which is conveyed to the processor unit through output pins in form of current.
The gas sensor module consists of a steel exoskeleton under which a sensing element is
housed. This sensing element is subjected to current through connecting leads. This current
is known as heating current through it, the gases coming close to the sensing element get
ionized and are absorbed by the sensing element. This changes the resistance of the sensing
element which alters the value of the current going out of it.

8TH SEM |B.E | DEPT OF ECE | AIT-B 17


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig- MQ5 Sensor

When a gas interacts with this sensor, it is first ionized into its constituents and is
then adsorbed by the sensing element. This adsorption creates a potential difference on the
element which is conveyed to the processor unit through output pins in form of current.

The gas sensor module consists of a steel exoskeleton under which a sensing
element is housed. This sensing element is subjected to current through connecting leads.
This current is known as heating current through it, the gases coming close to the sensing
element get ionized and are absorbed by the sensing element. This changes the resistance
of the sensing element which alters the value of the current going out of it.

The externals of a standard gas sensor module contains:

➢ A steel mesh
➢ Copper clamping ring
➢ Connecting leads.

8TH SEM |B.E | DEPT OF ECE | AIT-B 18


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig- Stainless steel mesh

The top part is a stainless steel mesh which takes care of the following:

1. Filtering out the suspended particles so that only gaseous elements are able to pass to
insides of the sensor.
2. Protecting the insides of the sensor.
3. Exhibits an anti-explosion network that keeps the sensor module intact at high
temperatures and gas pressures.

Fig- Internal parts of gas sensor

8TH SEM |B.E | DEPT OF ECE | AIT-B 19


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

The connecting leads of the sensor are thick so that sensor can be connected firmly
to the circuit and sufficient amount of heat gets conducted to the inside part. They are casted
from copper and have tin plating over them. Four of the six leads (A, B, C, D) are for signal
fetching while two (1, 2) are used to provide sufficient heat to the sensing element.

The pins are placed on a Bakelite base which is a good insulator and provides firm
gripping to the connecting leads of the sensor.

4.2.2 Types of gas sensors

Part Number Sensitive Gas Application

MQ-135 Gas Sensor benzene, alcohol, smoke Air quality monitor


MQ-2 Gas Sensor LPG, propane, hydrogen Gas leakage detector
MQ-3 Gas Sensor alcohol, ethanol Car alcohol alarm, breathalyser
MQ-5 Gas Sensor LPG, natural gas, coal gas Gas leakage detector
MQ-7 Gas Sensor carbon monoxide Carbon monoxide monitor

8TH SEM |B.E | DEPT OF ECE | AIT-B 20


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.3 Temperature and Humidity Sensor ( DHT11 )


DHT11 electronic brick of digital temperature & humidity sensor features a digital
temperature & humidity sensor complex with a calibrated digital signal output. Its single-
bus operation, extremely small size and low consumption enable it to be used in HVAC,
automotive, weather stations, dehumidifier and other applications.

This DHT11 Temperature and Humidity Sensor features a calibrated digital signal
output with the temperature and humidity sensor capability. It is integrated with a high-
performance 8-bit microcontroller. Its technology ensures the high reliability and excellent
long-term stability. This sensor includes a resistive element and a sensor for wet NTC
temperature measuring devices. It has excellent quality, fast response, anti-interference
ability and high performance.

Each DHT11 sensors features extremely accurate calibration of humidity


calibration chamber. The calibration coefficients stored in the OTP program memory,
internal sensors detect signals in the process, and we should call these calibration
coefficients. The single-wire serial interface system is integrated to become quick and easy.
Small size, low power, signal transmission distance up to 20 meters, enabling a variety of
applications and even the most demanding ones. The product is 4-pin single row pin
package. Convenient connection, special packages can be provided according to users need.

Specifications

➢ Operating Voltage: 3.5V to 5.5V


➢ Operating current: 0.3mA (measuring) 60uA (standby)
➢ Output: Serial data
➢ Temperature Range: 0°C to 50°C
➢ Humidity Range: 20% to 90%
➢ Resolution: Temperature and Humidity both are 16-bit
➢ Accuracy: ±1°C and ±1%

8TH SEM |B.E | DEPT OF ECE | AIT-B 21


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig- DHT11 Sensor

4.3.1 Where to use DHT11:

The DHT11 is a commonly used Temperature and humidity sensor. The sensor
comes with a dedicated NTC to measure temperature and an 8-bit microcontroller to output
the values of temperature and humidity as serial data. The sensor is also factory calibrated
and hence easy to interface with other microcontrollers.

The sensor can measure temperature from 0°C to 50°C and humidity from 20% to
90% with an accuracy of ±1°C and ±1%. So if you are looking to measure in this range
then this sensor might be the right choice for you.

The DHT11 Sensor is factory calibrated and outputs serial data and hence it is
highly easy to set it up. The connection diagram for this sensor is shown below.

8TH SEM |B.E | DEPT OF ECE | AIT-B 22


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig- Connection of DHT11

As you can see the data pin is connected to an I/O pin of the MCU and a 5K pull-
up resistor is used. This data pin outputs the value of both temperature and humidity as
serial data.

Features
• Low cost
• Long-term stability
• Relative humidity and temperature measurement
• Excellent quality
• Fast response
• Strong anti-interference ability
• Long distance signal transmission
• Digital signal output and precise calibration.

8TH SEM |B.E | DEPT OF ECE | AIT-B 23


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.3.2 Electrical Characteristics


Table 3- Electrical Characteristics

Parameter Min. Typical Max. Unit

Working voltage 3 5 5.5 VDC

Working current(VCC=5V,T=25℃) 0.5 - 2.5 mA

Sampling interval 1 - - s

Humidity

Parameter Min. Typical Max. Unit

Accuracy (25℃) - ±4 - %RH

Accuracy (0-50℃) - - ±5 %RH

Measurement range (25℃) 20 - 95 %RH

Response time: 1/e(63%)25℃,1m/s air 6 10 15 s

Temperature

Parameter Min. Typical Max. Unit

Accuracy ±1 - ±2 ℃

Measurement range 0 - 50 ℃

Response time /e(63%) 6 30 s

8TH SEM |B.E | DEPT OF ECE | AIT-B 24


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.3.3 Pin Configuration

Fig 6 - Pin Configuration

Table 4- Pin Identification

1 Vcc- Power supply 3.5V to 5.5V

Outputs both Temperature and Humidity through serial


2 Data
Data

3 NC No Connection and hence not used

4 Ground Connected to the ground of the circuit

➢ Measure temperature and humidity


➢ Local Weather station
➢ Automatic climate control
➢ Environment monitoring
➢ Applications
➢ HVAC, dehumidifier, testing and inspection equipment, consumer goods,
automotive, automatic
➢ Control, data loggers, weather stations, home appliances, humidity regulator,
medical and other humidity
➢ Measurement and control.

8TH SEM |B.E | DEPT OF ECE | AIT-B 25


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.3.4 Working Principle

Fig 7- Internal Structure of DHT11

Ok now let’s see how these sensors actually work. They consist of a humidity
sensing component, a NTC temperature sensor (or thermistor) and an IC on the back side
of the sensor.

Fig 8- Layers of DHT11

For measuring humidity they use the humidity sensing component which has two
electrodes with moisture holding substrate between them. So as the humidity changes, the
conductivity of the substrate changes or the resistance between these electrodes changes.
This change in resistance is measured and processed by the IC which makes it ready to be
read by a microcontroller.

8TH SEM |B.E | DEPT OF ECE | AIT-B 26


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 9- Working of DHT11

A thermistor is actually a variable resistor that changes its resistance with change
of the temperature. These sensors are made by sintering of semiconductive materials such
as ceramics or polymers in order to provide larger changes in the resistance with just small
changes in temperature. The term “NTC” means “Negative Temperature Coefficient”,
which means that the resistance decreases with increase of the temperature.

8TH SEM |B.E | DEPT OF ECE | AIT-B 27


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.4 Relay Driver Circuit


Relays are switches that open and close circuits electromechanically or
electronically. Relays control one electrical circuit by opening and closing contacts in
another circuit. As relay diagrams show, when a relay contact is normally open (NO), there
is an open contact when the relay is not energized.

A Relay driver IC is an electro-magnetic switch that will be used whenever we want


to use a low voltage circuit to switch a light bulb ON and OFF which is connected to 220V
mains supply. The required current to run the relay coil is more than can be supplied by
various integrated circuits like Op-Amp, etc.Relays have unique properties and are replaced
with solid state switches that are strong than solid-state devices. High current capacities,
capability to stand ESD and drive circuit isolation are the unique properties of Relays.
There are various ways to drive relays.

Fig 10- Relay circuit

8TH SEM |B.E | DEPT OF ECE | AIT-B 28


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.5 The DC Motor:

The DC Motor or Direct Current Motor to give it its full title, is the most commonly used
actuator for producing continuous movement and whose speed of rotation can easily be
controlled, making them ideal for use in applications were speed control, servo type control,
and/or positioning is required. A DC motor consists of two parts, a "Stator" which is the
stationary part and a "Rotor" which is the rotating part. The result is that there are basically
three types of DC Motor available.

• Brushed Motor- This type of motor produces a magnetic field in a wound rotor
(the part that rotates) by passing an electrical current through a commutator and
carbon brush assembly, hence the term "Brushed". The stators (the stationary part)
magnetic field is produced by using either a wound stator field winding or by
permanent magnets. Generally brushed DC motors are cheap, small and easily
controlled.
• Brushless Motor - This type of motor produce a magnetic field in the rotor by using
permanent magnets attached to it and commutation is achieved electronically. They
are generally smaller but more expensive than conventional brushed type DC
motors because they use "Hall effect" switches in the stator to produce the required
stator field rotational sequence but they have better torque/speed characteristics, are
more efficient and have a longer operating life than equivalent brushed types.
• Servo Motor - This type of motor is basically a brushed DC motor with some form
of positional feedback control connected to the rotor shaft. They are connected to
and controlled by a PWM type controller and are mainly used in positional control
systems and radio controlled models.

Normal DC motors have almost linear characteristics with their speed of rotation being
determined by the applied DC voltage and their output torque being determined by the
current flowing through the motor windings. The speed of rotation of any DC motor can be
varied from a few revolutions per minute (rpm) to many thousands of revolutions per
minute making them suitable for electronic, automotive or robotic applications. By
connecting them to gearboxes or gear-trains their output speed can be decreased while at
the same time increasing the torque output of the motor at a high speed.

8TH SEM |B.E | DEPT OF ECE | AIT-B 29


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.5.1 The Brushed DC Motor

A conventional brushed DC Motor consist basically of two parts, the stationary body of the
motor called the Stator and the inner part which rotates producing the movement called
the Rotor or "Armature" for DC machines.

The motors wound stator is an electromagnet circuit which consists of electrical coils
connected together in a circular configuration to produce the required North-pole then a
South-pole then a North-pole etc, type stationary magnetic field system for rotation, unlike
AC machines whose stator field continually rotates with the applied frequency. The current
which flows within these field coils is known as the motor field current.

These electromagnetic coils which form the stator field can be electrically connected in
series, parallel or both together (compound) with the motors armature. A series wound DC
motor has its stator field windings connected in series with the armature. Likewise, a shunt
wound DC motor has its stator field windings connected in parallel with the armature as
shown.

Fig 11- Series and Shunt Connected DC Motor

The rotor or armature of a DC machine consists of current carrying conductors connected


together at one end to electrically isolated copper segments called the commutator. The
commutator allows an electrical connection to be made via carbon brushes (hence the name
"Brushed" motor) to an external power supply as the armature rotates.

The magnetic field setup by the rotor tries to align itself with the stationary stator field
causing the rotor to rotate on its axis, but cannot align itself due to commutation delays.
The rotational speed of the motor is dependent on the strength of the rotors magnetic field

8TH SEM |B.E | DEPT OF ECE | AIT-B 30


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

and the more voltage that is applied to the motor the faster the rotor will rotate. By varying
this applied DC voltage the rotational speed of the motor can also be varied.

4.5.2 Conventional (Brushed) DC Motor

Fig 12- Conventional (Brushed) DC Motor

Permanent magnet (PMDC) brushed motors are generally much smaller and cheaper than
their equivalent wound stator type DC motor cousins as they have no field winding. In
permanent magnet DC (PMDC) motors these field coils are replaced with strong rare earth
(i.e. Samarium Cobolt, or Neodymium Iron Boron) type magnets which have very high
magnetic energy fields. This gives them a much better linear speed/torque characteristic
than the equivalent wound motors because of the permanent and sometimes very strong
magnetic field, making them more suitable for use in models, robotics and servos.

Although DC brushed motors are very efficient and cheap, problems associated with the
brushed DC motor is that sparking occurs under heavy load conditions between the two
surfaces of the commutator and carbon brushes resulting in self generating heat, short life
span and electrical noise due to sparking, which can damage any semiconductor switching
device such as a MOSFET or transistor. To overcome these disadvantages, Brushless DC
Motors were developed.

8TH SEM |B.E | DEPT OF ECE | AIT-B 31


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.5.3 The Brushless DC Motor

The brushless DC motor (BDCM) is very similar to a permanent magnet DC motor,


but does not have any brushes to replace or wear out due to commutator sparking.
Therefore, little heat is generated in the rotor increasing the motors life. The design of the
brushless motor eliminates the need for brushes by using more complex drive circuits were
the rotor magnetic field is a permanent magnet which is always in synchronization with the
stator field allows for a more precise speed and torque control. Then the construction of a
brushless DC motor is very similar to the AC motor making it a true synchronous motor
but one disadvantage is that it is more expensive than an equivalent "brushed" motor design.

The control of the brushless DC motors is very different from the normal brushed
DC motor, in that it this type of motor incorporates some means to detect the rotors angular
position (or magnetic poles) required to produce the feedback signals required to control
the semiconductor switching devices. The most common position/pole sensor is the "Hall
Effect Sensor", but some motors also use optical sensors.

Using Hall effect sensors, the polarity of the electromagnets is switched by the
motor control drive circuitry. Then the motor can be easily synchronized to a digital clock
signal, providing precise speed control. Brushless DC motors can be constructed to have,
an external permanent magnet rotor and an internal electromagnet stator or an internal
permanent magnet rotor and an external electromagnet stator.

Advantages of the Brushless DC Motor compared to its “brushed” cousin are higher
efficiencies, high reliability, low electrical noise, good speed control and more importantly,
no brushes or commutator to wear out producing a much higher speed. However their
disadvantage is that they are more expensive and more complicated to control.

4.5.4 The DC Servo Motor

DC Servo motors are used in closed loop type applications were the position of the
output motor shaft is fed back to the motor control circuit. Typical positional "Feedback"
devices include Resolvers, Encoders and Potentiometers as used in radio control models
such as airplanes and boats etc. A servo motor generally includes a built-in gearbox for
speed reduction and is capable of delivering high torques directly. The output shaft of a

8TH SEM |B.E | DEPT OF ECE | AIT-B 32


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

servo motor does not rotate freely as do the shafts of DC motors because of the gearbox
and feedback devices attached.

DC motor behaviour

At a simplistic level, using DC motors is pretty straightforward -- you put power in,
and get rotary motion out. Life, of course, is never this simple -- there are a number of
subtleties of DC motor behaviour that should be accounted for in BEAMbot design.

High-speed output

This is the simplest trait to understand and treat -- most DC motors run at very high
output speeds (generally thousands or tens of thousands of RPM). While this is fine for
some BEAMbots (say, photo poppers or solar rollers), many BEAMbots (walkers, heads)
require lower speeds -- you must put gears on your DC motor's output for these
applications.

Back EMF

Just as putting voltage across a wire in a magnetic field can generate motion,
moving a wire through a magnetic field can generate voltage. This means that as a DC
motor's rotor spins, it generates voltage -- the output voltage is known as back EMF.
Because of back EMF, a spark is created at the commutator as a motor's brushes switch
from contact to contact. Meanwhile, back EMF can damage sensitive circuits when a motor
is stopped suddenly.

Noise (ripple) on power lines

A number of things will cause a DC motor to put noise on its power lines:
commutation noise (a function of brush / commutator design & construction), roughness in
bearings (via back EMF), and gearing roughness (via back EMF, if the motor is part of a
gear motor) are three big contributors.

Even without these avoidable factors, any electric motor will put noise on its power
lines by virtue of the fact that its current draw is not constant throughout its motion. Going

8TH SEM |B.E | DEPT OF ECE | AIT-B 33


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

back to our example two-pole motor, its current draw will be a function of the angle
between its rotor coil and field magnets:

Since most small DC motors have 3 coils, the coils' current curves will overlay each other:

Added together, this ideal motor's current will then look something like this:

Fig 13- Noise (ripple) on power lines

Reality is a bit more complex than this, as even a high-quality motor will display a
current transient at each commutation transition. Since each coil has inductance (by
definition) and some capacitance, there will be a surge of current as the commutator's
brushes first touch a coil's contact, and another as the brushes leave the contact (here, there's
a slight spark as the coil's magnetic field collapses).

As a good example, consider an oscilloscope trace of the current through a Mabuchi


FF-030PN motor supplied with 2 V (1ms per horizontal division, 0.05 mA per vertical
division):

8TH SEM |B.E | DEPT OF ECE | AIT-B 34


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

In this case, the peak-to-peak current ripple is approximately 0.29 mA, while the
average motor current is just under 31 mA. So under these conditions, the motor puts about
less than 1% of current ripple onto its power lines (and as you can see from the "clean"
traces, it outputs essentially no high-frequency current noise). Note that since this is a 3-
pole motor, and each coil is energized in both directions over the course of a rotor rotation,
one revolution of the rotor will correspond to six of the above curves (here, 6 x 2.4 ms =
0.0144 sec, corresponding to a motor rotation rate of just under 4200 RPM).

Motor power ripple can wreak havoc in Nv nets by destabilizing them inadvertently.
Fortunately, this can be mitigated by putting a small capacitor across the motor's power
lines (you'll only be able to filter out "spikey" transients this way, though -- you'll always
see curves like the ones above being imposed on your power). On the flip side of this coin,
motor power ripple can be put to good use -- as was shown above, ripple frequency can be
used to measure motor speed, and its destabilizing tendencies can be used to reverse a motor
without the need for discrete "back-up" sensors

4.5.5 Characteristics of DC Motor:

Voltage in steady state condition

Where:

V = input voltage
Eb = back EMF
Ia = armature current
R = total resistance

The total resistance R = armature resistance (Ra) + external resistance (Rph).

8TH SEM |B.E | DEPT OF ECE | AIT-B 35


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 13-

A:shunt
B:series
C:compound
f = field coil

Shunt wound motor

A shunt wound motor has a high-resistance field winding connected in parallel with
the armature. It responds to increased load by trying to maintain its speed and this leads to
an increase in armature current. This makes it unsuitable for widely-varying loads, which
may lead to overheating.

Series wound motor

A series wound motor has a low-resistance field winding connected in series with
the armature. It responds to increased load by slowing down; the current increases and the
torque rises in proportional to the square of the current since the same current flows in both
the armature and the field windings. If the motor is stalled, the current is limited only by
the total resistance of the windings and the torque can be very high, but there is a danger of
the windings becoming overheated. Series wound motors were widely used as traction
motors in rail transport of every kind, but are being phased out in favor of AC induction
motors supplied through solid state inverters. The counter-EMF aids the armature
resistance to limit the current through the armature. When power is first applied to a motor,
the armature does not rotate. At that instant, the counter-EMF is zero and the only factor
limiting the armature current is the armature resistance. Usually the armature resistance of

8TH SEM |B.E | DEPT OF ECE | AIT-B 36


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

a motor is less than 1 Ω; therefore the current through the armature would be very large
when the power is applied. Therefore the need arises for an additional resistance in series
with the armature to limit the current until the motor rotation can build up the counter-EMF.
As the motor rotation builds up, the resistance is gradually cut out.

The output speed torque characteristic is the most notable characteristic of series wound
d.c. motors. The speed being almost entirely dependent on the torque required to drive the
load. This suits large inertial loads as the speed will drop until the motor slowly starts to
rotate & these motors have a very high stalling torque.

Permanent magnet motor

Permanent-magnet types have some performance advantages over direct-current,


excited, synchronous types, and have become predominant in fractional horsepower
applications. They are smaller, lighter, more efficient and reliable than other singly fed
electric machines.

Originally all large industrial DC motors used wound field or rotor magnets.
Permanent magnets have traditionally only been useful on small motors because it was
difficult to find a material capable of retaining a high-strength field. Only recently have
advances in materials technology allowed the creation of high-intensity permanent
magnets, such as neodymium magnets, allowing the development of compact, high-power
motors without the extra real-estate of field coils and excitation means. But as these high
performance permanent magnets become more applied in electric motor or generator
systems, other problems are realized.

Speed Control

Generally, the rotational speed of a DC motor is proportional to the EMF in its coil
(= the voltage applied to it minus voltage lost on its resistance), and the torque is
proportional to the current. Speed control can be achieved by variable battery tapings,
variable supply voltage, resistors or electronic controls. The direction of a wound field DC
motor can be changed by reversing either the field or armature connections but not both.
This is commonly done with a special set of contactors (direction contactors).

The effective voltage can be varied by inserting a series resistor or by an electronically


controlled switching device made of thyristors, transistors, or, formerly, mercury arc
rectifiers.

8TH SEM |B.E | DEPT OF ECE | AIT-B 37


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

In a circuit known as a chopper, the average voltage applied to the motor is varied
by switching the supply voltage very rapidly. As the "on" to "off" ratio is varied to alter the
average applied voltage, the speed of the motor varies. The percentage "on" time multiplied
by the supply voltage gives the average voltage applied to the motor. Therefore, with a
100 V supply and a 25% "on" time, the average voltage at the motor will be 25 V. During
the "off" time, the armature's inductance causes the current to continue through a diode
called a "fly back diode", in parallel with the motor. At this point in the cycle, the supply
current will be zero, and therefore the average motor current will always be higher than the
supply current unless the percentage "on" time is 100%. At 100% "on" time, the supply and
motor current are equal. The rapid switching wastes less energy than series resistors. This
method is also called pulse-width modulation (PWM) and is often controlled by a
microprocessor. An output filter is sometimes installed to smooth the average voltage
applied to the motor and reduce motor noise.

Since the series-wound DC motor develops its highest torque at low speed, it is
often used in traction applications such as electric locomotives, and trams. Another
application is starter motors for petrol and small diesel engines. Series motors must never
be used in applications where the drive can fail (such as belt drives). As the motor
accelerates, the armature (and hence field) current reduces. The reduction in field causes
the motor to speed up until it destroys itself. This can also be a problem with railway motors
in the event of a loss of adhesion since, unless quickly brought under control, the motors
can reach speeds far higher than they would do under normal circumstances. This can not
only cause problems for the motors themselves and the gears, but due to the differential
speed between the rails and the wheels it can also cause serious damage to the rails and
wheel treads as they heat and cool rapidly. Field weakening is used in some electronic
controls to increase the top speed of an electric vehicle. The simplest form uses a contactor
and field-weakening resistor; the electronic control monitors the motor current and switches
the field weakening resistor into circuit when the motor current reduces below a preset
value (this will be when the motor is at its full design speed). Once the resistor is in circuit,
the motor will increase speed above its normal speed at its rated voltage. When motor
current increases, the control will disconnect the resistor and low speed torque is made
available.

8TH SEM |B.E | DEPT OF ECE | AIT-B 38


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

One interesting method of speed control of a DC motor is the Ward Leonard control.
It is a method of controlling a DC motor (usually a shunt or compound wound) and was
developed as a method of providing a speed-controlled motor from an AC supply, though
it is not without its advantages in DC schemes. The AC supply is used to drive an AC
motor, usually an induction motor that drives a DC generator or dynamo. The DC output
from the armature is directly connected to the armature of the DC motor (sometimes but
not always of identical construction). The shunt field windings of both DC machines are
independently excited through variable resistors. Extremely good speed control from
standstill to full speed, and consistent torque, can be obtained by varying the generator
and/or motor field current. This method of control was the de facto method from its
development until it was superseded by solid state thyristor systems. It found service in
almost any environment where good speed control was required, from passenger lifts
through to large mine pit head winding gear and even industrial process machinery and
electric cranes. Its principal disadvantage was that three machines were required to
implement a scheme (five in very large installations, as the DC machines were often
duplicated and controlled by a tandem variable resistor). In many applications, the motor-
generator set was often left permanently running, to avoid the delays that would otherwise
be caused by starting it up as required. Although electronic (thyristor) controllers have
replaced most small to medium Ward-Leonard systems, some very large ones (thousands
of horsepower) remain in service. The field currents are much lower than the armature
currents, allowing a moderate sized thyristor unit to control a much larger motor than it
could control directly. For example, in one installation, a 300 amp thyristor unit controls
the field of the generator. The generator output current is in excess of 15,000 amperes,
which would be prohibitively expensive (and inefficient) to control directly with thyristors.

Protection

To extend a D.C. motor’s service life, protective devices and motor controllers are
used to protect it from mechanical damage, excessive moisture, high dielectric stress and
high temperature or thermal overloading. These protective devices sense motor fault
conditions and either annunciate an alarm to notify the operator or automatically de-
energize the motor when a faulty condition occurs. For overloaded conditions, motors are
protected with thermal overload relays. Bi-metal thermal overload protectors are embedded
in the motor's windings and made from two dissimilar metals. They are designed such that

8TH SEM |B.E | DEPT OF ECE | AIT-B 39


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

the bimetallic strips will bend in opposite directions when a temperature set point is reached
to open the control circuit and de-energize the motor. Heaters are external thermal overload
protectors connected in series with the motor’s windings and mounted in the
motor contactor. Solder pot heaters melt in an overload condition, which cause the motor
control circuit to de-energize the motor. Bimetallic heaters function the same way as
embedded bimetallic protectors. Fuses and circuit breakers are over current or short
circuit protectors. Ground fault relays also provide over current protection. They monitor
the electrical current between the motor’s windings and earth system ground. In motor-
generators, reverse current relays prevent the battery from discharging and motorizing the
generator. Since D.C. motor field loss can cause a hazardous runaway or over speed
condition, loss of field relays are connected in parallel with the motor’s field to sense field
current. When the field current decreases below a set point, the relay will deenergize the
motor’s armature. A locked rotor condition prevents a motor from accelerating after its
starting sequence has been initiated. Distance relays protect motors from locked-rotor
faults. Under voltage motor protection is typically incorporated into motor controllers or
starters. In addition, motors can be protected from overvoltages or surges with solation
transformers, power conditioning equipment, MOVs, arrestors and harmonic filters.
Environmental conditions, such as dust, explosive vapors, water, and high ambient
temperatures, can adversely affect the operation of a DC motor. To protect a motor from
these environmental conditions, the National Electrical Manufacturers Association
(NEMA) and the International Electro technical Commission (IEC) have standardized
motor enclosure designs based upon the environmental protection they provide from
contaminants.

DC Motor Starters:

The counter-emf aids the armature resistance to limit the current through the
armature. When power is first applied to a motor, the armature does not rotate. At that
instant the counter-emf is zero and the only factor limiting the armature current is the
armature resistance and inductance. Usually the armature resistance of a motor is less than
1 Ω; therefore the current through the armature would be very large when the power is
applied. This current can make an excessive voltage drop affecting other equipment in the
circuit and even trip overload protective devices.

8TH SEM |B.E | DEPT OF ECE | AIT-B 40


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Therefore the need arises for an additional resistance in series with the armature to limit the
current until the motor rotation can build up the counter-emf. As the motor rotation builds
up, the resistance is gradually cut out.

Fig 14- Manual-starting rheostat

DC motor manual starting rheostat with no-voltage and overload release features.

When electrical and DC motor technology was first developed, much of the
equipment was constantly tended by an operator trained in the management of motor
systems. The very first motor management systems were almost completely manual, with
an attendant starting and stopping the motors, cleaning the equipment, repairing any
mechanical failures, and so forth.

The first DC motor-starters were also completely manual, as shown in this image.
Normally it took the operator about ten seconds to slowly advance the rheostat across the
contacts to gradually increase input power up to operating speed. There were two different
classes of these rheostats, one used for starting only, and one for starting and speed
regulation. The starting rheostat was less expensive, but had smaller resistance elements
that would burn out if required to run a motor at a constant reduced speed.

This starter includes a no-voltage magnetic holding feature, which causes the
rheostat to spring to the off position if power is lost, so that the motor does not later attempt
to restart in the full-voltage position. It also has over current protection that trips the lever
to the off position if excessive current over a set amount is detected.

8TH SEM |B.E | DEPT OF ECE | AIT-B 41


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 15 -Three-point starter

Three point starter

The incoming power is indicated as L1 and L2. The components within the broken lines
form the three-point starter. As the name implies there are only three connections to the
starter. The connections to the armature are indicated as A1 and A2. The ends of the field
(excitement) coil are indicated as F1 and F2. In order to control the speed, a field rheostat
is connected in series with the shunt field. One side of the line is connected to the arm of
the starter (represented by an arrow in the diagram). The arm is spring-loaded so, it will
return to the "Off" position when not held at any other position.

• On the first step of the arm, full line voltage is applied across the shunt field. Since the
field rheostat is normally set to minimum resistance, the speed of the motor will not be
excessive; additionally, the motor will develop a large starting torque.
• The starter also connects an electromagnet in series with the shunt field. It will hold the
arm in position when the arm makes contact with the magnet.
• Meanwhile that voltage is applied to the shunt field, and the starting resistance limits
the current to the armature.
• As the motor picks up speed counter-emf is built up; the arm is moved slowly to short.

Four-point starter

The four-point starter eliminates the drawback of the three-point starter. In addition
to the same three points that were in use with the three-point starter, the other side of the
line, L1, is the fourth point brought to the starter when the arm is moved from the "Off"
position. The coil of the holding magnet is connected across the line. The holding magnet
and starting resistors function identical as in the three-point starter.

8TH SEM |B.E | DEPT OF ECE | AIT-B 42


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

• The possibility of accidentally opening the field circuit is quite remote. The four-point
starter provides the no-voltage protection to the motor. If the power fails, the motor is
disconnected from the line.
Energy Losses in DC Motors:

Losses occur when electrical energy is converted to mechanical energy (in the
motor), or mechanical energy is converted to electrical energy (in the generator). For the
machine to be efficient, these losses must be kept to a minimum. Some losses are electrical,
others are mechanical. Electrical losses are classified as copper losses and iron losses;
mechanical losses occur in overcoming the friction of various parts of the machine.

Copper losses occur when electrons are forced through the copper windings of the armature
and the field. These losses are proportional to the square of the current. They are sometimes
called I2R losses, since they are due to the power dissipated in the form of heat in the
resistance of the field and armature windings.

Iron losses are subdivided in hysteresis and eddy current losses. Hysteresis losses are
caused by the armature revolving in an alternating magnetic field. It, therefore, becomes
magnetized first in one direction and then in the other. The residual magnetism of the iron
or steel of which the armature is made causes these losses. Since the field magnets are
always magnetized in one direction (dc field), they have no hysteresis losses.

Eddy current losses occur because the iron core of the armature is a conductor revolving in
a magnetic field. This sets up an e.m.f. across portions of the core, causing currents to flow
within the core. These currents heat the core and, if they become excessive, may damage
the windings. As far as the output is concerned, the power consumed by eddy currents is a
loss. To reduce eddy currents to a minimum, a laminated core usually is used. A laminated
core is made of thin sheets of iron electrically insulated from each other. The insulation
between laminations reduces eddy currents, because it is "transverse" to the direction in
which these currents tend to flow. However, it has no effect on the magnetic circuit. The
thinner the laminations, the more effectively this method reduces eddy current losses.

8TH SEM |B.E | DEPT OF ECE | AIT-B 43


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.5.6 Advantages of DC Motor:

• Speed control over a wide range both above and below the rated speed: The
attractive feature of the dc motor is that it offers the wide range of speed control
both above and below the rated speeds. This can be achieved in dc shunt motors by
methods such as armature control method and field control method. This is one of
the main applications in which dc motors are widely used in fine speed applications
such as in rolling mills and in paper mills.
• High starting torque: dc series motors are termed as best suited drives for traction
applications used for driving heavy loads in starting conditions. DC series motors
will have a staring torque as high as 500% compared to normal operating torque.
Therefore dc series motors are used in the applications such as in electric trains and
cranes.
• Accurate steep less speed with constant torque: Constant torque drives is one
such the drives will have motor shaft torque constant over a given speed range. In
such drives shaft power varies with speed.
• Quick starting, stopping, reversing and acceleration
• Free from harmonics, reactive power consumption and many factors which make
dc motors more advantageous compared to an ac induction motors.

4.5.7 Disadvantages of DC Motor:


➢ High initial cost
➢ Increased operation and maintenance cost due to presence of commutator and brush
gear
➢ Cannot operate in explosive and hazard conditions due to sparking occur at brush (
risk in commutation failure)

8TH SEM |B.E | DEPT OF ECE | AIT-B 44


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.6 PRESSURE SENSOR-

Fig 16 : Piezoelectric pressure sensor

This is a piezoelectric sensor that uses the piezoelectric effect, to measure changes in
pressure, acceleration, strain or force by converting them to an electrical charge. The prefix
piezo is Greek for 'press' or 'squeeze'. A pressure sensor is a device equipped with a
pressure-sensitive element that measures the pressure of a gas or a liquid against a
diaphragm made of stainless steel, silicon, etc., and converts the measured value into an
electrical signal as an output

4.6.1 PRINCIPAL OF OPERATION

The piezoelectric material is cut produces three main operational modes

➢ 1. Transverse
➢ 2. Longitudinal
➢ 3. Shear

1. Transverse effect

A force applied along a neutral axis (y) displaces charges along the (x) direction,
perpendicular to the line of force. The amount of charge (Cx) depends on the geometrical
dimensions of the respective piezoelectric element. When dimensions a,b,c apply,

Cx= dxy Fy b/a,

where a is the dimension in line with the neutral axis, b is in line with the charge
generating axis and d is the corresponding piezoelectric coefficient.

8TH SEM |B.E | DEPT OF ECE | AIT-B 45


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

2. Longitudinal effect

The amount of charge displaced is strictly proportional to the applied force and independent
of the piezoelectric element size and shape. Putting several elements mechanically in series
and electrically in parallel is the only way to increase the charge output. The resulting
charge is

Cx= dxx Fx n,

where dxx is the piezoelectric coefficient for a charge in x- direction released by forces
applied along x-direction, Fx the applied Force in x-direction and n corresponds to the
number of elemnts.

3. Shear effect

➢ The charges produced are strictly proportional to the applied forces and independent
of the element size and shape. For n elements mechanically in series and electrically
in parallel the charge is
➢ Cx= 2dxx Fx n,
➢ In contrasr to the longitudinal and shear effects, the transverse effect make it
possible to fine-tune sensitivity on the applied force and element dimension.

Sensor Design

Fig 17 : metal disks with piezo material

➢ Based on piezoelectric technology various physical quanities can be measured, the


most common are pressure and acceleration. for pressure sensor, a thin membrane
and a massive base is used, ensuring that an applied pressure specifically loads the

8TH SEM |B.E | DEPT OF ECE | AIT-B 46


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

elements in one direction. For accelerometers, a seismic mass is attached to the


crystal elements. When attached to the crystal elements. When the accelerometer
experiences a motion, the invariant seismic mass loads the elements according to
Newton's second law of motion F=ma
➢ The main difference in working principle between these two cases is the way they
apply forces to the sensing elements. In a pressure sensor, a thin membrane transfers
the force to the elements, while in accelerometers an attached seismic mass applied
the forces.

➢ Sensors often tend to be sensitive to more than one physical quantity. Pressure
sensor show false signal when they are exposed tp vibrations. Sophisticated
pressure sensors therefore use acceleration compensation elements in addition to
the pressure sensing elements. By carefully matching those elements, the
acceleration signal is subtracted from the combined signal of pressure and
acceleration to derive the true pressure information.

➢ Vibration sensors can also harvest otherwise wasted energy from mechanical
vibrations. This is accomplished by using piezoelectric materials to convert
mechanical strain into usable electrical energy.

4.6.2 Sensing Material

➢ Two main groups of material are used for piezoelectric semsors: piezoelectric
ceramics and single crystal materials.
➢ The ceramic materials have a piezoelectric constant/sensitivity that is roughly two
orders of the natural single crystal materials and can be produced by inexpensive
sintering processes. The piezoeffect in the piezoceramics is trained , so their high
sensitivity degrades over time. This degradation is highly correlated with increased
temperature.
➢ The less sensitive, natural, single-crystal materials (gallium, phosphate, quartz,
tournaline) have a higher- when carefuuy handled, alost unlimited - long term
stability. There are also new single - crystal materials commercially available such
as Lead Magnesium Niobate-Lead Titanate (PMN-PT). These materials offer

8TH SEM |B.E | DEPT OF ECE | AIT-B 47


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

improved sensitivity over PZT but have a lower maximum operating temperature
and are currently more expensive to manufacture.

4.6.3 Operating Principles


A semiconductor piezo-resistance dispersion pressure sensor has a semiconductor
distortion gauge formed on the surface of the diaphragm, and it converts changes in
electrical resistance into an electrical signal by means of the piezo-resistance effect that
occurs when the diaphragm is distorted due to an external force (pressure).A static
capacitance pressure sensor has a capacitor that is formed by a static glass electrode and
an opposing movable silicon electrode, and it converts changes in static capacitance that
occur when the movable electrode is distorted due to an external force (pressure) into an
electrical signal. (The E8Y uses the static capacitance method, and other models use the
semiconductor method.)

Fig 18-Semiconductor Distortion Gauge Construction

8TH SEM |B.E | DEPT OF ECE | AIT-B 48


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Piezo-resistance Effect

The electrical resistance of the above conductor is expressed by the following formula:R =
ρ × L/S.When this conductor is pulled to the right or left as shown below, the length
increases and the cross-sectional area decreases.

The electrical resistance of the above conductor is expressed by the following formula:R'
= ρ ×(L+1)/S-s.Accordingly,R' > R.This shows how the application of a mechanical force
changes the electrical resistance.
4.6.4 ADVANTAGE OF PIEZOELECTRIC SENSOR

➢ 1. The high modulus of elasticity of many piezoelectric materials is comparable to


that of many materials goes upto 106 N/m2 .
➢ 2. Even though piezoelectric sensors are elecromechanical systems that react to
compression, the sensing elements show almost zero deflection. this gives
piezoelectric sensors ruggedness, an extremely high natural frequency
➢ 3. This technology is insensitive to the electromagnetic fields and radiation,
enabling measurements under harsh conditions

8TH SEM |B.E | DEPT OF ECE | AIT-B 49


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.7 LM52596 DC TO DC Converters:

➢ The LM2596 series of regulators are monolithic integrated circuits that provide all
the active functions
➢ for a step-down (buck) switching regulator, capable of driving a 3-A load with
excellent line and load
➢ regulation. These devices are available in fixed output voltages of 3.3 V, 5 V, 12 V,
and an adjustable output
➢ version.

Requiring a minimum number of external components, these regulators are simple to use
and include internal frequency compensation, and a fixed frequency oscillator. The
LM2596 series operates at a switching frequency of 150 kHz, thus allowing smaller sized
filter components than what would be required with lower frequency switching regulators.
Available in a standard 7-pin TO-220 package with several different lead bend options, and
a 7-pin TO-263 surface mount package.A standard series of inductors are available from
several different manufacturers optimized for use with theLM2596 series. This feature
greatly simplifies the design of switch-mode power supplies.

Other features include a ±4% tolerance on output voltage under specified input voltage and
output load conditions, and ±15% on the oscillator frequency. External shutdown is
included, featuring typically 80 μA standby current. Self-protection features include a two
stage frequency reducing current limit for the output switch and an over temperature
shutdown for complete protection under fault conditions

8TH SEM |B.E | DEPT OF ECE | AIT-B 50


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 19 : LM2596 DC-DC converter

Fig 20: schematic diagram of LM2596 DC-DC converter

8TH SEM |B.E | DEPT OF ECE | AIT-B 51


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

The basic operation of the buck converter has the current in an inductor controlled
by two switches (usually a transistor and a diode). In the idealised converter, all the
components are considered to be perfect. Specifically, the switch and the diode have zero
voltage drop when on and zero current flow when off, and the inductor has zero series
resistance. Further, it is assumed that the input and output voltages do not change over the
course of a cycle (this would imply the output capacitance as being infinite).

The conceptual model of the buck converter is best understood in terms of the
relation between current and voltage of the inductor. Beginning with the switch open (off-
state), the current in the circuit is zero. When the switch is first closed (on state), the current
will begin to increase, and the inductor will produce an opposing voltage across its
terminals in response to the changing current. This voltage drop counteracts the voltage of
the source and therefore reduces the net voltage across the load. Over time, the rate of
change of current decreases, and the voltage across the inductor also then decreases,
increasing the voltage at the load. During this time, the inductor stores energy in the form
of a magnetic field. If the switch is opened while the current is still changing, then there
will always be a voltage drop across the inductor, so the net voltage at the load will always
be less than the input voltage source. When the switch is opened again (off-state), the
voltage source will be removed from the circuit, and the current will decrease. The
decreasing current will produce a voltage drop across the inductor (opposite to the drop at
on-state), and now the inductor becomes a Current Source. The stored energy in the
inductor's magnetic field supports the current flow through the load. This current, flowing
while the input voltage source is disconnected, when concatenated with the current flowing
during on-state, totals to current greater than the average input current (being zero during
off-state). The "increase" in average current makes up for the reduction in voltage, and
ideally preserves the power provided to the load. During the off-state, the inductor is
discharging its stored energy into the rest of the circuit. If the switch is closed again before
the inductor fully discharges (on state), the voltage at the load will always be greater than
zero.

8TH SEM |B.E | DEPT OF ECE | AIT-B 52


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Features

• 3.3-V, 5-V, 12-V, and Adjustable Output Versions

• Adjustable Version Output Voltage Range: 1.2-V to 37-V ± 4% Maximum Over Line and
Load Conditions

• Available in TO-220 and TO-263 Packages

• 3-A Output Load Current

• Input Voltage Range Up to 40 V

• Requires Only 4 External Components

• Excellent Line and Load Regulation Specifications

• 150-kHz Fixed-Frequency Internal Oscillator

• TTL Shutdown Capability

• Low Power Standby Mode, IQ, Typically 80 μA

• High Efficiency

• Uses Readily Available Standard Inductors

• Thermal Shutdown and Current-Limit Protection

• Create a Custom Design Using the LM2596 with the WEBENCH Power Designer

8TH SEM |B.E | DEPT OF ECE | AIT-B 53


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

4.8 Wireless Camera

An Internet Protocol camera, or IP camera, is a type of digital video camera commonly


employed for survelliance, and which, unlike analog closed-circuit television (CCTV)

cameras, can send ad receive data via a computer network and the internet. Although most
of the cameras that do this are webcameras, the term IP camera or netcamera is usually
applied only to thoseused for surveillance that can be directly accessed over a
networkconnection.

Fig 21 - Wireless Camera

8TH SEM |B.E | DEPT OF ECE | AIT-B 54


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 22 - Wireless Camera specifications

4.8.1 What is P2P IP camera and how does it work?

With HDWX P2P cameras - uses a smartphone

1. Download and install "Plug&Play" app from Google Play Store by typing in "9527" into
the search bar.

2. Switch on the wireless webcam, making sure that the AP/P2P switch is in th eP2P
position.

8TH SEM |B.E | DEPT OF ECE | AIT-B 55


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

3. Wait about30 seconds until the device boots up and the wireless signal is transmitted
from the device.

4. The "Wifi Analyser" app is usefullto look for the signal. When running a signal should
beseen from "MD81S"

5. Open "Settings" in the Android devic eand go to "Wifi" and MD81S should be seen.
Connect to MD81S using the password 12345678.

6. Once connected open "Plug&Play" app on the Android device and connect to camera by
tapping the LAN button. On the "Cameras" screen the camera should appear. Tap on the
thumbnail image to open the connection and view the picture from the camera.

Fig 22: Setting up P2P (Wi-Fi Direct) connection.

Connecting Camera to a LAN via a Router

1. Star tup P2P connectio nas inthe previous section and go to "cameras" screen on Android
device. The Wifi camera should show up as a thumbnail.

2. Tap on the blue arrow on the right of the screen beside the Camera thumbnail to open
the "Settings" window.

8TH SEM |B.E | DEPT OF ECE | AIT-B 56


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 23 : Connecting camera to WLAN

3. In the settings window select "Wifi" and tap the blue "Search" button. This should show
the SSID of the local wireless router. Enter the password for the router and click "OK" and
the "Setting Success" screen should appear and the camera should reboot and connect itself
to the wireless LAN as shown.

4. Re connect the Android device to the WLAN and restart "Plug & Play".

5. Open the “Cameras" screen and tap on the camera thumb nail.

Fig 24: Opening connection to camera via a WLAN.

4.8.2 Advantages of P2P technology used in HDX IP Cameras:

1. P2P networks are highly scalable

2. As P2P is decentralised i.e services are spread out over various peers, it makes the system
quite reliable.

3. Cheap and affordable, no recurring costs for users.

4. P2P streams can be used to connect with multiple devices simultaneously.

5. P2P stream can be used to backup data to the cloud

8TH SEM |B.E | DEPT OF ECE | AIT-B 57


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

6. Allow secure connections between the camera and viewing client with encrypted
streams.

7. Not limited or blocked by closed ports, no DDNS setup, firewalls, etc.

8. The camera doesn't use bandwidth to constantly upload data bandwidth when aviewing
device logs in to receive the feed.

9. Not eas yto hack the P2P platform as we must authenticate with atleat2 different servers
for the connectio n to establish.

4.8.3 Application of wireless camera

Fig 25-Application of wireless camera

8TH SEM |B.E | DEPT OF ECE | AIT-B 58


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Chapter 5
Software Required

➢ Embedded C
➢ Arduino IDE
➢ Blynk Application

5.1 Embedded C Program

5.1.1 Basics of Embedded C Program

Embedded C is one of the most popular and most commonly used Programming Languages
in the development of Embedded Systems. So, in this article, we will see some of the Basics
of Embedded C Program and the Programming Structure of Embedded C.

Embedded C is perhaps the most popular languages among Embedded Programmers for
programming Embedded Systems. There are many popular programming languages like
Assembly, BASIC, C++ etc. that are often used for developing Embedded Systems but
Embedded C remains popular due to its efficiency, less development time and portability.

Before digging in to the basics of Embedded C Program, we will first take a look at what
an Embedded System is and the importance of Programming Language in Embedded
Systems.

5.1.2What is an Embedded System?

An Embedded System can be best described as a system which has both the hardware and
software and is designed to do a specific task. A good example for an Embedded System,
which many households have, is a Washing Machine.

We use washing machines almost daily but wouldn’t get the idea that it is an embedded
system consisting of a Processor (and other hardware as well) and software.

8TH SEM |B.E | DEPT OF ECE | AIT-B 59


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 26- Example of embedded c programed machine

Embedded Systems can not only be stand-alone devices like Washing Machines but also
be a part of a much larger system. An example for this is a Car. A modern day Car has
several individual embedded systems that perform their specific tasks with the aim of
making a smooth and safe journey.

Some of the embedded systems in a Car are Anti-lock Braking System (ABS), Temperature
Monitoring System, Automatic Climate Control, Tyre Pressure Monitoring System, Engine
Oil Level Monitor, etc.

5.1.3 Programming Embedded Systems

As mentioned earlier, Embedded Systems consists of both Hardware and Software. If we


consider a simple Embedded System, the main Hardware Module is the Processor. The
Processor is the heart of the Embedded System and it can be anything like a
Microprocessor, Microcontroller, DSP, CPLD (Complex Programmable Logic Device) and
FPGA (Field Programmable Gated Array).

All these devices have one thing in common: they are programmable i.e. we can write a
program (which is the software part of the Embedded System) to define how the device
actually works.

Embedded Software or Program allow Hardware to monitor external events (Inputs) and
control external devices (Outputs) accordingly. During this process, the program for an
Embedded System may have to directly manipulate the internal architecture of the

8TH SEM |B.E | DEPT OF ECE | AIT-B 60


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Embedded Hardware (usually the processor) such as Timers, Serial Communications


Interface, Interrupt Handling, and I/O Ports etc.

From the above statement, it is clear that the Software part of an Embedded System is
equally important to the Hardware part. There is no point in having advanced Hardware
Components with poorly written programs (Software).

There are many programming languages that are used for Embedded Systems like
Assembly (low-level Programming Language), C, C++, JAVA (high-level programming
languages), Visual Basic, JAVA Script (Application level Programming Languages), etc.

In the process of making a better embedded system, the programming of the system plays
a vital role and hence, the selection of the Programming Language is very important.

5.1.4 Factors for Selecting the Programming Language

The following are few factors that are to be considered while selecting the Programming
Language for the development of Embedded Systems.

• Size: The memory that the program occupies is very important as Embedded
Processors like Microcontrollers have a very limited amount of ROM.
• Speed: The programs must be very fast i.e. they must run as fast as possible. The
hardware should not be slowed down due to a slow running software.
• Portability: The same program can be compiled for different processors.
• Ease of Implementation
• Ease of Maintenance
• Readability

Earlier Embedded Systems were developed mainly using Assembly Language. Even
though Assembly Language is closest to the actual machine code instructions, the lack of
portability and high amount of resources spent on developing the code, made the Assembly
Language difficult to work with.

There are other high-level programming languages that offered the above mentioned
features but none were close to C Programming Language.

5.1.5 Introduction to Embedded C Programming Language

Before going in to the details of Embedded C Programming Language and basics of


Embedded C Program, we will first talk about the C Programming Language.

The C Programming Language, developed by Dennis Ritchie in the late 60’s and early 70’s,
is the most popular and widely used programming language. The C Programming Language
provided low level memory access using an uncomplicated compiler (a software that
converts programs to machine code) and achieved efficient mapping to machine
instructions.

8TH SEM |B.E | DEPT OF ECE | AIT-B 61


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

The C Programming Language became so popular that it is used in a wide range of


applications ranging from Embedded Systems to Super Computers.

Embedded C Programming Language, which is widely used in the development of


Embedded Systems, is an extension of C Program Language. The Embedded C
Programming Language uses the same syntax and semantics of the C Programming
Language like main function, declaration of datatypes, defining variables, loops, functions,
statements, etc.

The extension in Embedded C from standard C Programming Language include I/O


Hardware Addressing, fixed point arithmetic operations, accessing address spaces, etc.

5.1.6 Difference between C and Embedded C

There is actually not much difference between C and Embedded C apart from few
extensions and the operating environment. Both C and Embedded C are ISO Standards that
have almost same syntax, datatypes, functions, etc.

Embedded C is basically an extension to the Standard C Programming Language with


additional features like Addressing I/O, multiple memory addressing and fixed-point
arithmetic, etc.

C Programming Language is generally used for developing desktop applications whereas


Embedded C is used in the development of Microcontroller based applications.

Basics of Embedded C Program

Now that we have seen a little bit about Embedded Systems and Programming Languages,
we will dive in to the basics of Embedded C Program. We will start with two of the basic
features of the Embedded C Program: Keywords and Datatypes.

5.1.7 Keywords in Embedded C

A Keyword is a special word with a special meaning to the compiler (a C Compiler for
example, is a software that is used to convert program written in C to Machine Code). For
example, if we take the Keil’s Cx51 Compiler (a popular C Compiler for 8051 based
Microcontrollers) the following are some of the keywords:

➢ bit
➢ sbit
➢ sfr
➢ small
➢ large

These are few of the many keywords associated with the Cx51 C Compiler along with the
standard C Keywords.

8TH SEM |B.E | DEPT OF ECE | AIT-B 62


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

5.1.8 Data Types in Embedded C

Data Types in C Programming Language (or any programming language for that matter)
help us declaring variables in the program. There are many data types in C Programming
Language like signed int, unsigned int, signed char, unsigned char, float, double, etc. In
addition to these there few more data types in Embedded C.

The following are the extra data types in Embedded C associated with the Keil’s Cx51
Compiler.

➢ bit
➢ sbit
➢ sfr
➢ sfr16

Table 5- data types of embedded c

Data Type Bits (Bytes) Range

bit 1 0 or 1 (bit addressable part of RAM)

signed int 16 (2) -32768 to +32767

unsigned int 16 (2) 0 to 65535

signed char 8 (1) -128 to +127

unsigned 8 (1) 0 to 255

float 32 (4) ±1.175494E-38 to ±3.402823E+38

double 32 (4) ±1.175494E-38 to ±3.402823E+38

sbit 1 0 or 1 (bit addressable part of RAM)

sfr 8 (1) RAM Addresses (80h to FFh)

sfr16 16 (2) 0 to 65535

8TH SEM |B.E | DEPT OF ECE | AIT-B 63


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Basic Structure of an Embedded C Program (Template for Embedded C Program)

The next thing to understand in the Basics of Embedded C Program is the basic structure
or Template of Embedded C Program. This will help us in understanding how an Embedded
C Program is written.

The following part shows the basic structure of an Embedded C Program.

• Multiline Comments . . . . . Denoted using /*……*/

• Single Line Comments . . . . . Denoted using //

• Preprocessor Directives . . . . . #include<…> or #define

• Global Variables . . . . . Accessible anywhere in the program

• Function Declarations . . . . . Declaring Function

• Main Function . . . . . Main Function, execution begins here


{
Local Variables . . . . . Variables confined to main function
Function Calls . . . . . Calling other Functions
Infinite Loop . . . . . Like while(1) or for(;;)
Statements . . . . .
….
….
}

• Function Definitions . . . . . Defining the Functions


{
Local Variables . . . . . Local Variables confined to this Function
Statements . . . . .
….
….
}

8TH SEM |B.E | DEPT OF ECE | AIT-B 64


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

5.1.9 Different Components of an Embedded C Program

➢ Comments: Comments are readable text that are written to help us (the reader)
understand the code easily. They are ignored by the compiler and do not take up
any memory in the final code (after compilation).
➢ There are two ways you can write comments: one is the single line comments
denoted by // and the other is multiline comments denoted by /*….*/.

➢ Preprocessor Directive: A Preprocessor Directive in Embedded C is an indication


to the compiler that it must look in to this file for symbols that are not defined in
the program.
➢ In C Programming Language (also in Embedded C), Preprocessor Directives are
usually represented using #include… or #define….

➢ In Embedded C Programming, we usually use the preprocessor directive to indicate


a header file specific to the microcontroller, which contains all the SFRs and the
bits in those SFRs.
➢ In case of 8051, Keil Compiler has the file “reg51.h”, which must be written at the
beginning of every Embedded C Program.

➢ Global Variables: Global Variables, as the name suggests, are Global to the
program i.e. they can be accessed anywhere in the program.

➢ Local Variables: Local Variables, in contrast to Global Variables, are confined to


their respective function.

➢ Main Function: Every C or Embedded C Program has one main function, from
where the execution of the program begins.

8TH SEM |B.E | DEPT OF ECE | AIT-B 65


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

5.2 Arduino Software (IDE)


The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains
a text editor for writing code, a message area, a text console, a toolbar with buttons for
common functions and a series of menus.

Writing Sketches

Programs written using Arduino Software (IDE) are called sketches. 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 displays text output by the
Arduino Software (IDE), including complete error messages and other information. The
bottom right hand 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.

Table 6- Writing Sketches

Verify
Checks your code for errors compiling it.

Upload
Compiles your code and uploads it to the configured board.
See uploading below for details.

Note: If you are using an external programmer with your board, you can hold
down the "shift" key on your computer when using this icon. The text will
change to "Upload using Programmer"

New
Creates a new sketch.

Open
Presents a menu of all the sketches in your sketchbook. Clicking one will open
it within the current window overwriting its content.

Note: due to a bug in Java, this menu doesn't scroll; if you need to open a sketch
late in the list, use the File | Sketchbookmenu instead.

Save
Saves your sketch.

Serial Monitor
Opens the serial monitor.

8TH SEM |B.E | DEPT OF ECE | AIT-B 66


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Additional commands are found within the five


menus: File, Edit, Sketch, Tools, Help. The menus are context sensitive, which means only
those items relevant to the work currently being carried out are available.

File

➢ New
Creates a new instance of the editor, with the bare minimum structure of a sketch already
in place.
➢ Open
Allows to load a sketch file browsing through the computer drives and folders.
➢ Open Recent
Provides a short list of the most recent sketches, ready to be opened.
➢ Sketchbook
Shows the current sketches within the sketchbook folder structure; clicking on any name
opens the corresponding sketch in a new editor instance.
➢ Examples
Any example provided by the Arduino Software (IDE) or library shows up in this menu
item. All the examples are structured in a tree that allows easy access by topic or library.
➢ Close
Closes the instance of the Arduino Software from which it is clicked.
➢ Save
Saves the sketch with the current name. If the file hasn't been named before, a name will
be provided in a "Save as.." window.
➢ Save as...
Allows to save the current sketch with a different name.
➢ Page Setup
It shows the Page Setup window for printing.
➢ Print
Sends the current sketch to the printer according to the settings defined in Page Setup.
➢ Preferences
Opens the Preferences window where some settings of the IDE may be customized, as the
language of the IDE interface.
➢ Quit
Closes all IDE windows. The same sketches open when Quit was chosen will be
automatically reopened the next time you start the IDE.

Edit

➢ Undo/Redo
Goes back of one or more steps you did while editing; when you go back, you may go
forward with Redo.
➢ Cut
Removes the selected text from the editor and places it into the clipboard.
➢ Copy
Duplicates the selected text in the editor and places it into the clipboard.

8TH SEM |B.E | DEPT OF ECE | AIT-B 67


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

➢ Copy for Forum


Copies the code of your sketch to the clipboard in a form suitable for posting to the
forum, complete with syntax colouring.
➢ Copy as HTML
Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web
pages.
➢ Paste
Puts the contents of the clipboard at the cursor position, in the editor.
➢ Select All
Selects and highlights the whole content of the editor.
➢ Comment/Uncomment
Puts or removes the // comment marker at the beginning of each selected line.
➢ Increase/Decrease Indent
Adds or subtracts a space at the beginning of each selected line, moving the text one
space on the right or eliminating a space at the beginning.
➢ Find
Opens the Find and Replace window where you can specify text to search inside the current
sketch according to several options.
➢ Find Next
Highlights the next occurrence - if any - of the string specified as the search item in the
Find window, relative to the cursor position.
➢ Find Previous
Highlights the previous occurrence - if any - of the string specified as the search item in
the Find window relative to the cursor position.

Sketch

• Verify/Compile
Checks your sketch for errors compiling it; it will report memory usage for code and
variables in the console area.
• Upload
Compiles and loads the binary file onto the configured board through the configured Port.
• Upload Using Programmer
This will overwrite the bootloader on the board; you will need to use Tools > Burn
Bootloader to restore it and be able to Upload to USB serial port again. However, it
allows you to use the full capacity of the Flash memory for your sketch. Please note that
this command will NOT burn the fuses. To do so a Tools -> Burn Bootloader command
must be executed.
• Export Compiled Binary
Saves a .hex file that may be kept as archive or sent to the board using other tools.
• Show Sketch Folder
Opens the current sketch folder.
• Include Library
Adds a library to your sketch by inserting #include statements at the start of your code.
For more details, see libraries below. Additionally, from this menu item you can access
the Library Manager and import new libraries from .zip files.
• Add File...
Adds a source file to the sketch (it will be copied from its current location). The new file
appears in a new tab in the sketch window. Files can be removed from the sketch using

8TH SEM |B.E | DEPT OF ECE | AIT-B 68


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

the tab menu accessible clicking on the small triangle icon below the serial monitor one
on the right side o the toolbar.

Tools

• Auto Format
This formats your code nicely: i.e. indents it so that opening and closing curly braces line
up, and that the statements inside curly braces are indented more.
• Archive Sketch
Archives a copy of the current sketch in .zip format. The archive is placed in the same
directory as the sketch.
• Fix Encoding & Reload
Fixes possible discrepancies between the editor char map encoding and other operating
systems char maps.
• Serial Monitor
Opens the serial monitor window and initiates the exchange of data with any connected
board on the currently selected Port. This usually resets the board, if the board supports
Reset over serial port opening.
• Board
Select the board that you're using. See below for descriptions of the various boards.
• Port
This menu contains all the serial devices (real or virtual) on your machine. It should
automatically refresh every time you open the top-level tools menu.
• Programmer
For selecting a hardware programmer when programming a board or chip and not using the
on board USB-serial connection. Normally you won't need this, but if you're burning a
bootloader to a new microcontroller, you will use this.
• Burn Bootloader
The items in this menu allow you to burn a bootloader onto the microcontroller on an
Arduino board. This is not required for normal use of an Arduino or Genuino board but is
useful if you purchase a new ATmega microcontroller (which normally come without a
bootloader). Ensure that you've selected the correct board from the Boards menu before
burning the bootloader on the target board. This command also set the right fuses.
• Sketchbook
• The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to
store your programs (or sketches). The sketches in your sketchbook can be opened
from the File > Sketchbook menu or from the Open button on the toolbar. The first
time you run the Arduino software, it will automatically create a directory for your
sketchbook. You can view or change the location of the sketchbook location from
with the Preferences dialog.

• Tabs, Multiple Files, and Compilation


• Allows you to manage sketches with more than one file (each of which appears in
its own tab). These can be normal Arduino code files (no visible extension), C files
(.c extension), C++ files (.cpp), or header files (.h).

8TH SEM |B.E | DEPT OF ECE | AIT-B 69


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

• Uploading
• Before uploading your sketch, you need to select the correct items from the Tools
> Board and Tools > Port menus. The boards are described below. On the Mac,
the serial port is probably something like /dev/tty.usbmodem241 (for an Uno or
Mega2560 or Leonardo) or /dev/tty.usbserial-1B1 (for a Duemilanove or earlier
USB board), or /dev/tty.USA19QW1b1P1.1 (for a serial board connected with a
Keyspan USB-to-Serial adapter). On Windows, it's probably COM1 or COM2 (for
a serial board) or COM4, COM5, COM7, or higher (for a USB board) - to find out,
you look for USB serial device in the ports section of the Windows Device
Manager. On Linux, it should be /dev/ttyACMx , /dev/ttyUSBx or similar. Once
you've selected the correct serial port and board, press the upload button in the
toolbar or select the Upload item from the Sketch menu. Current Arduino boards
will reset automatically and begin the upload. With older boards (pre-Diecimila)
that lack auto-reset, you'll need to press the reset button on the board just before
starting the upload. On most boards, you'll see the RX and TX LEDs blink as the
sketch is uploaded. The Arduino Software (IDE) will display a message when the
upload is complete, or show an error.

• When you upload a sketch, you're using the Arduino bootloader, a small program
that has been loaded on to the microcontroller on your board. It allows you to upload
code without using any additional hardware. The bootloader is active for a few
seconds when the board resets; then it starts whichever sketch was most recently
uploaded to the microcontroller. The bootloader will blink the on-board (pin 13)
LED when it starts (i.e. when the board resets).

• Libraries
• Libraries provide extra functionality for use in sketches, e.g. working with hardware
or manipulating data. To use a library in a sketch, select it from the Sketch >
Import Library menu. This will insert one or more #include statements at the top
of the sketch and compile the library with your sketch. Because libraries are
uploaded to the board with your sketch, they increase the amount of space it takes
up. If a sketch no longer needs a library, simply delete its #includestatements from
the top of your code.

5.3 BLYNK

Blynk is a Platform with iOS and Android apps to control Arduino, Raspberry Pi and the
likes over the Internet.

It's a digital dashboard where you can build a graphic interface for your project by simply
dragging and dropping widgets.

It's really simple to set everything up and you'll start tinkering in less than 5 mins.

Blynk is not tied to some specific board or shield. Instead, it's supporting hardware of your
choice. Whether your Arduino or Raspberry Pi is linked to the Internet over Wi-Fi,

8TH SEM |B.E | DEPT OF ECE | AIT-B 70


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Ethernet or this new ESP8266 chip, Blynk will get you online and ready for the Internet Of
Your Things.

5.3.1 Introduction:

Blynk is a Platform with IOS and Android apps to control Arduino, Raspberry Pi and the
likes over the Internet. It's a digital dashboard where you can build a graphic interface for
your project by simply dragging and dropping widgets.

Fig 27 – Home Page of Blynk Application

Blynk application can be found from the following links -

1. Android Blynk App

2. IOS Blynk App

After downloading the app, create an account and log in. (If possible than log in with your
real mail id for better connectivity later.)

Either you can login using your facebook account or you can login using your preffered
E-mail id.

8TH SEM |B.E | DEPT OF ECE | AIT-B 71


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

An authentication token will be sent to your respective E-mail id.

Fig 28: Log In Into Blynk Fig 29: Auth Token Sent To E-Mail From Blynk

5.3.2. Create a Blynk Project

Click the “Create New Project” in the app to create a new Blynk app. Give it any
name.Blynk works with hundreds of hardware models and connection types. Select the
Hardware type. After this, select connection type. In this project we have select WiFi
connectivity

The Auth Token is very important – you’ll need to stick it into your ESP8266’s
firmware. For now, copy it down or use the “E-mail” button to send it to yourself.

8TH SEM |B.E | DEPT OF ECE | AIT-B 72


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 30 :Creating New Project In Blynk App

5.3.3. Add Widgets to The Project

Then you’ll be presented with a blank new project. To open the widget box, click in the
project window to open.

We are selecting a button to control Led connected with Node MCU.

1. Click on Button.
2. Give name to Button say led.
3. Under OUTPUT tab- Click pin and select the pin to which led is connected to Node
MCU, here it is digital pin 2, hence select digital and under pin D2. And Click
continue.

Under MODE tab- Select whether you want this button as "push button" or "Switch".

You have successfully created a GUI for Arduino.

8TH SEM |B.E | DEPT OF ECE | AIT-B 73


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Fig 31: Adding widgets to the project Fig 32: configuring the widgets

8TH SEM |B.E | DEPT OF ECE | AIT-B 74


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

5.3.4 Upload The Firmware

Now that your Blynk project is set-up, open Arduino and navigate to the
ESP8266_Standalone example in the File > Examples > Blynk > Boards_WiFi>
ESP8266_Standalone menu.

Fig: Inside the Arduino IDE

5.3.5 Stand Alone Programming Code:

Before uploading, make sure to paste your authorization token into the auth [] variable.
Also make sure to load your Wifi network settings into the Blynk.begin(auth, "ssid",
"pass") function.

#include <dht11.h>

dht11 DHT;

#define BLYNK_PRINT Serial

8TH SEM |B.E | DEPT OF ECE | AIT-B 75


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

#include<ESP8266WiFi.h>
#include<BlynkSimpleEsp8266.h>
#include<SimpleTimer.h>

char auth[]="544e01a0983a42279c09b6";

char ssid[]="helloo";
char pass[]="helloo123";

SimpleTimer timer;
int PR=D6;

#define m11 D0
#define m12 D1
#define m21 D2
#define m22 D3
#define m31 D5
#define m41 D7
//#define relay D6
#define DHT11_PIN D8
#define GAS D4

void setup(){
Serial.begin(9600);
Blynk.begin(auth,ssid,pass);
//dht.begin();
pinMode(m11,OUTPUT);
pinMode(m12,OUTPUT);
pinMode(m21,OUTPUT);
pinMode(m22,OUTPUT);
pinMode(m31,OUTPUT);
pinMode(m41,OUTPUT);
pinMode(relay,OUTPUT);
pinMode(soil, INPUT);

timer.setInterval(1000L,sendUptime);
}

void sendUptime()
{
Blynk.virtualWrite(10,DHT.temperature);
Blynk.virtualWrite(11,DHT.humidity);
}

void loop()
{

8TH SEM |B.E | DEPT OF ECE | AIT-B 76


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Blynk.run();
timer.run();
int chk;
chk=DHT.read(DHT11_PIN);
delay(1000);

int x=digitalRead(D4);
if(x==1)
{
Blynk.virtualWrite(5,"GAS DETECTED");
}
else
{
Blynk.virtualWrite(5,"NORMAL");
}

int val=digitalRead(PR);
delay(500);
if(val==1)
{
Blynk.virtualWrite(1,"PRESSURE DETECTED");
}
else
{
Blynk.virtualWrite(1,"NORMAL");
}

8TH SEM |B.E | DEPT OF ECE | AIT-B 77


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

5.3.6 Execution

After the app has uploaded, open the serial monitor, setting the baud rate to 9600. Wait for
the “Ready” message.

Fig 33: Serial Monitor

Then click the “Run” button in the top right corner of the Blynk app. Press the button and
watch the LED

Then add more widgets to the project. They should immediately work on the ESP8266
without uploading any new firmware.

8TH SEM |B.E | DEPT OF ECE | AIT-B 78


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

Chapter 6

Conclusion
• This Project is mainly for detecting the damages inside the oil pipe that cannot be
detected by human beings.
• Inside the pipe, there is very heavy temperature, pressure and toxic gases. So we are
implementing a robot that have a camera, temperature sensor, gas sensor etc which
is used to detect the crack and conditions inside the pipe.
• Kroto Finder is a robot made for industry service requirements where human
intervention is not required in a dangerous environment. Implementation of a robot
that is used to detect the crack and conditions inside the pipe has been implemented
successfully.
• This data from all the high precision sensors are transmitted using wifi protocol
from the robot to the control station. The robot incorporates a wireless camera and
the data from the camera is transmitted to the frontend Visual studio

8TH SEM |B.E | DEPT OF ECE | AIT-B 79


Android Based Development of Data acquisition Robot- Kroto Finder 2017-2018

REFERENCES

[1] Xin-an Yuan, Wei Li, Guo-ming chen, Xiao-kang yin, Jiu-hao ge, Chuan-rong Zhang,
“Thedetection of axial cracks in pipe string using a feed-through ACFM probe”, IEEE
Xplore , 20th0ctober 2014.

[2] Thomas.F. QAlexandre Santos, Mohamed Younis, “ A sensor network for non-intrusive
andefficient leak detection in long pipelines” , IEEE Xplore, December 2011.

[3] An Jian, Wu Jiande, Pu Gnangyne, Qu cheng zhong, Huang chaobing, Pang chunlei,
Liu Hungwei, “A kind of pressure detection method in long distance ore slurry pipeline” ,
3rd International symposium on Knowledge Acquisition and Modeling, November 2010.

[4] Kenneth Ayala , “ The 8051 Microcontroller & Embedded Systems Using Assembly
and C”, India edition -2010.

[5] Muhammad Ali Mazidi, “Microcontrollers and Interfacing (For GTU) Pearson
Education, 2nd edition– 2012.

[6] www.alldatasheet.com [7] Douglas V Hall, “Microprocessors and interfacing-


Programming and Hardware” , 2nd edition, McGraw-Hill Education (India) Pvt Limited.

8TH SEM |B.E | DEPT OF ECE | AIT-B 80

You might also like