Professional Documents
Culture Documents
INTRODUCTION
1
CHAPTER 2
Block Diagram for Industrial Disaster Management
Power supply
LPG Sensor sector
Transistor
Bluetooth
Module
Fire sensor
MICRO CONTROLLER
SECTOR
Machine
Servo
Overvibrated
Motor
Sensor
Transistor
Machine
Overheat Buttons
Sensor
DC Motor
CHAPTER 3
2
DEVICES USED
3.1.MICROCONTROLLER
3.2.ARDUINO UNO
3.3.SENSORS
LPG Sensor
Fire Sensor
Machine Overheat Sensor
Machine Overvibrate Sensor
12V DC Motor
Servo Motor
Buzzer
Bluetooth Module
CHAPTER 4
3
Program to Operate the KIT
#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
#define buz 9
#define motor 8
#define Enter 10
#define Exit 11
Servo door;
int fire,fire_machine,lpg,vibration=0;
char a;
void setup()
{
door.attach(12);
door.write(50);
mySerial.begin(9600);
pinMode(buz,OUTPUT);
pinMode(motor,OUTPUT);
pinMode(Enter,INPUT_PULLUP);
pinMode(Exit,INPUT_PULLUP);
digitalWrite(buz,LOW);
digitalWrite(motor,HIGH);
delay(2500);
}
void loop()
4
{
lpg=analogRead(A0);
fire=analogRead(A1);
fire_machine=analogRead(A2);
vibration=analogRead(A4);
if(digitalRead(Enter)==LOW)
{
door_open();
}
if(digitalRead(Exit)==LOW)
{
door_close();
}
fire=analogRead(A1);
if(fire>750) //Fire detection, SMS
{
mySerial.println("+919030465235/Fire Detected");
digitalWrite(motor,LOW);
door_open();
while(fire>750)
{
buzzer();
fire=analogRead(A1);
}
delay(4000);
door_close();
}
//=================================================
fire_machine=analogRead(A2);
5
if(fire_machine>750) //Machine Overheated, SMS
{
mySerial.println("+919030465235/Machine Overheated");
digitalWrite(motor,LOW);
door_open();
while(fire_machine>750)
{
buzzer1();
fire_machine=analogRead(A2);
}
delay(4000);
door_close();
}
//=================================================
lpg=analogRead(A0);
if(lpg>850) //LPG detection, SMS
{
digitalWrite(motor,LOW);
mySerial.println("+919030465235/LPG Detected");
door_open();
while(lpg>850)
{
buzzer2();
lpg=analogRead(A0);
}
delay(4000);
door_close();
}
//=====================
if(vibration>1000)
6
{
delay(2000);
vibration=analogRead(A4);
if(vibration>1000)
{
digitalWrite(motor,LOW);
mySerial.println("+919030465235/Machine Overvibrated");
door_open();
digitalWrite(buz,HIGH);
delay(5000);
while(vibration>1000)
{
vibration=analogRead(A4);
}
digitalWrite(buz,LOW);
delay(4000);
door_close();
}
}
void door_open()
{
door.write(140);
7
void door_close()
{
door.write(50);
}
void buzzer()
{
for(a=0;a<12;a++)
{
digitalWrite(buz,HIGH);
delay(200);
digitalWrite(buz,LOW);
delay(200);
}
}
void buzzer1()
{
for(a=0;a<6;a++)
{
digitalWrite(buz,HIGH);
delay(400);
digitalWrite(buz,LOW);
delay(400);
}
}
void buzzer2()
{
for(a=0;a<10;a++)
{
digitalWrite(buz,HIGH);
8
delay(300);
digitalWrite(buz,LOW);
delay(100);
}
}
9
CHAPTER 5
Power supply and Regulation
Ever since the dawn of Arduino, one question has been asked over and
over again: "what kind of DC adapter can I use to power my Arduino?"
The short answer is: 9 to 12V DC, 250mA or more, 2.1mm plug, centre pin
positive.
10
must have a 2.1mm power plug on the Arduino end, and
the plug must be "centre positive", that is, the middle pin of the plug
has to be the + connection.
These important details are often contained right on the adapter. Here's
a picture of an adapter ideally suited to powering the Arduino. The important
info is underlined in red here:
As you can see, it has all the right stuff: 12V, DC, and a little picture
that shows you that the middle pin is positive.
One final note. The Arduino's on-board regulator can actually handle
up to 20V or more, so you can actually use an adapter that puts out 20V DC.
The reasons you don't want to do that are twofold: you'll lose most of that
voltage in heat, which is terribly inefficient. Secondly, the nice 9V pin on the
11
Arduino board will actually be putting out 20V or so, which could lead to
potential disaster when you connect something expensive to what you thought
was the 9V pin. Our advice is to stick with the 9V or 12V DC adapter.
12
CHAPTER-6
ARDUINO UNO
13
Arduino
The
Developer Arduino name Arduino comes
from a bar in Ivrea,
Manufacturer Many Italy, where some of
the founders of the
project used to meet.
Type Single-board
The bar was named
microcontroller
after Arduino of
Ivrea, who was the
Operating None
margrave of
system
the March of
Ivrea and King of
CPU Atmel AVR (8- Italy from 1002 to
bit), 1014.
ARM Cortex-
M0+ (32-bit), 6.1 HISTORY
ARM Cortex-
M3 (32-bit),
Intel
14
Quark (x86) (32-
The origin of the Arduino project started at the Interaction Design
Institute Ivrea (IDII) in Ivrea, Italy. At that time, the students used a BASIC
Stamp microcontroller at a cost of $100, a considerable expense for many
students. In 2003, Colombian student Hernando Barragn created the
development platform Wiring as a Master's thesis project at IDII, under the
supervision of Massimo Banzi and Casey Reas, who are known for work on
the Processing language. The project goal was to create simple, low cost tools
for creating digital projects by non-engineers. The Wiring platform consisted
of a printed circuit board (PCB) with an ATmega168 microcontroller, an IDE
based on Processing and library functions to easily program the
microcontroller.
In 2003, Massimo Banzi, with David Mellis, another IDII student, and
David Cuartielles, added support for the cheaper ATmega8 microcontroller to
Wiring. But instead of continuing the work on Wiring, they copied the Wiring
source code and renamed it as a separate project, called Arduino.
6.2 HARDWARE:
15
are available on the Arduino website. Layout and production files for some
versions of the hardware are also available. The source code for the IDE is
released under the GNU General Public License, version 2. Nevertheless, an
official Bill of Materials of Arduino boards has never been released by Arduino
staff.
An early Arduino board with an RS-232 serial interface (upper left) and
an Atmel ATmega8 microcontroller chip (black, lower right); the 14 digital I/O
pins are at the top, the 6 analog input pins at the lower right, and the power
connector at the lower left.
16
2012. The boards use single or double-row pins or female headers that
facilitate connections for programming and incorporation into other circuits.
These may connect with add-on modules termed shields. Multiple, and
possibly stacked shields may be individually addressable via an IC serial bus.
Most boards include a 5 V linear regulator and a 16 MHz crystal
oscillator or ceramic resonator. Some designs, such as the LilyPad, run at
8 MHz and dispense with the onboard voltage regulator due to specific form-
factor restrictions.
17
An official Arduino Uno R2 with descriptions of the I/O
locations
The Arduino board exposes most of the microcontroller's I/O pins for
use by other circuits. The Diecimila, Duemilanove, and current Uno provide 14
digital I/O pins, six of which can produce pulse-width modulated signals, and
six analog inputs, which can also be used as six digital I/O pins. These pins are
on the top of the board, via female 0.1-inch (2.54 mm) headers. Several plug-in
application shields are also commercially available. The Arduino Nano, and
Arduino-compatible Bare Bones Board and Boarduino boards may provide
male header pins on the underside of the board that can plug into
solderless breadboards.
18
indenting, brace matching, and syntax highlighting, and provides simple one-
click mechanisms to compile and upload programs to an Arduino board. It also
contains a message area, a text console, a toolbar with buttons for common
functions and a hierarchy of operation menus.
The Arduino IDE supports the languages C and C++ using special rules
of code structuring. The Arduino IDE supplies a software library from
the Wiring project, which provides many common input and output
procedures. User-written code only requires two basic functions, for starting
the sketch and the main program loop, that are compiled and linked with a
program stub main() into an executable cyclic executive program with
the GNU toolchain, also included with the IDE distribution. The Arduino IDE
employs the program avrdude to convert the executable code into a text file in
hexadecimal encoding that is loaded into the Arduino board by a loader
program in the board's firmware.
setup: This function is called once when a sketch starts after power-up
or reset. It is used to initialize variables, input and output pin modes, and other
libraries needed in the sketch.[44]
loop: After setup has been called, function loop is executed repeatedly
in the main program. It controls the board until the board is powered off or is
reset. Most Arduino boards contain a light-emitting diode (LED) and a load
resistor connected between pin 13 and ground, which is a convenient feature
19
for many tests and program functions.[46] A typical program for a beginning
Arduino programmer blinks an LED repeatedly.
6.4 APPLICATIONS
Homemade CNC using Arduino and DC motors with close loop control
by Homofaciens
6.5 RECOGNITION
20
The Arduino project received an honorary mention in the Digital
Communities category at the 2006 Prix Ars Electronical
6.6 TRADEMARK
This was revealed when the Arduino company tried to register the
trademark in other areas of the world (they originally registered only in the
US), and discovered that it was already registered in Italy. Negotiations with
Gianluca and his firm to bring the trademark under control of the original
Arduino company failed. In 2014, Smart Projects began refusing to pay
royalties. They then appointed a new CEO, Mr. Musto, who renamed the
company to Arduino SRL and created a website named arduino.org, copying
the graphics and layout of the original Arduino.cc. This resulted in a rift in the
Arduino development team. All Arduino boards are still available to consumers
so the implications of this are uncertain. In January 2015, Arduino LLC file a
lawsuit against Arduino SRL.
21
At the World Maker Faire in New York on October 1, 2016, Arduino
LLC co-founder and CEO Massimo Banzi and Arduino SRL CEO Federico
Musto announced the merger of the two arduino companies.
Arduino BT Front
22
Arduino back
23
An arduino board consists of an Atmel 8, 16, 32 bit AVR controller.
An important aspect of the arduino is its standard connectors, which lets users
connect arduino board to variety of modules known as shields.
6.8 Arduino Block Diagram
CHAPTER 7
ATmega328
24
ATmega328
7.1 Specifications
25
Parameter Value
Flash memory 32 Kb
SRAM 2 Kb
EEPROM 1 Kb
Maximum
operating 20 MHz
frequency
Number of
16
touch channels
Hardware
QTouch No
Acquisition
Maximum I/O
26
pins
External
24
interrupts
USB Interface No
USB Speed No 26
7.2 Series Alternatives
A common alternative to the ATmega328 is the "picoPower"
ATmega328P. A comprehensive list of all other member of the megaAVR
series can be found on the Atmel website.
7.3 Applications
As of 2013 the ATmega328 is commonly used in many projects and
autonomous systems where a simple, low-powered, low-cost micro-controller
is needed. Perhaps the most common implementation of this chip is on the
popular Arduino development platform, namely the Arduino Uno and Arduino
Nano models.
7.4 Programming
Reliability qualification shows that the projected data retention failure
rate is much less than 1 PPM over 20 years at 85 C or 100 years at 25 C.
Programming I/
Pin Name Function
signal O
27
busy.
Output
Enable
OE PD2 I
(Active
low)
Write
Pulse
WR PD3 I
(Active
low)
Byte
Select 1
BS1 PD4 I (0 = Low
byte, 1 =
High byte)
XTAL
XA0 PD5 I Action bit
0
XTAL
XA1 PD6 I Action bit
1
28
Load
29
Serial data to the MCU is clocked on the rising edge and data from the
MCU is clocked on the falling edge. Power is applied to V CC while RESET and
SCK are set to zero. Wait for at least 20 ms and then the Programming Enable
serial instruction 0xAC, 0x53, 0x00, 0x00 is sent to the MOSI pin. The second
byte (0x53) will be echoed back by the MCU
The table below gives a description for each of the pins, along with their
function.
30
Pin
Description Function
Number
1 PC6 Reset
8 GND Ground
22 GND Ground
31
As stated before, 20 of the pins function as I/O ports. This means they
can function as an input to the circuit or as output. Whether they are input or
output is set in the software. 14 of the pins are digital pins, of which 6 can
function to give PWM output. 6 of the pins are for analog input/output.
2 of the pins are for the crystal oscillator. This is to provide a clock
pulse for the Atmega chip. A clock pulse is needed for synchronization so that
communication can occur in synchrony between the Atmega chip and a device
that it is connected to.
The chip needs power so 2 of the pins, Vcc and GND, provide it power
so that it can operate. The Atmega328 is a low-power chip, so it only needs
between 1.8-5.5V of power to operate.
32
The last pin is the RESET pin. This allows a program to be rerun and start
over.
33
CHAPTER 8
Basic Components
8.1 Diode
In electronics, a diode is a component that restricts the direction of
movement of charge carriers. Essentially, it allows an electric current to flow in
one direction, but blocks it in the opposite direction. Today the most common
diodes are made from semiconductor materials such as silicon or germanium.
Diode
8.2 Semiconductor Diodes
Most modern diodes are based on semiconductor P-N junctions. In a P-
N diode, conventional current can flow from the P-type side (the anode) to the
N-type side (the cathode), but not in the opposite direction. A semiconductor
diode s current-voltage, or I-V, characteristic curve is ascribed to the behaviour
of the so-called depletion layer or depletion zone which exists at the P-N
junction between the differing semiconductors. When a P-N junction is first
created, conduction band (mobile) electrons from the N-doped region diffuse
into the P-doped region where there is a large population of holes (places for
electrons in which no electron is present) with which the electrons recombine.
When a mobile electron recombines with a hole, the hole vanishes and the
electron is no longer mobile. Thus, two charge carriers have vanished. The
region around the P-N junction becomes depleted of charge carriers and thus
behaves as an insulator.
Voltage Regulator
The 7805 provides circuit designers with an easy way to regulate DC
voltages to 5v. Encapsulated in a single chip/package (IC), the 7805 is a
positive voltage DC regulator that has only 3 terminals. They are: Input
voltage, Ground, Output Voltage. Although the 7805 were primarily designed
for a fixed-voltage output (5V). 7812 Voltage regulator
12V DC Voltage Regulator Data Sheet / Specs The 78012 provides circuit
designers with an easy way to regulate DC voltages to 12v. Encapsulated in a
single chip/package (IC), the 78012 is a positive voltage DC regulator that has
only 3 terminals. They are: Input voltage, Ground, Output Voltage. Although
the 78012 were primarily designed for a fixed-voltage output (12V). 7812
Voltage regulator It is indeed possible to use external components in order to
obtain DC output voltages of: 5V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 20V, 24V.
Note that the input voltage must, of course, be greater than the required output
voltage, so that it can be regulated downwards.
8.4 Capacitor
In the Regulated power supply the rating of the chosen capacitor filter
is 1000F.
A capacitor (originally known as condenser) is a passive two-terminal
electrical component used to store energy in an electric field. The forms of
practical capacitors vary widely, but all contain at least two electrical
conductors separated by a dielectric (insulator); for example, one common
construction consists of metal foils separated by a thin layer of insulating film.
Capacitors are widely used as parts of electrical circuits in many common
electrical devices.When there is a potential difference (voltage) across the
conductors, a static electric field develops across the dielectric, causing
positive charge to collect on one plate and negative charge on the other plate.
Energy is stored in the electrostatic field. An ideal capacitor is characterized by
a single constant value, capacitance, measured in farads. This is the ratio of the
electric charge on each conductor to the potential difference between them.
Capacitor
The capacitance is greatest when there is a narrow separation between
large areas of conductor, hence capacitor conductors are often called "plates,"
referring to an early means of construction. In practice, the dielectric between
the plates passes a small amount of leakage current and also has an electric
field strength limit, resulting in a breakdown voltage, while the conductors and
leads introduce an undesired inductance and resistance. Capacitors are widely
used in electronic circuits for blocking direct current while allowing alternating
current to pass, in filter networks, for smoothing the output of power supplies,
in the resonant circuits that tune radios to particular frequencies, in electric
power transmission systems for stabilizing voltage and power flow, and for
many other purposes.
8.5 Transistor
An NPN transistor can be considered as two diodes with a shared
anode. In typical operation, the base-emitter junction is forward biased and the
basecollector junction is reverse biased. In an NPN transistor, for example,
when a positive voltage is applied to the baseemitter junction, the equilibrium
between thermally generated carriers and the repelling electric field of the
depletion region becomes unbalanced, allowing thermally excited electrons to
inject into the base region. These electrons wander (or "diffuse") through the
base from the region of high concentration near the emitter towards the region
of low concentration near the collector. The electrons in the base are called
minority carriers because the base is doped p-type which would make holes the
majority carrier in the base.
Transistor
Transistors can be regarded as a type of switch, as can many electronic
components. They are used in a variety of circuits and you will find that it is
rare that a circuit built in a school Technology Department does not contain at
least one transistor. They are central to electronics and there are two main
types; NPN and PNP. Most circuits tend to use NPN. There are hundreds of
transistors which work at different voltages but all of them fall into these two
categories.
Transistors are manufactured in different shapes but they have three
leads (legs). The BASE - which is the lead responsible for activating the
transistor.The COLLECTOR - which is the positive lead.The EMITTER -
which is the negative lead. The diagram below shows the symbol of an NPN
transistor. They are not always set out as shown in the diagrams to the left and
right, although the tab on the type shown to the left is usually next to the
emitter.
8.6 Resistors
A resistor is a passive two-terminal electrical component that
implements electrical resistance as a circuit element. The current through a
resistor is in direct proportion to the voltage across the resistor's terminals.
Thus, the ratio of the voltage applied across a resistor's terminals to the
intensity of current through the circuit is called resistance. This relation is
represented by Ohm's law: where I is the current through the conductor in units
of amperes, V is the potential difference measured across the conductor in units
of volts, and R is the resistance of the conductor in units of ohms. More
specifically, Ohm's law states that the R in this relation is constant,
independent of the current. Resistors are common elements of electrical
networks and electronic circuits and are ubiquitous in electronic equipment.
Practical resistors can be made of various compounds and films, as well as
resistance wire (wire made of a high-resistivity alloy, such as nickel-chrome).
Resistors are also implemented within integrated circuits, particularly analog
devices, and can also be integrated into hybrid and printed circuits.
Resistor
The electrical functionality of a resistor is specified by its resistance:
common commercial resistors are manufactured over a range of more than nine
orders of magnitude. When specifying that resistance in an electronic design,
the required precision of the resistance may require attention to the
manufacturing tolerance of the chosen resistor, according to its specific
application. The temperature coefficient of the resistance may also be of
concern in some precision applications. Practical resistors are also specified as
having a maximum power rating which must exceed the anticipated power
dissipation of that resistor in a particular circuit: this is mainly of concern in
power electronics applications. Resistors with higher power ratings are
physically larger and may require heat sinks. In a high-voltage circuit, attention
must sometimes be paid to the rated maximum working voltage of the resistor
CHAPTER 9
SENSORS
9. BUZZER
9.1 what is Buzzer
A buzzer or beeper is an audio signaling device, which may be
mechanical, electromechanical or piezoelectric. Typical uses of buzzers and
beepers include alarm devices. These devices are output transducers converting
electrical energy. A Buzzer or Beeper is a signaling device, usually electronic,
typically used in automobiles, household appliances such as microwave ovens,
or game shows. It most commonly consists of a number of switches or sensors
connected to a control unit that determines if and which button was pushed or a
preset time has lapsed, and usually illuminates a light on the appropriate button
or control panel, and sounds a warning in the form of a continuous or
intermittent buzzing or beeping sound.
9.2 Operation
As power is applied this mechanical device will energize and by doing
so interrupt the power source and the cycle continue until the power is
removed. The frequency of oscillation is strictly dependent on mechanical
inertia. The piezo buzzer produces sound based on reverse of the piezoelectric
effect. The generation of pressure variation or strain by the application of
electric potential across a piezoelectric material is the underlying principle.
These buzzers can be used alert a user of an event corresponding to a switching
action, counter signal or sensor input. They are also used in alarm circuits. The
buzzer produces a same noisy sound irrespective of the voltage variation
applied to it. It consists of piezo crystals between two conductors. When a
potential is applied across these crystals, they push on one conductor and pull
on the other. This, push and pull action, results in a sound wave.
Most buzzers produce sound in the range of 2 to 4 kHz. The Red lead is
connected to the Input and the Black lead is connected to Ground. Initially this
device was based on an electromechanical system which was identical to an
electric bell without the metal gong (which makes the ringing noise). Often
these units were anchored to a wall or ceiling and used the ceiling or wall as a
sounding board. Another implementation with some AC-connected devices
was to implement a circuit to make the AC current into a noise loud enough to
drive a loudspeaker and hook this circuit up to an 8-ohm speaker.
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and
all that beamers will see), the external magnetic field is produced by high-
strength permanent magnets1. The stator is the stationary part of the motor --
this includes the motor casing, as well as two or more permanent magnet pole
pieces. The rotor (together with the axle and attached commutator) rotate with
respect to the stator. The rotor consists of windings (generally on a core), the
windings being electrically connected to the commutator. The above diagram
shows a common motor layout -- with the rotor inside the stator (field)
magnets. The geometry of the brushes, commutator contacts, and rotor
windings are such that when power is applied, the polarities of the energized
winding and the stator magnet(s) are misaligned, and the rotor will rotate until
it is almost aligned with the stator's field magnets. As the rotor reaches
alignment, the brushes move to the next commutator contacts, and energize the
next winding. Given our example two-pole motor, the rotation reverses the
direction of current through the rotor winding, leading to a "flip" of the rotor's
magnetic field, driving it to continue rotating.
In real life, though, DC motors will always have more than two poles
(three is a very common number). In particular, this avoids "dead spots" in the
commutator. You can imagine how with our example two-pole motor, if the
rotor is exactly at the middle of its rotation (perfectly aligned with the field
magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is
a moment where the commutator shorts out the power supply (i.e., both
brushes touch both commutator contacts simultaneously). This would be bad
for the power supply, waste energy, and damage motor components as well.
Yet another disadvantage of such a simple motor is that it would exhibit a high
amount of torque "ripple" (the amount of torque it could produce is cyclic with
the position of the rotor).
11.1 Features:
Calibrated directly in Celsius (Centigrade)
The LM35 can be applied easily in the same way as other integrated-
circuit temperature sensors. It can be glued or cemented to a surface and its
temperature will be within about 0.01C of the surface temperature. This
presumes that the ambient air temperature is almost thesame as the surface
temperature; if the air temperature were much higher or lower than the surface
temperature, the actual temperature of the LM35 die would be at an
intermediate temperature between the surface temperature and the air
temperature. This is expecially true for the TO-92 plastic package, where the
copper leads are the principal thermal path to carry heat into the device, so its
temperature might be closer to the air temperature than to the surface
temperature. To minimize this problem, be sure that the wiring to the LM35, as
it leaves the device, is held at the same temperature as the surface of interest.
The easiest way to do this is to cover up these wires with a bead of epoxy
which will insure that the leads and wires are all at the same temperature as the
surface, and that the LM35 dies temperature will not be affected by the air
temperature.
The TO-46 metal package can also be soldered to a metal surface
or pipe without damage. Of course, in that case the V terminal of the circuit
will be grounded to that metal. Alternatively, the LM35 can be mounted inside
a sealed-end metal tube, and can then be dipped into a bath or screwed into a
threaded hole in a tank. As with any IC, the LM35 and accompanying wiring
and circuits must be kept insulated and dry, to avoid leakage and corrosion.
This is especially true if the circuit may operate at cold temperatures where
condensation can occur. Printed-circuit coatings and varnishes such as
Humiseal and epoxy paints or dips are often used to insure that moisture
cannot corrode the LM35 or its connections. These devices are sometimes
soldered to a small light-weight heat fin, to decrease the thermal time constant
and speed up the response in slowly-moving air. On the other hand, a small
thermal mass may be added to the sensor, to give the steadiest reading despite
small deviations in the air temperature. Like most micro power circuits, the
LM35 has a limited ability to drive heavy capacitive loads. The LM35 by itself
is able to drive 50 pf without special precautions. If heavier loads are
anticipated, it is easy to isolate or decouple the load with aresistor;. Or you can
improve the tolerance of capacitance with a series R-C damper from output to
ground.
When the LM35 is applied with a 200W load resistor as it is relatively
immune to wiring capacitance because the capacitance forms a bypass from
ground to input, not on the output. However, as with any linear circuit
connected to wires in a hostile environment, its performance can be affected
adversely by intense electromagnetic sources such as relays, radio transmitters,
motors with arcing brushes, SCR transients, etc, as its wiring can act as a
receiving antenna and its internal junctions can act as rectifiers. For best results
in such cases, a bypass capacitor from VIN to ground and a series R-C damper
such as 75W in series with 0.2 or 1 F from output to ground are often useful.
LM 35 is measure the temperature in degree Celsius unlike LM 34
which measure the temperature in Fahrenheit.
12.1 I N T R O D U C T I O N
12.2 P I N C O N F I G U R AT I O N
1.VCC
2 .G
ND
3.D-OUT
12.3 F E AT U R E S
Operating voltage: 5V DC
Output pattern: digital pulse
Frequency Range: 0.5HZ ~ 20HZ
Low cost
12.4 A D VA N TA G E S
Since the output is of digital pattern it is easy to use
Immune to water and oil on the object surface
High stability, with few secular changes
12.5 A P P L I C AT I O N S
Measurements on Structures or Machinery Casings: Accelerometers
and Velocity Sensors
These sensors detect high frequency vibration signals related to bearing
supports, casing and foundation resonances, vibration in
turbine/compressor vanes, defective roller or ball bearings, noise in
gears, etc.
12.6 D E V I C E I M A G E
Vibration Sensor
12.7 Block Diagram for Vibration Sensor
13. MQ-06 Gas Sensor
13.1 FEATURES
* High sensitivity to LPG, iso-butane, propane
* Small sensitivity to alcohol, smoke.
* Fast response .
* Stable and long life
* Simple drive circuit
13.2 APPLICATIONS
13.3 SPECIFICATIONS
A. Standard Work Condition
MQ-06 Sensor
CHAPTER 10
Servo Motor
Tiny and lightweight with high output power. Servo can rotate approximately
180 degrees (90 in each direction), and works just like the standard kinds but
smaller. You can use any servo code, hardware or library to control these
servos. Good for beginners who want to make stuff move without building a
motor controller with feedback & gear box, especially since it will fit in small
places. It comes with a 3 horns (arms) and hardware.
14.1 Specifications
Weight: 9 g
Dimension: 22.2 x 11.8 x 31 mm approx.
Stall torque: 1.8 kgfcm
Operating speed: 0.1 s/60 degree
Operating voltage: 4.8 V (~5V)
Dead band width: 10 s
Temperature range: 0 C 55 C
Position "0" (1.5 ms pulse) is middle, "90" (~2 ms pulse) is all the way to the
left. "-90" (~1 ms pulse) is middle, "90" (~2 ms pulse) is all the way to the
right, " the left. ms pulse) is all the way to the right,
The servo motor has three leads. The color of the leads varies between
servo motors, but the red lead is always 5V and GND will either be black or
brown. The other lead is the control lead and this is usually orange or yellow.
This control lead is connected to digital pin 9.The servo is conveniently
terminated in a socket into which we can push jumper wires, to link it to the
breadboard and then to the Arduino.
15.1 INTRODUCTION
In this guide, I will explain how to use Arduino to change the settings
of the ubiquitous HC-05 Bluetooth module using the AT command set. The
HC-05 comes with a rich set of AT commands to perform various tasks such as
changing the module's default settings including changing the pass code, the
device name, and module's default settings including changing the pass code,
the device name, and the baud rate. But the process of switching the HC-05
into AT command mode for first time users of the module is not straight
forward and the docs takes short cuts. There are a couple of ways to do this. I
have picked the one I think is the easiest I will do my best to illustrate the
process in simple to follow steps. You can find the full set of AT commands in
the attached datasheet.
15.2 BACKGROUND
The HC-05 Bluetooth module and its siblings are by far the most
popular and in expensive Bluetooth modules used for RF communications by
microcontroller hackers. It costs less than $10 on ebay and it's easy to
implement. I have published two guides based on the HC-05 Bluetooth
module. The first guide explains how to use the HC-05 with the Arduino. The
second is an Android app that simplifies controlling Arduino from your smart
phone over Bluetooth using the HC-05. In both cases, the default settings for
the HC-05 were fine.
In the process of using the HC-05 for a project, I ran into a situation
where I needed to change the defaults for the module. For example, the default
baud rate on the HC-05 is 9600. That's slow for high-speed transmission. The
HC-05 can go as high as 1382400 baud rate according to the HC-05 reference.
Also, the HC-05 has a default device name of HC-05. Having two or more of
those devices in the same area can be confusing. You can use an AT command
to change the device name. Also, the pin code default is 1234. You may wish to
change that for some projects to ensure basic security.
After spending some time searching the web I realized many people are
having a hard time changing the default settings for the HC-05. Switching the
HC-05 from data transmission mode to configuration mode, to send AT
commands to the HC05, involves a few wiring and software acrobatics. Add to
the mix all the variations of the HC Bluetooth module family and the various
vendor settings and you get the picture.
15.3 WARNING
The HC-05 is a 3.3V system but the breakout board offers current
limiting resistors for some protection. While it's not advisable to keep the HC-
05 connected to the 5V Arduino Uno pins, for this short exercise I decided to
skip the voltage dividers which I use to drop 5V to 3.3V. I advise you to use
voltage dividers whenever you connect the HC-05 pins to 5V pins such as the
Arduino Uno. If you skip the voltage divider, do so at your own risk.
Step 1: Components & Wiring
I have tested this guide with the following:
PARTS
Arduino Uno R3
Arduino IDE
WIRING
This arduino program (hc_05.ino) does two things. it takes the at commands
you enter from the arduino ide serial monitor and sends those commands to the
hc-05. the program then reads the output of the hc-05 and displays it on the
arduino ide serial monitor. you can also use a terminal emulator such as tera
term instead of the arduino serial monitor. the arduino communicates with the
hc-05 using the software serial ports while the arduino communicates with the
user via the serial monitor.
/*
AUTHOR: HazimBitar(techbitar)
DATE:Aug29,2013
LICENSE: Publicdomain(use at your own risk)
*/
#include <SoftwareSerial.h>
void setup()
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
more
void loop()
if (BTSerial.available())
Serial.write(BTSerial.read());
// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.write(Serial.read());
3. Now connect the Arduino Uno to the USB cable extended from your
PC.
4. Make sure the HC-05 module is NOT PAIRED with any other
Bluetooth device.
5. Re-connect the Arduino Uno 5V wire to the HC-05's VCC (5V power)
pin.
6. The HC-05 LED will blink on and off at about 2 second intervals. Now
the HC-05 is in AT command mode ready to accept commands to change
configuration and settings.
You can send AT Commands to the HC-05 from the Arduino IDE Serial
Monitor while the Arduino is running the attached Arduino program.
I have listed a few popular AT commands that will change the HC-05 device
name, pass code, and speed. You will find a full set of AT commands from the
attached HC-05 reference PDF file.
To change device name from the default HC-05 to let's say MYBLUE
enter: "AT+NAME=MYBLUE"
To change HC-05 baud rate from default 9600 to 115200, 1 stop bit, 0
parity enter: "AT+UART=115200,1,0"