This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
The DC motor has two basic parts: the rotating part that is called the armature and the stationary part
that includes coils of wire called the field coils. The stationary part is also called the stator. Figure
shows a picture of a typical DC motor, Figure shows a picture of a DC armature, and Fig shows a
picture of a typical stator. From the picture you can see the armature is made of coils of wire wrapped
around the core, and the core has an extended shaft that rotates on bearings. You should also notice
that the ends of each coil of wire on the armature are terminated at one end of the armature. The
termination points are called the commutator, and this is where the brushes make electrical contact to
bring electrical current from the stationary part to the rotating part of the machine.
Operation:
The DC motor you will find in modem industrial applications operates very similarly to the
simple DC motor described earlier in this chapter. Figure 12-9 shows an electrical diagram of a simple
DC motor. Notice that the DC voltage is applied directly to the field winding and the brushes. The
armature and the field are both shown as a coil of wire. In later diagrams, a field resistor will be added
in series with the field to control the motor speed.
When voltage is applied to the motor, current begins to flow through the field coil from the negative
terminal to the positive terminal. This sets up a strong magnetic field in the field winding. Current
also begins to flow through the brushes into a commutator segment and then through an armature coil.
48
The current continues to flow through the coil back to the brush that is attached to other end of the
coil and returns to the DC power source. The current flowing in the armature coil sets up a strong
magnetic field in the armature.
Fig 3.20: Simple electrical diagram of DC motor
Fig 3.21: Operation of a DC Motor
The magnetic field in the armature and field coil causes the armature to begin to rotate.
This occurs by the unlike magnetic poles attracting each other and the like magnetic poles repelling
each other. As the armature begins to rotate, the commutator segments will also begin to move under
the brushes. As an individual commutator segment moves under the brush connected to positive
voltage, it will become positive, and when it moves under a brush connected to negative voltage it
will become negative. In this way, the commutator segments continually change polarity from
positive to negative. Since the commutator segments are connected to the ends of the wires that make
up the field winding in the armature, it causes the magnetic field in the armature to change polarity
continually from north pole to south pole. The commutator segments and brushes are aligned in such a
way that the switch in polarity of the armature coincides with the location of the armature's magnetic 49
field and the field winding's magnetic field. The switching action is timed so that the armature will not
lock up magnetically with the field. Instead the magnetic fields tend to build on each other and
provide additional torque to keep the motor shaft rotating.
When the voltage is de-energized to the motor, the magnetic fields in the armature and the
field winding will quickly diminish and the armature shaft's speed will begin to drop to zero. If
voltage is applied to the motor again, the magnetic fields will strengthen and the armature will begin
to rotate again.
Types of DC motors:
1. DC Shunt Motor,
2. DC Series Motor,
3. DC Long Shunt Motor (Compound)
4. DC Short Shunt Motor (Compound)
The rotational energy that you get from any motor is usually the battle between two magnetic fields
chasing each other. The DC motor has magnetic poles and an armature, to which DC electricity is fed,
The Magnetic Poles are electromagnets, and when they are energized, they produce a strong magnetic
field around them, and the armature which is given power with a commutator, constantly repels the
poles, and therefore rotates.
1. The DC Shunt Motor:
In a 2 pole DC Motor, the armature will have two separate sets of windings, connected to a
commutator at the end of the shaft that are in constant touch with carbon brushes. The brushes are
static, and the commutator rotate and as the portions of the commutator touching the respective
50
positive or negative polarity brush will energize the respective part of the armature with the respective
polarity. It is usually arranged in such a way that the armature and the poles are always repelling.
The general idea of a DC Motor is, the stronger the Field Current, the stronger the magnetic field, and
faster the rotation of the armature. When the armature revolves between the poles, the magnetic field
of the poles induce power in the armature conductors, and some electricity is generated in the
armature, which is called back emf, and it acts as a resistance for the armature. Generally an armature
has resistance of less than 1 Ohm, and powering it with heavy voltages of Direct Current could result
in immediate short circuits. This back emf helps us there.
When an armature is loaded on a DC Shunt Motor, the speed naturally reduces, and therefore the back
emf reduces, which allows more armatures current to flow. This results in more armature field, and
therefore it results in torque.
Fig: Diagram of DC shunt motor
When a DC Shunt Motor is overloaded, if the armature becomes too slow, the reduction of the back
emf could cause the motor to burn due to heavy current flow thru the armature.
The poles and armature are excited separately, and parallel, therefore it is called a Shunt Motor.
2. The DC Series Motor:
Fig: Diagram of DC series motor
51
A DC Series Motor has its field coil in series with the armature. Therefore any amount of power
drawn by the armature will be passed thru the field. As a result you cannot start a Series DC Motor
without any load attached to it. It will either run uncontrollably in full speed, or it will stop.
Fig: Diagram of DC series motor graph representation
When the load is increased then its efficiency increases with respect to the load applied. So these are
on Electric Trains and elevators.
Specifications
DC supply: 4 to 12V
RPM: 300 at 12V
Total length: 46mm
Motor diameter: 36mm
Motor length: 25mm
Brush type: Precious metal
Gear head diameter: 37mm
Gear head length: 21mm
52
Output shaft: Centred
Shaft diameter: 6mm
Shaft length: 22mm
Gear assembly: Spur
Motor weight: 105gms
We generally use 300RPM Centre Shaft Economy Series DC Motor which is high quality low cost
DC geared motor. It has steel gears and pinions to ensure longer life and better wear and tear
properties. The gears are fixed on hardened steel spindles polished to a mirror finish. The output shaft
rotates in a plastic bushing. The whole assembly is covered with a plastic ring. Gearbox is sealed and
lubricated with lithium grease and require no maintenance. The motor is screwed to the gear box from
inside.
Although motor gives 300 RPM at 12V but motor runs smoothly from 4V to 12V and gives wide
range of RPM, and torque. Tables below gives fairly good idea of the motor’s performance in terms of
RPM and no load current as a function of voltage and stall torque, stall current as a function of
voltage.
3. DC Compound Motor:
A compound of Series and Shunt excitation for the fields is done in a Compound DC Motor. This
gives the best of both series and shunt motors. Better torque as in a series motor, while the possibility
to start the motor with no load.
53
Fig: Diagram of DC compound motor
Above is the diagram of a long shunt motor, while in a short shunt, the shunt coil will be connected
after the serial coil.
A Compound motor can be run as a shunt motor without connecting the serial coil at all but not vice
versa.
DC Motor Driver:
54
The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to
provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is
designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both
devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping
motors, as well as other high-current/high-voltage loads in positive-supply applications.
All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a
Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1
and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN.When an enable input is high, the
associated drivers are enabled and their outputs are active and in phase with their inputs.
When the enable input is low, those drivers are disabled and their outputs are off and in the
high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge)
reversible drive suitable for solenoid or motor applications. On the L293, external high-speed output
clamp diodes should be used for inductive transient suppression. A VCC1 terminal, separate from
VCC2, is provided for the logic inputs to minimize device power dissipation. The L293and L293D are
characterized for operation from 0°C to 70°C.
Fig 3.22: L293D IC
Pin Diagram of L293D motor driver:
55
Fig 3.23: L293D pin diagram
Fig 3.24: Internal structure of L293D.
Features of L293D:
56
600mA Output current capability per channel
1.2A Peak output current (non repetitive) per channel
Enable facility
Over temperature protection
Logical “0”input voltage up to 1.5 v
High noise immunity
Internal clamp diodes
Applications of DC Motors:
1. Electric Train: A kind of DC motor called the DC Series Motor is used in Electric Trains. The DC
Series Motors have the property to deliver more power when they are loaded more. So the more the
people get on a train, the more powerful the train becomes.
2. Elevators: The best bidirectional motors are DC motors. They are used in elevators. Compound DC
Motors are used for this application.
3. PC Fans, CD ROM Drives, and Hard Drives: All these things need motors, very miniature motors,
with great precision. AC motors can never imagine any application in these places.
4. Starter Motors in Automobiles: An automobile battery supplies DC, so a DC motor is best suited
here. Also, you cannot start an engine with a small sized AC motor,
5. Electrical Machines Lab in Colleges.
3.7 Alcohol detector Sensor
3.7.1 Introduction:
Alcohol detector sensors need to be calibrated and periodically checked to ensure sensor
accuracy and system integrity. MQ303A is semiconductor sensor is for Alcohol detection. It has good
sensitivity and fast response to alcohol, suitable for portable alcohol detector.
57
You could get of MQ303A, it reflects change from voltage change on fixed or adjustable
relations between resistance and gas load resistance. Normally, it will take several concentration,
resistance of the sensor minutes preheating for sensor enter into stable reduce when gas concentration
increases working after electrified; or you could give 2.2±0.2V high voltage for 5-10secs before test,
which make sensor easily stable
3.7.2 Working procedure:
Indium Tin Oxide (ITO: In2O3 + 17% SnO2) thin films grown on alumina substrate at 648 K
temperatures using direct evaporation method with two gold pads deposited on the top for electrical
contacts were exposed to ethanol vapors (200–2500 ppm).
This sensor when exposed to alcohol the resistance varies this input is captured and given to
micro controller for further process.
It is important to install stationary sensors in locations where the calibration can be performed
easily. The intervals between calibrations can be different from sensor to sensor. Generally, the
manufacturer of the sensor will recommend a time interval between calibrations. However, it is good
general practice to check the sensor more closely during the first 30 days after installation. During this
period, it is possible to observe how well the sensor is adapting to its new environment. Also, factors
that were not accounted for in the design of the system might surface and can affect the sensor’s
performance. If the sensor functions properly for 30 continuous days, this provides a good degree of
confidence about the installation. Any possible problems can be identified and corrected during this
time. Experience indicates that a sensor surviving 30 days after the initial installation will have a good
chance of performing its function for the duration expected. Most problems—such as an inappropriate
sensor location, interference from other Alcohol detectors, or the loss of sensitivity—will surface
during this time.
58
Fig 3.7.2.Alcohol detector sensor
MQ303A is semiconductor sensor is for Alcohol detection, it has good sensitivity and fast response to
alcohol, suitable for portable alcohol detector.
Fig 3.5.3Configuration figure of Alcohol detector sensor
3.7.2 Description:
Sensing element of the semiconductor sensor is a micro-ball, heater and metal electrode are
inside, and the sensing element is installed in anti-explosion double 100 mesh metal case. During the
first 30 days, the sensor should be checked weekly. Afterward, a maintenance schedule, Hazardous
Alcohol detector Monitors including calibration intervals, should be established. Normally, a monthly
calibration is adequate to ensure the effectiveness and sensibility of each sensor; this monthly check
59
will also afford you the opportunity to maintain the system’s accuracy. The method and procedure for
calibrating the sensors should be established immediately. The calibration procedure should be
simple, straightforward, and easily executed by regular personnel. Calibration here is simply a safety
check, unlike laboratory analyzers that require a high degree of accuracy. For area air quality and
safety Alcohol detector monitors, the requirements need to be simple, repeatable, and economical.
The procedure should be consistent and traceable. The calibration will be performed in the field where
sensors are installed so it can occur in any type environment. Calibration of the Alcohol detector
sensor involves two steps. First the “zero” must be set and then the “span” must be calibrated. The sensing material in TGS Alcohol detector sensors is metal oxide, most typically SnO2. When a metal oxide
Crystal such as SnO2 is heated at a certain high temperature in air, oxygen is adsorbed on the crystal surface with a
negative charge. Then donor electrons in the crystal surface are transferred to the adsorbed oxygen, resulting in leaving
positive charges in a space charge layer. Thus, surface potential is formed to serve as a potential barrier against electron
flow.
Inside the sensor, electric current flows through the conjunction parts (grain boundary) of SnO2 micro crystals. At
grain boundaries, adsorbed oxygen forms a potential barrier which prevents carriers from moving freely. The electrical
resistance of the sensor is attributed to this potential barrier. In the presence of a deoxidizing Alcohol detector, the surface
density of the negatively charged oxygen decreases, so the barrier height in the grain boundary is reduced. The reduced
barrier height decreases sensor resistance.
Sensor resistance will drop very quickly when exposed to Alcohol detector, and when removed from Alcohol
detector its resistance will recover to its original value after a short time. The speed of response and reversibility will vary
according to the model of sensor and the Alcohol detector involved.
3.7.3 Following conditions must be prohibited
1.1 Exposed to organic silicon steam
Organic silicon steam cause sensors invalid, sensors must be avoid exposing to silicon bond, fixature,
silicon latex, putty or plastic contain silicon environment
1.2 High Corrosive gas
If the sensors exposed to high concentration corrosive gas (such as H2Sz, SOX,Cl2,HCl etc), it
will not only result in corrosion of sensors structure, also it cause sincere sensitivity attenuation.
1.3 Alkali, Alkali metals salt, halogen pollution
The sensors performance will be changed badly if sensors be sprayed polluted by alkali metals salt
especially brine, or be exposed to halogen such as fluorin.
1.4 Touch water
Sensitivity of the sensors will be reduced when spattered or dipped in water.60
1.5 Freezing
Do avoid icing on sensor’ surface, otherwise sensor would lose sensitivity.
1.6 Applied voltage higher
Applied voltage on sensor should not be higher than stipulated value, otherwise it cause down-line or
heater damaged, and bring on sensors’ sensitivity characteristic changed badly.
1.7 Voltage on wrong pins
For 6 pins sensor, if apply voltage on 1、3 pins or 4、6 pins, it will make lead broken, and without
signal when apply on 2、4 pins
3.7.4 Following conditions must be avoided
2.1 Water Condensation
Indoor conditions, slight water condensation will effect sensors performance lightly. However, if
water condensation on sensors surface and keep a certain period, sensor’ sensitivity will be decreased.
2.2 Used in high gas concentration
No matter the sensor is electrified or not, if long time placed in high gas concentration, if will affect
sensors characteristic.
2.3 Long time storage
The sensors resistance produce reversible drift if it’s stored for long time without electrify, this drift is
related with storage conditions. Sensors should be stored in airproof without silicon gel bag with clean
air. For the sensors with long time storage but no electrify, they need long aging time for stability
before using.
2.4 Long time exposed to adverse environment
No matter the sensors electrified or not, if exposed to adverse environment for long time, such as high
humidity, high temperature, or high pollution etc, it will effect the sensors performance badly.
2.5 Vibration
Continual vibration will result in sensors down-lead response then repture. In transportation or
assembling line, pneumatic screwdriver/ultrasonic welding machine can lead this vibration.
2.6 Concussion
If sensors meet strong concussion, it may lead its lead wire disconnected.
2.7 Usage
For sensor, handmade welding is optimal way. If use wave crest welding should meet the conditions:
2.7.1 Soldering flux: Rosin soldering flux contains least chlorine
61
2.7.2 Speed: 1-2 Meter/ Minute
2.7.3 Warm-up temperature:100±20℃
2.7.4 Welding temperature:250±10℃
2.7.5 1 time pass wave crest welding machine
If disobey the above using terms, sensors sensitivity will be reduced.
3.7.5 Advantages:
* High sensitivity
* Fast response and resume
* Long life and low cost
* Mini Size
3.10
APR33A3 VOICE MODULE
Introduction
Today's consumers demand the best in audio/voice. They want crystal-clear sound wherever
they are in whatever format they want to use. APLUS delivers the technology to enhance a listener's
audio/voice experience.
The aPR33A series are powerful audio processor along with high performance audio analog-to-
digital converters (ADCs) and digital-to-analog converters (DACs). The aPR33A series are a fully
integrated solution offering high performance and unparalleled integration with analog input, digital
processing and analog output functionality.
The aPR33A series incorporates all the functionality required to perform demanding audio/voice
applications. High quality audio/voice systems with lower bill-of-material costs can be implemented
with the aPR33A series because of its integrated analog data converters and full suite of quality-
enhancing features such as sample-rate converter.
The aPR33A series C1.0 is specially designed for simple CPU interface, user can record or
playback up to 1024 voices by 5 I/O s only. This mode built in one complete memory-management
62
system.
The control side doesn't need to be burdened complicated memory distribution problems and it only
needs to be through a simple instruction to proceed the audio/voice recording & playback so it largely
shorten the developing time.
Meanwhile, Chip provides the power-management system too. Users can let the chip enter power-
down mode when unused. It can effectively reduce electric current consuming to 15uA and increase the
using time in any projects powered by batteries.
The aPR33A series are powerful audio processor along with high performance audio analog-to-
digital converters (ADCs) and digital-to-analog converters (DACs). The aPR33A series are a fully
integrated solution offering high performance and unparalleled integration with analog input, digital
processing and analog output functionality. The aPR33A series incorporates all the Functionality
required performing demanding audio/voice applications. High quality audio/voice systems with
lower bill-of-material costs can be implemented with the aPR33A series because of its integrated
analog data converters and full suite of quality-enhancing features such as sample-rate converter.
The aPR33A series C2.0 is specially designed for simple key trigger, user can record and playback
the message averagely for 1, 2, 4 or 8 voice message(s) by switch, It is suitable in simple interface or
need to limit the length of single message, e.g. toys, leave messages system, answering machine etc.
Meanwhile, this mode provides the power-management system. Users can let the chip enter power-
down mode when unused. It can effectively reduce electric current consuming to 15uA and increase
the using time in any projects powered by batteries.
PIN CONFIGURATION
63
PIN DESCRIPTION
Pin Names TYPE Description
VDDP
VDD
VDDA
Positive power supply.
64
VDDL
VSSP
VSSL
VSSA
Power ground.
VLDO Internal LDO output.
VCORE Positive power supply for core.
VREF Reference voltage.
VCM Common mode voltage.
Rosc INPUT Oscillator resistor input.
RSTB INPUT Reset. (Low active)
SRSTB INPUT System reset, pull-down a resistor to the VSSL.
MIC+
MIC-
INPUT Microphone differential input.
65
MICG OUTPUT Microphone ground.
VOUT2
VOUT1
OUTPUT PWM output to drive speaker directly.
/REC INPUT Record Mode. (Low active)
M0 INPUT Message-0.
M1 INPUT Message-1.
M2 INPUT Message-2.
M3 INPUT Message-3
M4 INPUT Message-4
M5 INPUT Message-5
M6 / MSEL0 INPUT Message-6, Message select 0.
M7 / MSEL1 INPUT Message-7, Message select 1.
66
CONNECTION DIAGRAM
SERIAL COMMAND
67
The aPR33A1/ aPR33A2/ aPR33A series C1.0 is specially designed for simple CPU interface. Chip
is controlled by command sent to it from the host CPU. The /CS pin is used to select chip. The SCK and
SDI pin are used to input command word into the chip while SDO and BUSY as output from the chip to
the host CPU for feedback response.
Command input into the chip contains 16-bit data and lists the command format & summarizes the
Available commands as below:
REC
The REC command is used to start record the voice to the specified voice number. In the
REC command, the bit-15 ~ bit-10 is 001000 in binary, and the bit-9 ~ bit-0 is the voice number in
binary. Up to 1024 voice numbers user can specify.
After the REC command sent, the /BUSY pin will be drove low and playback “beep” tone
to indicate the record operation starting. During the record operating, the /BUSY pin will keep
driving low, and any command except STOP will be ignored. The record operation will continue
until users send STOP command or full of memory, the /BUSY pin will be released and playback
"beep" tone 2 times to indicate the record operation finished.
If the specified voice number already exist voice data or the memory is full, the /BUSY pin will not
drive to low and execute REC operating. User can use the DELETE command to clear specified voice
number before REC command.
68
PLAY
The PLAY command is used to start playback the voice in the specified voice number. In the
PLAY command, the bit-15 ~ bit-10 is 001100 in binary, and the bit-9 ~ bit-0 is the voice number in
binary. Up to 1024 voice numbers user can specify.
After the PLAY command sent, the /BUSY pin will be drove low to indicate the playback
operation starting.
During the playback operating, the /BUSY pin will keep drive low, and any command except
STOP will be ignored.
The playback operation will continue until users send STOP command or end of voice, the
/BUSY pin will be released to indicate the record operation finished. If the specified voice number is
empty, it will not drive /BUSY to low and playback. The STOP command is used to stop current
operation.
After the STOP command sent, the /BUSY pin will be released to indicate end of the current
operation. The STOP command is effective only in playing or vb recording.
DELETE
69
The DELETE command is used to delete the voice in the specified voice number.
In the DELETE command, the bit-15 ~ bit-10 is 000100 in binary, and the bit-9 ~ bit-0 is the voice
number in binary. Up to 1024 voice numbers user can specify.
After the DELETE command sent, the /BUSY pin will be drove low to indicate the delete
operation starting. When delete operation is finished, the /BUSY pin will be released. The memory
space in the specified voice number will be release after delete operation, user can get more free space
by delete unused voice.
PDN
The PDN command is used to enter the power-down mode.
After the PDN command sent, the /BUSY pin will be drove low to indicate the power-down
Operation starting. When chip is in the power-down mode, the /BUSY pin will be released. During chip
in the sleep mode, the current consumption is reduced to IPDN and any command except PUP will be
ignored.
PUP
The PUP command is used to power up from sleep mode
70
After the PUP command sent, the /BUSY pin will be drove low to indicate the power up
operation starting. When chip is in the idle mode, the /BUSY pin will be released. User can execute
REC, PLAY or DELETE, or other command in idle mode.
FORMAT
The FORMAT command is used to restore memory to factory state. After the FORMAT command
sent, the /BUSY pin will be drove low to indicate the format operation starting. When format
operation is finished, the /BUSY pin will be released. All of the voice in the memory will be clear
after execute format operation
VOICE INPUT
The aPR33A series supported single channel voice input by microphone or line-in. The following fig.
showed circuit for different input methods: microphone, line-in and mixture of both.
71
RESET
APR33A series can enter standby mode when RSTB pin drive to low. During chip in the
standby mode, the current consumption is reduced to ISB and any operation will be stopped, user
also can not execute any new operate in this mode. The standby mode will continue until RSTB pin
goes to high, chip will be started to initial, and playback "beep" tone to indicate enter idele mode.
User can get less current consumption by control RSTB pin especially in some application
which concern standby current.
MESSAGE MODE
In fixed 1/ 2/ 4/ 8 message mode (C2.0), user can divide the memory averagely for 1, 2, 4 or 8
message(s). The message mode will be applied after chip reset by the MSEL0 and MSEL1 pin. Please
72
note the message should be recorded and played in same message mode, we CAN NOT guarantee the
message is complete after message mode changed. For example, user recorded 8 messages in the 8-
message mode, those messages can be played in 8-message mode only. If user changed to 1, 2 or 4
message mode, system will discard those messages.
8-Message Mode
The memory will be divided to 8 messages averagely when both MSEL0 and MSEL1 pin float after
chip reset.
4-Message Mode
The memory will be divided to 4 messages averagely when MSEL0 pin connected to VSS and
MSEL1 pin float after chip reset.
73
2-Message Mode
The memory will be divided to 2 messages averagely when MSEL1 pin connected to VSS and
MSEL0 pin float after chip reset.
1-Message Mode
74
The memory will be for 1 message when both MSEL0 and MSEL1 pin connected to VSS after chip
reset.
RECORD MESSAGE
During the /REC pin drove to VIL, chip in the record mode.
When the message pin (M0, M1, M2 … M7) drove to VIL in record mode, the chip will
playback “beep” tone and message record starting.
The message record will continue until message pin released or full of this message, and the
chip will playback “beep” tone 2 times to indicate the message record finished.
If the message already exist and user record again, the old one’s message will be replaced.
The following fig. showed a typical record circuit for 8-message mode. We connected a slide-
switch between /REC pin and VSS, and connected 8 tact-switches between M0 ~ M7 pin and
VSS. When the slide-switch fixed in VSS side and any tact-switch will be pressed, chip will
start message record and until the user releases the tact-switch.
Note: After reset, /REC and M0 to M7 pin will be pull-up to VDD by internal resistor.
75
PLAYBACK MESSAGE
During the /REC pin drove to VIH, chip in the playback mode.
When the message pin (M0, M1, M2 … M7) drove from VIH to VIL in playback mode, the
message playback starting.
The message playback will continue until message pin drove from VIH to VIL again or end of
this message.
The following fig. showed a typical playback circuit for 8-message mode. We connected a
slide-switch between /REC and VSS, and connected 8 tact-switches between M0 ~ M7 and
VSS.
When the slide-switch fixed in float side and any tact-switch will be pressed, chip will start
message playback and until the user pressed the tact-switch again or end of message.
Note: After reset, /REC and M0 to M7 pin will be pull-up to VDD by internal resistor.
FEATURES:
Single Chip, High Quality Audio/Voice Recording & Playback Solution
No External ICs Required
Minimum External Components
User Friendly, Easy to Use Operation
Programming & Development Systems Not Required
170/ 340/ 680 sec. Voice Recording Length in aPR33A1/aPR33A2/aPR33A3
76
Powerful 16-Bits Digital Audio Processor.
Nonvolatile Flash Memory Technology
No Battery Backup Required
External Reset pin.
Powerful Power Management Unit
Very Low Standby Current: 1uA
Low Power-Down Current: 15uA
Supports Power-Down Mode for Power Saving
Built-in Audio-Recording Microphone Amplifier
No External OPAMP or BJT Required
Easy to PCB layout
Configurable analog interface
Differential-ended MIC pre-amp for Low Noise
High Quality Line Receiver
High Quality Analog to Digital and PWM module
Resolution up to 16-bits
Up To Maximum 1024 Voice Sections controlled through 5 pins only
Built-in Memory-Management System
3.12 3.7 Buzzer
Basically, the sound source of a piezoelectric sound component is a piezoelectric diaphragm.
A piezoelectric diaphragm consists of a piezoelectric ceramic plate which has electrodes on both sides
and a metal plate (brass or stainless steel, etc.). A piezoelectric ceramic plate is attached to a metal
plate with adhesives. Applying D.C. voltage between electrodes of a piezoelectric diaphragm causes
mechanical distortion due to the piezoelectric effect. For a misshaped piezoelectric element, the
distortion of the piezoelectric element expands in a radial direction. And the piezoelectric diaphragm
bends toward the direction. The metal plate bonded to the piezoelectric element does not expand.
Conversely, when the piezoelectric element shrinks, the piezoelectric diaphragm bends in the
direction Thus, when AC voltage is applied across electrodes, the bending is repeated, producing
sound waves in the air.
77
To interface a buzzer the standard transistor interfacing circuit is used. Note that if a different
power supply is used for the buzzer, the 0V rails of each power supply must be connected to provide a
common reference.
If a battery is used as the power supply, it is worth remembering that piezo sounders
draw much less current than buzzers. Buzzers also just have one ‘tone’, whereas a
piezo sounder is able to create sounds of many different tones.
To switch on buzzer -high 1
To switch off buzzer -low 1
Notice (Handling) In Using Self Drive Method
1) When the piezoelectric buzzer is set to produce intermittent sounds, sound may be heard
continuously even when the self drive circuit is turned ON / OFF at the "X" point shown in Fig. 9.
This is because of the failure of turning off the feedback voltage.
2) Build a circuit of the piezoelectric sounder exactly as per the recommended circuit shown in the
catalog. Hfe of the transistor and circuit constants are designed to ensure stable oscillation of the
piezoelectric sounder.
3) Design switching which ensures direct power switching.
4) The self drive circuit is already contained in the piezoelectric buzzer. So there is no need to prepare
another circuit to drive the piezoelectric buzzer.
5) Rated voltage (3.0 to 20Vdc) must be maintained. Products which can operate with voltage higher
than 20Vdc are also available.
6) Do not place resistors in series with the power source, as this may cause abnormal oscillation. If a
resistor is essential to adjust sound pressure, place a capacitor (about 1μF) in parallel with the piezo
buzzer.
7) Do not close the sound emitting hole on the front side of casing.
78
8) Carefully install the piezo buzzer so that no obstacle is placed within 15mm from the sound release
hole on the front side of the casing.
Fig: Picture of buzzer
79
CHAPTER 4: SOFTWARE DESCRIPTION
This project is implemented using following software’s:
Express PCB – for designing circuit
PIC C compiler - for compilation part
Proteus 7 (Embedded C) – for simulation part
4.1 Express PCB:
Breadboards are great for prototyping equipment as it allows great flexibility to modify
a design when needed; however the final product of a project, ideally should have a neat PCB, few
cables, and survive a shake test. Not only is a proper PCB neater but it is also more durable as there
are no cables which can yank loose.
Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy to use, but it
does have several limitations.
It can be likened to more of a toy then a professional CAD program.
It has a poor part library (which we can work around)
It cannot import or export files in different formats
It cannot be used to make prepare boards for DIY production
Express PCB has been used to design many PCBs (some layered and with surface-mount
parts. Print out PCB patterns and use the toner transfer method with an Etch Resistant Pen to make
boards. However, Express PCB does not have a nice print layout. Here is the procedure to design in
Express PCB and clean up the patterns so they print nicely.
4.1.1 Preparing Express PCB for First Use:
Express PCB comes with a less then exciting list of parts. So before any project is started
head over to Audio logic and grab the additional parts by morsel, ppl, and tangent, and extract them
into your Express PCB directory. At this point start the program and get ready to setup the workspace
to suit your style.
80
Click View -> Options. In this menu, setup the units for “mm” or “in” depending on how
you think, and click “see through the top copper layer” at the bottom. The standard color scheme of
red and green is generally used but it is not as pleasing as red and blue.
4.1.2 The Interface:
When a project is first started you will be greeted with a yellow outline. This yellow outline
is the dimension of the PCB. Typically after positioning of parts and traces, move them to their final
position and then crop the PCB to the correct size. However, in designing a board with a certain size
constraint, crop the PCB to the correct size before starting.
Fig: 4.1 show the toolbar in which the each button has the following functions:
Fig 4.1: Tool bar necessary for the interface
The select tool: It is fairly obvious what this does. It allows you to move and manipulate
parts. When this tool is selected the top toolbar will show buttons to move traces to the top /
bottom copper layer, and rotate buttons.
The zoom to selection tool: does just that.
The place pad: button allows you to place small soldier pads which are useful for board
connections or if a part is not in the part library but the part dimensions are available. When
this tool is selected the top toolbar will give you a large selection of round holes, square holes
and surface mount pads.
The place component: tool allows you to select a component from the top toolbar and then by
clicking in the workspace places that component in the orientation chosen using the buttons
next to the component list. The components can always be rotated afterwards with the select
tool if the orientation is wrong.
The place trace: tool allows you to place a solid trace on the board of varying thicknesses. The
top toolbar allows you to select the top or bottom layer to place the trace on.
81
The Insert Corner in trace: button does exactly what it says. When this tool is selected,
clicking on a trace will insert a corner which can be moved to route around components and
other traces.
The remove a trace button is not very important since the delete key will achieve the same
result.
4.1.3 Design Considerations:
Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.
Single sided, or double sided?
When making a PCB you have the option of making a single sided board, or a double
sided board. Single sided boards are cheaper to produce and easier to etch, but much harder to
design for large projects. If a lot of parts are being used in a small space it may be difficult to make
a single sided board without jumper over traces with a cable. While there’s technically nothing
wrong with this, it should be avoided if the signal travelling over the traces is sensitive (e.g. audio
signals).
A double sided board is more expensive to produce professionally, more difficult to
etch on a DIY board, but makes the layout of components a lot smaller and easier. It should be
noted that if a trace is running on the top layer, check with the components to make sure you can get
to its pins with a soldering iron. Large capacitors, relays, and similar parts which don’t have axial
leads can NOT have traces on top unless boards are plated professionally.
Ground-plane or other special purposes for one side
When using a double sided board you must consider which traces should be on what
side of the board. Generally, put power traces on the top of the board, jumping only to the bottom if
a part cannot be soldiered onto the top plane (like a relay), and vice- versa.
Some projects like power supplies or amps can benefit from having a solid plane to use
for ground. In power supplies this can reduce noise, and in amps it minimizes the distance between
parts and their ground connections, and keeps the ground signal as simple as possible. However, 82
care must be taken with stubborn chips such as the TPA6120 amplifier from TI. The TPA6120
datasheet specifies not to run a ground plane under the pins or signal traces of this chip as the
capacitance generated could effect performance negatively.
4.2 PIC Compiler:
PIC compiler is software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which is to be
dumped into the microcontroller for further processing. PIC compiler also supports C language code.
It’s important that you know C language for microcontroller which is commonly
known as Embedded C. As we are going to use PIC Compiler, hence we also call it PIC C. The PCB,
PCM, and PCH are separate compilers. PCB is for 12-bit opcodes, PCM is for 14-bitopcodes, and
PCH is for 16-bit opcode PIC microcontrollers. Due to many similarities, all three compilers are
covered in this reference manual. Features and limitations that apply to only specific microcontrollers
are indicated within. These compilers are specifically designed to meet the unique needs of the PIC
microcontroller. This allows developers to quickly design applications software in a more readable,
high-level language. When compared to a more traditional C compiler, PCB, PCM, and PCH have
some limitations. As an example of the limitations, function recursion is not allowed.
This is due to the fact that the PIC has no stack to push variables onto, and also
because of the way the compilers optimize the code. The compilers can efficiently implement normal
C constructs, input/output operations, and bit twiddling operations. All normal C data types are
supported along with pointers to constant arrays, fixed point decimal, and arrays of bits.
PIC C is not much different from a normal C program. If you know assembly, writing
a C program is not a crisis. In PIC, we will have a main function, in which all your application
specific work will be defined. In case of embedded C, you do not have any operating system running
in there. So you have to make sure that your program or main file should never exit. This can be done
with the help of simple while (1) or for (;;) loop as they are going to run infinitely.
We have to add header file for controller you are using, otherwise you will not be able
to access registers related to peripherals.
#include <16F72.h> // header file for PIC 16F72//
83
4.3 Proteus:
Proteus is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proteus.
Proteus is a programmer which itself contains a microcontroller in it other than the one which is to be
programmed. This microcontroller has a program in it written in such a way that it accepts the hex file
from the pic compiler and dumps this hex file into the microcontroller which is to be programmed. As
the Proteus programmer requires power supply to be operated, this power supply is given from the
power supply circuit designed and connected to the microcontroller in proteus. The program which is
to be dumped in to the microcontroller is edited in proteus and is compiled and executed to check any
errors and hence after the successful compilation of the program the program is dumped in to the
microcontroller using a dumper.
4.4 Procedural steps for compilation, simulation and dumping:
4.4.1 Compilation and simulation steps:
For PIC microcontroller, PIC C compiler is used for compilation. The compilation
steps are as follows:
Open PIC C compiler.
You will be prompted to choose a name for the new project, so create a separate folder where
all the files of your project will be stored, choose a name and click save.
84
Fig 4.1: Picture of opening a new file using PIC C compiler
Click Project, New, and something the box named 'Text1' is where your code should be
written later.
Now you have to click 'File, Save as' and choose a file name for your source code ending with
the letter '.c'. You can name as 'project.c' for example and click save. Then you have to add
this file to your project work.
85
Fig 4.2: Picture of compiling a new file using PIC C compiler
Fig 4.3: Picture of compiling a project.c file using PIC C compiler
86
You can then start to write the source code in the window titled 'project.c' then before testing
your source code; you have to compile your source code, and correct eventual syntax errors.
Fig 4.4: Picture of checking errors and warnings using PIC C compiler
By clicking on compile option .hex file is generated automatically.
This is how we compile a program for checking errors and hence the compiled program is
saved in the file where we initiated the program.
87
Fig 4.5: Picture of .hex file existing using PIC C compiler
After compilation, next step is simulation. Here first circuit is designed in Express PCB
using Proteus 7 software and then simulation takes place followed by dumping. The simulation steps
are as follows:
Open Proteus 7 and click on IS1S6.
Now it displays PCB where circuit is designed using microcontroller. To design circuit
components are required. So click on component option.
10. Now click on letter ’p’, then under that select PIC16F877A ,other components related to the
project and click OK. The PIC 16F72 will be called your “'Target device”, which is the final
destination of your source code.
4.4.2 Dumping steps:88
The steps involved in dumping the program edited in proteus 7 to microcontroller are
shown below:
1. Initially before connecting the program dumper to the microcontroller kit the window is
appeared as shown below.
Fig 4.6: Picture of program dumper window
2. Select Tools option and click on Check Communication for establishing a connection as shown
in below window
89
Fig 4.7: Picture of checking communications before dumping program into microcontroller
3. After connecting the dumper properly to the microcontroller kit the window is appeared as shown
below.
90
Fig 4.8: Picture after connecting the dumper to microcontroller
4. Again by selecting the Tools option and clicking on Check Communication the microcontroller
gets recognized by the dumper and hence the window is as shown below.
91
Fig 4.9: Picture of dumper recognition to microcontroller
5. Import the program which is ‘.hex’ file from the saved location by selecting File option and
clicking on ‘Import Hex’ as shown in below window.
92
Fig 4.10: Picture of program importing into the microcontroller
6. After clicking on ‘Import Hex’ option we need to browse the location of our program and click the
‘prog.hex’ and click on ‘open’ for dumping the program into the microcontroller.
93
Fig 4.11: Picture of program browsing which is to be dumped
7. After the successful dumping of program the window is as shown below.
94
Fig 4.12: Picture after program dumped into the microcontroller
95
CHAPTER 5: PROJECT DESCRIPTION
In this chapter, schematic diagram and interfacing of PIC16F877A microcontroller with each
module is considered.
Fig 5.1: schematic diagram of Alcohol and eye blink detection and automatic control system
with voice alerts
The above schematic diagram of Alcohol and eye blink detection and automatic control
system with voice alerts explains the interfacing section of each component with micro controller
and RF. Crystal oscillator connected to 13th and 14th pins of micro controller and regulated power
supply is also connected to micro controller and LED’s also connected to micro controller through
resistors.
The detailed explanation of each module interfacing with microcontroller is as follows: 96
5.2 Interfacing crystal oscillator and reset button with micro controller:
Fig 5.2: explains crystal oscillator and reset button which are connected to micro controller.
The two pins of oscillator are connected to the 13th and 14th pins of micro controller; the purpose of
external crystal oscillator is to speed up the execution part of instructions per cycle and here the
crystal oscillator having 20 MHz frequency. The 1st pin of the microcontroller is referred as MCLR
ie.., master clear pin or reset input pin is connected to reset button or power-on-reset.
Fig 5.2: crystal oscillator and reset input interfacing with micro controller
97
CHAPTER 6: ADVANTAGES AND DISADVANTAGES
Advantages:
1. High sensitivity alcohol sensor
2. Usage of eye blink sensor for drowsiness detection
3. Voice alerts through APR voice module.
4. Automatic speed control of vehicle to avoid accidents
5. Fast response
6. Wide detection range
7. Stable performance and long life
8. Simple drive circuit
9. Efficient and low cost design.
10. Low power consumption.
11. Easily operable.
Disadvantages:
1. This system supports only inside the vehicle.
2. Interfacing of eye blink sensor with microcontroller is highly sensitive
Applications:
This system can be implemented in vehicles in real time to avoid accidents
98
CHAPTER 7: RESULTS
7.1 Result:
The project “Alcohol and Eye blink Detection and Automatic Vehicle (DC Motor)
Control System with voice alerts” was designed such that to avoid accidents for drunken people and
drowsy people and alerts the through voice alerts.
7.2 Conclusion:
Integrating features of all the hardware components used have been developed in it.
Presence of every module has been reasoned out and placed carefully, thus contributing to the best
working of the unit. Secondly, using highly advanced IC’s with the help of growing technology, the
project has been successfully implemented. Thus the project has been successfully designed and
tested.
1.3 Future Scope:
Our project “Alcohol and Eye blink Detection and Automatic Vehicle (DC Motor)
Control System with voice alerts” is mainly intended to control the vehicle (DC motor) using when
on alcohol detection and drowsiness of driver was detected.
The project uses “Alcohol detector” itself indicates that whenever there is any alcoholic
content has been detected using alcoholic sensor MQ-03 so that it will indicate through the buzzer.
The system uses eye blink sensor and reduces the vehicle speed and alerts through buzzer alarm
system. In this project we are using the alcoholic sensor, eye blink sensor that finds the alcoholic
content and fed as input to the microcontroller. This project is designed around a microcontroller
which forms the control unit of the project.
This project makes use of a micro controller, which is programmed, with the help of
embedded C instructions. This Microcontroller is capable of communicating with input and output
99
modules. The Eye blink sensor, Alcohol Sensor provides the information to the Microcontroller (on
board computer). The controller is interfaced with Buzzer, and voice module, and DC Motor.
The main drawback of this system is that the vehicle speed can be controlled but not intimated
to the people related to the person about the status. The project can be extended by using GSM
modem which can send the SMS alerts o the concerned people when the driver was detected alcoholic
and sleepy while driving the vehicle.
REFERENCES
The sites which were used while doing this project:
1. www.wikipedia.com
2. www.allaboutcircuits.com
3. www.microchip.com
4. www.howstuffworks.com
Books referred:
1. Raj kamal –Microcontrollers Architecture, Programming, Interfacing and System Design.