Motor control
Electric motors draw quite a high current (even small motors) so they need to be switched using a transducer driver. Lamps also need to be switched using a transducer driver, but the control of motors is often more involved because of the need to control their speed and direction.
The rotation direction of a motor depends on the polarity of power supply connection. To make a motor rotate in the opposite direction simply interchange the connections to the motor. This can be shown using Circuit Wizard:

Fig 1 Rotation direction depends on battery polarity
Supply reversal can be achieved using switches.

Fig 2 H-Bridge. The motor is switched into anti clockwise rotation by pressing switch A and clockwise rotation by pressing switch B.
The arrangement in fig 2 is cumbersome in practice because push buttons need to be pressed in pairs. The circuit can be simplified using change over switches which make a more practical arrangement.

Fig 3 Motor direction control using change over switches
The change over switch can of course, by implemented by a 2pole change over relay.

Fig 4 Motor direction control using a relay
The switches in the H-Bridge arrangement in fig 2 could be replaced by transistors to provide electronic control. However, this would require quite complex control of the transistor gates.

Fig 5 How the H-Bridge would look if switches are replaced by transistors
Fortunately, there is a device which includes the four transistor switches and their control logic. Its reference number is L293D. The symbol shows two buffer amplifiers with commoned enables. The buffers copy the logic state at their inputs to their outputs. In other words, if a logic 1 is input then the output goes to logic 1. The buffer does not change the logic state but its output is capable of delivering 500mA – enough to power a small motor. (Note: there is an error in Circuit Wizard which implements the buffers as inverting buffers)

Fig 6 Simulation of the L293 driver.
The motor rotates if the buffers output different logic states. If they output the same logic state, then the motor stops quickly (dynamic braking). The enable must be at logic 1 for the buffers to operate. If it is at logic 0, then the buffers are disabled and the motor freewheels. The enable input can be used for speed control using pulse width modulation.
Figs 6 and 7 shows how you can explore the L293D in Circuit Wizard. These are minimalist circuits using Circuit Wizard’s logic inputs to operate the buffers. (Virtual push buttons which have to be replaced with push buttons wired into potential dividers).

Fig 7 Simulation to explore the enable input of the L293D
A more practical arrangement for exploring the L293D is shown in fig 8.

Fig 8 L293D test circuit (NB this Circuit Wizard diagram hides the L293D logic supply on pin 16)
The L293D is an ideal driver for PIC control providing steps are taken to ensure the PIC power supply is isolated form the motor supply. This is shown in fig 9 by the inclusion of D1 and C2. (C1 is included to suppress noise generated by the motor).

Fig 9 L293D controlled by a PIC. (NB this Circuit Wizard diagram hides the L293D logic supply on pin 16)
L293D information and pin-out.
Speed control
Speed control is covered in the knowledge base.
Here are two circuits you can use to control the speed of small dc motors using PWM. Speed is adjusted by control VR1. Transistor Q1 can handle up to 500mA. (The circuits also make excellent lamp dimmers – just replace MT1 with a 6V bulb.)
Simulation files of the following circuits can be downloaded. 555 version 40106 version

Fig 10 555 Pulse width modulator with Darlington driver

Fig 10 40106 Schmitt inverter pulse width modulator with Darlington driver
H-bridge project board
This provides a convenient way to explore the possibilities of the L293D. It can be powered from a supply in the range 6-18V, depending on the rating of the motor. Two push buttons are provided: one for forward and one for reverse direction. The enable connection of the L293 is brought out to a 3-pin connection for speed control using pulse width modulation. LED direction indicators are included for convenience.

Fig 14 H-bridge project board drawn in circuit wizard

Fig 15 H-bridge project board Ranger schematic. (NB L293D power connections are hidden)
The push buttons are also being used as wire links which is why they have a strange connection arrangement.

Fig 16 H-bridge project board PCB layout (from component side)
| Download PCB foil in .pdf format |
Instructions for using the JYK crimping tool.
JYK connectors are available from Rapid Electronics:

Crimping pliers 85-0262

JYK Housing e.g. 3 way 22-0910

Crimp terminal 22-1096

JYK header e.g. 3 way 22-0955
Stranded equipment wire 01-0108
PWM board (speed controller)
This optional board plugs into the H-bridge project board to provide motor speed control. This is a variable mark/space ratio astable set by the on-board preset potentiometer. Spare inverters are used to drive an LED indicator and buffer the astable output. This board can be used with the H-bridge project board powered from a supply of between 4.5 and 18V.

Fig 17 Speed controller Ranger schematic. (NB 40106 power connections are hidden)

Fig 18 Speed controller project board PCB layout (from component side)
| Download PCB foil in .pdf format |
![]() |




