Hardware
A newmember of the PICAXE family, the 18-pin 18M2
controller, is an extremely capable
chip that is well-suited to the demands of this project.
The 15-pin L298N H-bridge device is responsible for controlling
the direction of travel and the speed of the train. It is called an
“H-bridge” because such devices are frequently drawn on a sche-
matic with four transistors in an “H” pattern [5].
I like to think of an H-bridge as a solid state double-pole double-
throw switch. As you may know, a DPDT switch can be wired so
that it delivers power to a train with one polarity in one position
and with the opposite polarity in its other position. Reversing
polarity reverses the motor’s rotation.
4
4. The 18-pin PICAXE 18M2, the brains behind the
controller.
The infrared commands from the handheld remote control
are received by a small chip, the Vishay TSOP4838
. Its small, boxy case and three
leads belie its complexity. Inside is a sophisticated circuit that
detects the 38 KHz infrared data stream from the TV remote
control and filters it into a series of pulses that are inter-
preted by the PICAXE [6].
Other components include indicator LEDs, a voltage regulator,
and assorted resistors, capacitors, and diodes. It is a straight-
forward circuit that works well with loads of up to 3 amps.
DC power is supplied by any filtered DC power supply pro-
viding 12-24 volts. I have had great success using old laptop
computer power supplies for this and other projects. Be sure
to use an appropriate heat sink on the L298N if current is
likely to exceed 1 amp.
5. The L298N H-bridge, the “brawn” of the PICAXE
controller.
5
PICAXE circuit - 4
MRH-Jun 2014