You are on page 1of 30

8051 Applications

ADC 0804.

• ADC0804 is an 8 bit successive approximation analogue to digital


converter from National semiconductors. The features of ADC0804
are differential analogue voltage inputs, 0-5V input voltage range, no zero
adjustment, built in clock generator, reference voltage can be externally
adjusted to convert smaller analogue voltage span to 8 bit resolution etc.
The pin out diagram of ADC0804 is shown in the figure below.
ADC interfacing
DAC interfacing
Keyboard interfacing
7 segment display interfacing
Stepper motor
• A stepper motor is an electromechanical device
which converts electrical pulses into discrete
mechanical movements. The shaft or spindle of
a stepper motor rotates in
discrete step increments when electrical
command pulses are applied to it in the proper
sequence.
STEP SEQUENCE
• Stepper motors can be driven in two different patterns or sequences.
namely,
• Full Step Sequence & Half Step Sequence
• Full Step Sequence
• In the full step sequence, two coils are energized at the same time
and motor shaft rotates. The order in which coils has to be energized
is given in the table below.
• Half Step Sequence
• In Half mode step sequence, motor step angle reduces to half the
angle in full mode. So the angular resolution is also increased i.e. it
becomes double the angular resolution in full mode. Also in half
mode sequence the number of steps gets doubled as that of full
mode. Half mode is usually preferred over full mode. Table below
shows the pattern of energizing the coils.
Step Angle
• Step angle of the stepper motor is defined as the angle
traversed by the motor in one step.
• , Stepper Motor rotating in full mode takes 4 steps to complete
a revolution,
• So step angle can be calculated as…
Step Angle ø = 360° / 4 = 90°
• and in case of half mode step angle gets half so 45°.

• Number of steps: After completing 4 steps, the rotor moves


only one tooth pitch.
• For ex : if rotor has 50 teeths:
• Step angle: 360/4 x50 = 1.8 degree
• Number of steps = 360 degree for one revolution /step angle
• = 360/1.8= 200 steps
Steeper motor program
DC motor
L293 motor driver.
L293 is a dedicated quadruple half H bridge motor driver IC available in 16 pin
package. To know more about H bridge, check this link. H bridge motor driver
circuit. L293 has a current capacity of 600mA/channel and has supply voltage
range from 4.5 to 36V DC. They are fitted with internal high speed clamp diodes
for inductive spike protection. Other good features of L293 are high noise
immunity, internal ESD protection, thermal shutdown, separate input supply for
each channel etc. The pinout and truth table of an L293 motor driver is shown in
the figure below.
DC motor interfacing
• In the circuit components R1, S1 and C3 forms a debouncing reset circuitry.
C1, C2 and X1 are related to the oscillator. Port pins P1.0 and P1.1 are
connected to the corresponding input pins of the L293 motor driver. The
motor is connected across output pins 3 and 6 of the L293.

• The software is so written that the logic combinations of P1.0 and P1.1
controls the direction of the motor. Initially when power is switched ON,
P1.0 will be high and P1.1 will be low.

• This condition is maintained for a preset amount of time (around 1S) and
for this time the motor will be running in the clockwise direction (refer the
function table of L293).

• Then the logic of P1.0 and P1.1 are swapped and this condition is also
maintained for the same duration . This makes the motor to run in the anti
clockwise direction for the same duration and the entire cycle is repeated.
Servo motor
A Servo is a small device that has an output shaft. This shaft can be positioned to
specific angular positions by sending the servo a coded signal.
As long as the coded signal exists on the input line, the servo will maintain the
angular position of the shaft. As the coded signal changes, the angular position of
the shaft changes.
In practice, servos are used in radio controlled airplanes to position control surfaces
like the elevators and rudders. They are also used in radio controlled cars, puppets,
and of course, robots.

Parts of SM
control circuitry, the motor, a set of gears and 3 wires that connect to the outside
world. One is for power (+5volts), ground, and the white wire is the control wire.

The servo motor has some control circuits and a potentiometer (a variable resistor,
aka pot) that is connected to the output shaft..The pot allows the control circuitry to
monitor the current angle of the servo motor.

If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that
the angle is not correct, it will turn the motor the correct direction until the angle is
correct. The output shaft of the servo is capable of travelling somewhere around
180 degrees.
Servo motor
• A normal servo is used to control an angular motion of between 0 and 180
degrees.
• The amount of power applied to the motor is proportional to the distance it
needs to travel. So, if the shaft needs to turn a large distance, the motor will
run at full speed. If it needs to turn only a small amount, the motor will run at a
slower speed. This is called proportional control.

• How do you communicate the angle at which the servo should turn? The
control wire is used to communicate the angle. The angle is determined by the
duration of a pulse that is applied to the control wire. This is called Pulse Coded
Modulation.

• The servo expects to see a pulse every 20 milliseconds (.02 seconds). The length
of the pulse will determine how far the motor turns. A 1.5 millisecond pulse, for
example, will make the motor turn to the 90 degree position (often called the
neutral position). If the pulse is shorter than 1.5 ms, then the motor will turn
the shaft to closer to 0 degress. If the pulse is longer than 1.5ms, the shaft turns
closer to 180 degress.
Servo Motor
This project allows the servo motor to move to an angle specified by the user. The pulse
train required to rotate the servo is produced by AT89C51 microcontroller. The desired
angle of rotation is provided through a 4x3 keypad interfaced to the microcontroller. A
16x2 LCD is also connected with the microcontroller to display the angle of rotation
entered by the user.

The first pin of port P1 (P1^0) of 8051 microcontroller is set as the output pin to provide
control signal to the servo motor. Ports P0 and P2 are used to interface keypad and data
pins of LCD, respectively. Ports P1^3, P1^4 and P1^5 are connected to RS, RW and EN
pins of LCD, respectively.

Before connecting to the control wire of servo, the output from the microcontroller
(P1^0) is fed through a comparator IC LM 324, so that the signal is protected from any
loss due to overloading.

You might also like