dc motor control report

25
Electronics Project DC Motor Speed Controller

Upload: nishant-singh

Post on 21-Nov-2014

130 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Dc Motor Control Report

Electronics Project

DC Motor Speed Controller

Page 2: Dc Motor Control Report

Certificate

Page 3: Dc Motor Control Report

Index

Abstract Introduction Components Working Block Diagram & Circuit Diagram Pcb Layout Program Conclusion Applications Bibliography

Page 4: Dc Motor Control Report

Abstract

Page 5: Dc Motor Control Report

Introduction

This is DC Motor Controller (any rpm) is widely used application used nowadays which is designed using Atmel AT89C51. This Controller is used to decrement or increment. The speed of motor is controlled in 7 steps. That is operated at seven different speeds.

Page 6: Dc Motor Control Report

ComponentsU1 7805 5V voltage regulator

U2 AT89C51

U3 74LS245 non inverting bus transceiver

U4 ULN 2803 octal transistor array

L1L2.....L8

GREEN LEDRED LED

RN1,RN2,RN3 10kΩ/*9(1/4 watts)-resistor bank

R1 10kΩ

R2 120Ω

D1 1N4007

XTAL (Crystal Oscillator) 10 MHz

C1 10µf/25V electrolytic

C2 0.1 µf/ceramic

Reset, Stop Push to on Switch (2 legs) TACK SWITCHES

DC Motor Any rpm DC motor

PBT 2 2 Pin Connector

Socket 40 PIN, 20 PIN, 18 PIN

Battery 9V

Working

Page 7: Dc Motor Control Report

The stop watch builds around a microcontroller AT89C51. The power supply from the 9V is down converted and regulated by IC 7805 to provide regulated 5V to the circuit.

Reset switch is used to manually reset the microcontroller, while power on reset signal for microcontroller is derived from combination of resistors. Pin 31(EA/Vcc) is connected to the Vcc to enable internal program execution. Pin 18 and Pin 19 are input and output pins of the build in inverting amplifier, respectively, which can be used as an on chip oscillator. An 10 MHz crystal is used to generate clock frequency to the microcontroller.

Port 0 is used to drive the segments of seven segment common cathode display.

Pin 1 of resistor bank is connected to Vcc and pins 2 through 9 are connected to port 0 pins through 39 down through 32 of microcontroller. Pins 39 down through 32 are connected to the input pins of the input pins of 8 bit 3 state non inverting bus transceiver IC 74LS245.

7-LEDs (L1-L7) are connected to the output pins of IC 74LS245 is used as non inverting transceiver to increase the current level. Resistors are used to limit the current through 7-LEDs.

Port 2 acts as multiplexerto select a particular speed using octal Darlington transistor array ULN 2803 transistor. Pin 28 is connected to the pin 1 of ULN 2803. ULN 2803 outputs a low signal to start the motor.

Port 1 is used to configure the time. Pins 1 through 8 of port 1 are pulled up by resistor bank of 10KE and also connected to (+), (-), STOP for detecting the pressing of the switch.

Page 8: Dc Motor Control Report

Port 0 and port 2 provides the segment data and enable signal simultaneously for glowing the LED and control the motor. Port 1 detects pressing of the switches to start, increment and decrement the speed of the motor. The software detects the switches and reacts as per the program is written.

Circuit Diagram

Page 9: Dc Motor Control Report

Circuit Description

Page 10: Dc Motor Control Report

Pcb Layout

Page 11: Dc Motor Control Report

Program; R7 is used to hold a value between 0 and 255 which will correspond to a

Page 12: Dc Motor Control Report

brightness

; level for the LED. Timer 0 will be used to create the Pulse Width Modulated

output.

; Timers are generally used to repeatedly measure the same fixed interval of

time.

; In this case we want to measure 2 periods of time. The high output period and

the

; low output period.

;**************************************************************************

; RESET ;reset routine

ORG 0H ;locate routine at 00H

AJMP START ;jump to START

;**************************************************************************

; INTERRUPTS (not used) ;place interrupt routines at appropriate

;memory locations

Page 13: Dc Motor Control Report

ORG 03H ;external interrupt 0

RETI

ORG 0BH ;timer 0 interrupt

AJMP TIMER_0_INTERRUPT ; go to interrupt routine (can be anywhere we want)

; since a jump does not return to this point we do not

; need a Return command

ORG 13H ;external interrupt 1

RETI

ORG 1BH ;timer 1 interrupt

RETI

ORG 23H ;serial port interrupt

RETI

ORG 25H ;locate beginning of rest of program

Page 14: Dc Motor Control Report

;**************************************************************************

INITIALIZE: ; set up control registers

MOV TMOD,#00H ; set timer 0 to Mode 0 (8 bit Timer with 5 bit prescalar)

SETB TR0 ; turn on timer 0

MOV PSW,#00H

SETB EA ; Enable Interrupts (each individual interrupt must also be enabled)

SETB ET0 ; Enable Timer 0 Interrupt

RET

;**************************************************************************

; Real code starts below.

;*************************************************************************

; The LED is off during the high section and on during the low section of each

cycle

Page 15: Dc Motor Control Report

; The Flag F0 is used to remember whether we are timing tlow or thigh.

TIMER_0_INTERRUPT:

JB F0, HIGH_DONE ; If F0 is set then we just finished the high section of the

LOW_DONE: ; cycle so Jump to HIGH_DONE

SETB F0 ; Make F0=1 to indicate start of high section

SETB P1.0 ; Turn off LED

MOV TH0, R7 ; Load high byte of timer with R7 (our pulse width control value)

CLR TF0 ; Clear the Timer 0 interrupt flag

RETI ; Return from Interrupt to where the program came from

HIGH_DONE:

CLR F0 ; Make F0=0 to indicate start of low section

Page 16: Dc Motor Control Report

CLR P1.0 ; Turn on LED

MOV A, #0FFH ; Move FFH (255) to A

CLR C ; Clear C (the carry bit) so it does not affect the subtraction

SUBB A, R7 ; Subtract R7 from A. A = 255 - R7.

MOV TH0, A ; so the value loaded into TH0 + R7 = 255

CLR TF0 ; Clear the Timer 0 interrupt flag

RETI ; Return from Interrupt to where the program came from

;**************************************************************************

START: ;main program (on power up, program starts at this point)

ACALL INITIALIZE ;set up control registers

MOV R7, #00H ; set pulse width control to dim

TEST: LCALL TIMER

INC R7 ;FROM HERE TO TEST IS THE TRICK TO VARY R7 AS WELL AS

Page 17: Dc Motor Control Report

;THE INTENSITY OF LED

CJNE R7,#0FFH,TEST

TEST1

TEST1: LCALL TIMER

DEC R7

CJNE R7,#00H,TEST1

LCALL TEST

;go to LOOP(always jump back to point labeled LOOP)

TIMER: push 00h

push 01h

push 02h ;store the internal location 00h,01h,02h contents

Page 18: Dc Motor Control Report

mov 02h,#03h

USER_L2:

mov 01h,#0ffh

USER_L1:

mov 00h,#0ffh

DJNZ 00h,$;decreament the internal location 00h

;content repeat until it becomes 0

DJNZ 01h,USER_L1 ;""""""

DJNZ 02h,USER_L2 ;""""""

pop 02h

Page 19: Dc Motor Control Report

pop 01h

pop 00h

RET

END ;end program

Page 20: Dc Motor Control Report

Applications

Countdown timers are used in many devices such as

Televisions-Modern televisions use countdown timers where the user is allowed to set time which can be used to switch on or switch it off television at a particular time.

Microwave ovens-Countdown timers are used in microwaves to select a time for which the food inside the microwave should be heated.

Electronic Explosives-Timers are use in timing an explosion. It increases the accuracy of an explosion.

In Music Concerts-Timers are used at music concerts to show the audience the time remaining for the concert to start.

Washing Machines-Countdown timers are used in washing machines which help the user to decide for how much time the clothes should be washed.

Page 21: Dc Motor Control Report

Bibliography

www.engineersgarage.com www.efy.com www.wikipedia.com www.electronicsforum.com www.datasheetcalalogue.com