___________________________________________________________________________________________________
- What is motor? – A motor is an electric machine that converts electrical energy into mechanical energy. Motor has following parts:
- Rotor –In an electric motor the moving part is the rotor which turns the shaft to deliver the mechanical power. The rotor usually has conductors laid into it which carry currents that interact with the magnetic field of the stator to generate the forces that turn the shaft. However, some rotors carry permanent magnets, and the stator holds the conductors.
- Stator –The stationary part is the stator, usually has either windings or permanent magnets. The stator is the stationary part of the motor’s electromagnetic circuit. The stator core is made up of many thin metal sheets, called laminations. Laminations are used to reduce energy loses that would result if a solid core were used.
- Windings-Windings are wires that are laid in coils, usually wrapped around a laminated soft iron magnetic core so as to form magnetic poles when energized with current.
- Commutator –A commutator is a mechanism used to switch the input of certain AC and DC machines consisting of slip ring segments insulated from each other and from the electric motor’s shaft. The motor’s armature current is supplied through the stationary brushes in contact with the revolving commutator, which causes required current reversal and applies power to the machine in an optimal manner as the rotor rotates from pole to pole.
- Types of motor –There are many confusion arises when motors categorized, but mainly two types that is AC & DC. Here we only interface simple DC motor, geared DC motor and stepper motor as you can see on above pics.
- Operation – we can’t direct interface any motors with microcontroller because
- Low voltage compatibility – microcontroller pin produced very low voltage about 5V and at this voltage motor not drive properly. To operate motor, at least 9V required.
- Low current compatibility – microcontroller pin produced very low current about 1.3mA(AT89c51) and at this current rating motor not drive. To operate motor, at least 300mA current required.
- Back EMF- motor produced back current due to induced EMF which is harmful for microcontroller and cause of this microcontroller pin may be damaged.
Solution is L293D Dual H-Bridge IC, this IC produce 600mA to 700mA current with voltage range of 9V to 48V which is enough to drive small electronics motors. The circuit diagram of how to interface motor using this IC is shown in side TAB(circuit diagram).
- Applications – Different motors are used according to its characteristics and required parameters and its application as diverse as industrial fans, blowers and pumps, machine tools, household appliances, power tools, and disk drives.
Click Here : Interfacing of simple DC & geared DC motor
Click Here : Interfacing of stepper motor and program point of view understanding
1. CIRCUIT DIAGRAM OF SWITCH,ULN2003 AND STEPPER MOTOR INTERFACING WITH PIC18F458
2. CIRCUIT DIAGRAM OF SWITCH, L293D AND GEAR MOTOR INTERFACING WITH PIC18F458 _______________________________________________________________________________________________________
1.PROGRAM IN WHICH SWITCH CONTROL GEAR MOTOR INTERFACING WITH PIC18F458
/****************************************************** www.firmcodes.com DEVELOPED BY:- FIRMWARE DEVELOPER WHAT PROGRAM DO:- BLINK LEDs ON PORT2 ******************************************************/ /* header file used in this program is already included in software microC pro for pic*/ #define motor PORTD // data of 7 SEGMENT at port D void delay(); void main() { int i=0,j,forward,right,left,backward; TRISD=0X00; TRISB=0xff; motor=0X00; // PORTB=0XFF; while(1) { forward=portb & 0x01; right=portb & 0x02; left=portb & 0x04; backward=portb & 0x08; if(forward==0) // switch 1 { motor=0x05; } else if(right==0) // switch 2 { motor=0x01; } else if(left==0) // switch 2 { motor=0x04; } else if(backward==0) // switch 2 { motor=0x0a; } else motor=0x00; } } void delay() { int i; for(i=0;i<3000;i++); }
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
_______________________________________________________________________________________________________ 2. PROGRAM IN WHICH SWITCH CONTROL STEPPER MOTOR INTERFACING WITH PIC18F458
/****************************************************** www.firmcodes.com DEVELOPED BY:- FIRMWARE DEVELOPER WHAT PROGRAM DO:- BLINK LEDs ON PORT2 ******************************************************/ /* header file used in this program is already included in software microC pro for pic*/ #define a1 PORTD.RD0 #define a2 PORTD.RD1 #define a3 PORTD.RD2 #define a4 PORTD.RD3 void delay(); void main() { int i=0,j,one,two,three,four; TRISD=0X00; TRISB=0xff; PORTD=0X00; // PORTB=0XFF; while(1) { one=portb & 0x01; two=portb & 0x02; three=portb & 0x04; four=portb & 0x08; if(one==0) // switch 1 { a2=a3=a4=0; a1=1; } else if(two==0) // switch 2 { a1=a3=a4=0; a2=1; } else if(three==0) // switch 2 { a1=a2=a3=0; a4=1; } else if(four==0) // switch 2 { a1=a4=a2=0; a3=1; } } } void delay() { int i; for(i=0;i<3000;i++); }
PROTEUS File for SIMULATION(Password Of RAR file is :-firmcodes.com)
_______________________________________________________________________________________________________
Content for the tab VIDEO