Using a PIC 16f627 to control a DC motor direction
I need a motor controller for my robot and since I'm making everything else I wanted to make this myself too. I did a bit of searching and found that a H-bridge is the best way to get control over a motor, a little bit more searching and I stumbled across chucks robotics which had a fantastic little design to control a motor using a PIC. You can find his page here.
This design uses very simplistic parts except for the PIC. Chuck uses a PIC 16C54 which I don't have so I'll be using a PIC 16f627 instead just because I didn't want to have to get another PIC. Apart from that I'll use exactly the same parts.
Parts required to make the Robot Motor Controller
- PIC 16f627
- 4 MHz Crystal
- 2 x 18 pf Capacitors (which I forgot)
- 4 x optocouplers
- 2 x TIP 125 PNP power darlingtons
- 2 x TIP 120 NPN power darlingtons
- 4 x 470 ohm Resistors
- 4 x Diodes
- 4 x Resistors who's ohm value must be worked out as described on chucks page
Progress on the PIC 16f627 Motor Controller
I've put together a test version of Chucks Controller using a bread board however I forgot to order the two capacitors so I was unable to test the board. Without the capacitors the PIC is unable to run and will draw current like a short circuit. I use a plug to power my board which turns off when something like this occurs but if I wasn't using it the PIC would surely heat up and it would obviously be a problem but to spot this before any damage was done would be difficult.
I've ordered my missing capacitors and I'll be able to do testing at the weekend to test it out but I'm sure there'll be no problem with the circuit.