Step 3Add Motors
To control motors from a PIC (or other microcontroller) one must use an H-bridge (http://en.wikipedia.org/wiki/H-bridge). You can build your own using transistors or you can buy an h-bridge IC.
I used an L293 H-Bridge IC to drive the motors, it's a nice small, simple IC. See the diagram below for how the IC works.
As you can see from the table below the diagram, all your PIC has to do to control the motor is to change the high/low states on the DIRA1 and DIRB1 pins to control motor A, and the DIRA2 and DIRB2 pins to control motor B.
Makesure to put a capacitor between the motors' power and ground. A different power supply (higher voltage) from the one that supplies your PIC must be used for the motors. However the grounds should be shared between the two power supplies.
Because motors can cause voltage spikes when turned on and off, make sure to put a capacitor between the motors power and ground. Also put a cap between the PIC power and ground.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































