Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
3 DC Motor
4 LCD 16*2
5 Power Supply
7 Proximity sensor
9 Conclusion
Bibliography
Tachometer
Contents
1 History
2 Advantages
3 Applications
1. History
3. Applications
INTRODUCTION
In this project we are measuring the dc motor speed. Because in some
process industries there is a limitation to the motor speed suppose it exceeds
specified limit then it will affect whole process from this project we can over come
this problem
DESCRIPTION
This project “DC MOTOR SPEED MEASUREMENT” is a system used for
measuring of DC MOTOR speed using opto coupler.
BLOCK DIAGRAM
SOFTWARES USED
1. Embedded C
2. Keil Compiler
3. Flash Magic
2.5 DRIVER CIRCUITS
Here the driver circuits are used to control the operations of firing unit, laser
unit & audio reception unit present on the robotic module. Here three types of
driver circuits are used they are ground driver, laser driver and motor driver circuit.
A liquid crystal display consists of an array of tiny segments (called pixels) that
can be manipulated to present information. Liquid crystals do not emit light
directly instead they use light modulating techniques.
LCDs are preferred to cathode ray tube (CRT) displays in most applications
because
It has a Panel with 2 rows and 16 column and with blocks as shown below with
5x8 pixel-selection pattern .
Operating Voltage
Pin Details
Timing Diagram
Write Mode
Read Mode
10K VR1
3 1 +5V
U1
2
VSS
VDD
V0
ALCD_RS RS
ALCD_R/W R/W
ALCD_E E
DB0 DB0
DB1 DB1
DB2 DB2
DB3 DB3
DB4 DB4
DB5 DB5
DB6 DB6
DB7 DB7
LED A
LED K
16x2 ALPHA LCD
Make sure that 5V and GND lines are properly connected otherwise you may
end up in damaging parallel port.
If you want backlight than connect pin 15 of LCD to 5V and pin 16 of LCD to
GND. By adjusting 10k resistor make pin 3 of LCD at 0V. If connections are
proper you will see this after power on.
Flow Chart Connect VDD, VSS, LEDA,LEDK Pins for
Power and Contrast Adjustments
LCD initialization
From a 12V Adaptor, input is taken into the power supply unit via
a DC Socket.
+12V
LED1
1 R1 2 1 2
1K
LED
1
3 VIN VOUT
1
3 PIN DC SOCKET
1
BRIDGE C4 + C2
2
C3 + 10uF/63V
470uF/35V 0.1uF
3
2
2
The capacitor C3 is used to filter the Bridge Rectifier o/p
IR Transmitting LED
Common infrared LED that emits infrared rays has the same
appearance with visible light LED. Its appropriate operating
voltage is around 1.4V and the current is generally smaller than
20mA. Current limiting resistances are usually connected in series
in the infrared LED circuits to adjust the voltages, helping the
LEDs to be adapted to different operating voltages.
IR Receiver LED
The duty ratios of the working pulses for some color TV’s
infrared remote controllers are around 1/3-1/4; and for some
other electronic products, the duty ratios of the infrared remote
controllers can even be as small as 1/10.
For Example:
+5V +5V
1
1
R3 R3 R3 R3
1K 10K 10K 1K
2
2
U23 LM324
1
1
Rx1_1 1 14 Rx2_2
U20 IR1 OUT A OUT D IR2 U17
1
VR2 2 A D
10K
-
-
2
2
2 13
+5V IN A- IN D-
3
3 12
4 IN A+ IN D+ 11 +5V
+5V 5 V+ V- 10
IN B+ IN C+
6 9
1
IN B- IN C-
1
R3 R3
R3 R3 B C 10K 1K
1K 10K
2
Rx1_2 7 8 Rx2_1
2
OUT B OUT C
1
1
IR2 U17
U17 IR2 Rx2_1 Tx2_1
Tx1_2 Rx1_2
1
2
2
1
Example flow Chart
FLOW CHART
OutputDiscontinuous
is displayed inofLCD
IR path
or Buzzer
Contact less tachometer principle of operation
The main difference between this tutorial about tachometer and frequency
meters, is that we need the reading in pulses per minutes (to count revolutions per
minutes), but in the same time, we don't want to wait a whole minute before getting
a correct reading. Thus we need some additional processing to predict the number
of revolutions per minute in less than a second.
Instantaneous measurement algorithm
To be able to deduce an RPM reading in less than second, while constantly refining
the reading's accuracy, a simple algorithm have been developed, where a counter
and a timer are used. Counter and timers are part of the internal features of a
micro-controller, (like the AT89C52 used in this project) and they can be easily
configured through programming.
The schematic below, shows how the timer and the counter are used for this task;
The counter is connected i such a way to count pulses coming from the proximity
sensor, while the timer is used to precisely feed the counted value to the
microcontroller every filth of a second, and reset the counter to 0. The
microcontroller can now take an average of the last 3 readings (saved in C1, C2
and C3) and calculate the average numbers of pulses per fifth second, then
multiply this value by 5, to get the number of pulses per second, then multiply this
value by 60 to get the number of pulses per minute, which represents the measured
RPM. The only purpose of calculating an average reading is that it will allow
getting more stable reading and preventing display flickering.
The CTRL line, is an input coming from the microcontroller (at the
wire connection: P4), turning the IR emissions ON and OFF, and
the OUT line, is the output of the sensor, which is fed to the
microcontroller (at the wire connection: P1).
The software
Here are only small relevant parts of the full C program, that
was loaded into the microcontroller after being compiled to a HEX
file. Those part of the code were selected as the ones that
emphasize the main purpose of a microcontroller in such an
application. For examples, function dealing with the LCD
operation are not included in this description. Comments in green
explains the program. The full code is available in the Project
folder, downloadable at the bottom of this article .
#include <REGX51.h>
#include <math.h>
void main(){
scale = 10 ;
P3_3 = 0; // ini proximity sensor, OFF
P3_4 = 1; // ini sensor input
P1_1 = 0; //turn LCD backlight ON
P2_0 = 1; //ini count/hold button
ini_lcd(); // ini the LCD
setup_interrupts();
while(1){
P3_3 = ~P2_0;
if (P2_0 == 1){
scale= 4;
}
}
}
As the name implies, the sensor is always ON, meaning that the
IR led is constantly emitting light. This design of the circuit is
suitable for counting objects, or counting revolutions of a
rotating object, that may be of the order of 15,000 rpm or much
more. However this design is more power consuming and is not
optimized for high ranges. in this design, range can be from 1 to
10 cm, depending on the ambient light conditions.
As you can see the schematic is divided into 2 parts
the sender and the receiver.
The sender is
composed of an IR
LED (D2) in series
with a 470 Ohm
resistor, yielding a
forward current
of7.5 mA.
The
receiver part is
more complicated,
the 2 resistors R5
and R6 form a
voltage divider
which provides 2.5V at the anode of the IR LED (here, this led will
be used as a sensor). When IR light falls on the LED (D1), the
voltage drop increases, the cathode's voltage of D1 may go as
low as 1.4V or more, depending on the light intensity. This
voltage drop can be
Detected using an Op-Amp (operational Amplifier LM358). You
will have to adjust the variable resistor (POT.) R8 so the the
voltage at the positive input of the Op-Amp (pin No. 5) would be
somewhere near 1.6 Volt. if you understand the functioning of
Op-Amps, you will notice that the output will go High when the
volt at the cathode of D1 drops under 1.6. So the output will be
high when IR light is detected, which is the purpose of the
receiver.
Contact-Less tachometer
this is a tachometer that counts the revolutions per minute of a
rotating object, given that the object has a reflective stripe glued
on it that will pass in front of the IR sensor for each and every
revolution, giving a pulse per revolution. Again a microcontroller
will have to be used to 'understand' the data provided by the
sensor and display it.
C Code for 8051 microcontrollers
#include <REGX51.h>
#include <math.h>
unsigned int i;
for(i=0;i<y;i++){;}
}
void main(){
//P2.0 IR control pin going to the sensor
//P2.1 IR output pin coming from the sensor
while(1){
P2_0 = 1; //send IR
delay(20);
ir1 = P2_1;
P2_0 = 0; //stop IR
delay(98);
ir2 = P2_1;
The correct positioning of the sender LED, the receiver LED with
regard to each other and to the Op-Amp can also increase the
performance of the sensor. First, we need to adjust the position
of the sender LED with respect to the receiver LED, in such a way
they are as near as possible to each others , while preventing any
IR light to be picked up by the receiver LED before it hit and
object and returns back. The easiest way to do that is to put the
sender(s) LED(s) from one side of the PCB, and the receiver LED
from the other side, as shown in the 3D model below.
It is also clear that this way of positioning the LEDs prevent the
emitted IR light to be detected before hitting an eventual
obstacle.
4.3 KEIL Development Tool
1. After giving the file name the device list windows opens.
2. Select the respective company’s microcontroller IC that is
going to be implemented in hardware.
3. From the drop down arrow, we get a list of all the chips from
that particular manufacturer. Choose the appropriate one.
4. Now the target is ready.
5. The data sheets and user manuals are automatically added.
4.3.3 Configuring the essentials
3. Then select rebuild all the target files too. With the Rebuild
Target
command, all source files are translated, regardless of
modifications.
5. After all the debugging the file is built again which creates a
hex file. This hex file is then used to download to the
microcontroller using a programmer kit.
With the Debug Toolbar buttons and the “Debug Menu and
Debug Commands”.
With the Run till Cursor line command in the local menu. The
local menu opens with a right mouse click on the code line in
the Editor or Disassembly window.
In the Output Window – Command page you can use the Go,
Ostep, Pstep, and Tstep commands.
The Locals page shows all local function variables of the current
function. The
Select the text <enter here> with a mouse click and wait a
second. Another mouse click enters edit mode that allows
you to add variables. In the same way you can modify
variable values.
In an editor window open the context menu with a right
mouse click and use Add to Watch Window. µVision2
automatically selects the variable name under the cursor
position, alternatively you may mark an expression before
using that command.
In the Output Window – Command page you can use the
Watch Set command to enter variable names.
Software settings
1. Install the Software Flash Magic
2. Select Serial Port - As per your Computer
3. Select the Chip (89V51RD2) (1)
4. Open the Hex file from Browse (3)
5. to program click Start (5), Then Message will appear press the
reset Switch as Shown
6. Press the Reset Switch
PRESS THE RESET SWITCH to start Programming
In the Controller Board Press the Reset Switch to run the Program
and Test.
Conclusion: