l. DC motor controller (robotics)

PIC18F2xJ50 can also be used in robotics or other applications where an electrical motor is needed to drive mechanics. Here is a circuit that can drive two DC electric motors, both forwards and backwards. The turning speed may be regulated by using PWM on PIC18FxxJ50 outputs. Firmware for PIC18FxxJ50 microcontrollers in Downloads section configures RC1 and RC2 pins as PWM outputs. They may be directly connected to the drive inputs of the DC motor controller. Next, select two of the PBx outputs for direction control. Direction and drive control inputs are TTL compatible, and would register logical “1”, if the input voltage is 2 V or higher. Therefore, no adapter is needed to connect a 3.3 V PIC18FxxJ50 or a PIC32MXxxxFxxxB microcontroller directly. However, you may also use a Velleman K8055 or K8055N board with the original firmware or an advanced firmware from Downloads section.

ALSO READ:

The DC motor controller may be used to drive any kind of low power and low voltage DC motors (VM1, VM2<10 V, I < 1 A). However, if a sufficient power supply and cooling for the driver transistors (2N6111) bridges are provided, the motor can run at up to 30 V and 7 A. However, in this case you must also provide sufficient cooling for the transistors and a separate +5 V= power supply for ICs (74LS02 and 74LS04).

NOTE: It is true that you can simplify the circuit using just the 4 power transistors (2N6111) controlled by K8055 or K8055N board outputs (PWM1 and PWM2 and two of the digital outputs Q1 through Q8 with addition of 2 resistors to Vcc = +5 V=), or connect the transistor bridges to PIC18FxxJ50 via an ULN2803 chip. But in this way a programming error may cause for one or both transistor bridges to burn out, if 3 or all 4 transistors are opened simultaneously. The logical circuits 74LS02 and 74LS04 in the schematic below are foremost used to prevent such mishaps!

Here is the circuit: