■ FIGURE 3. Circuit Board in Enclosure.
The first part of the circuit
handles the inputs and weights.
Since our input signals — as
represented by the two toggle
switches — are binary (either on or
off), we can use a simplifying trick to
simulate the weighting operation.
To represent each input weight,
potentiometers R2 and R3 are
connected across the full supply
range. If the pot is turned toward
the positive supply rail it represents
a positive weight, and a negative
weight when turned toward the
negative supply. When the pot is in
the center of its range, it represents
a zero weight. Each toggle
switch is used to simply
indicate whether an input
is active (binary 1) or
not (binary 0) by connect-ing/disconnecting its
corresponding pot.
The first op-amp IC1A
is configured as a
non-inverting summing
circuit, to sum the voltages from the two inputs.
Resistor R12 is used to tie
the summing point to
ground in case of no
inputs. That takes care of
Neuron Property #1. In
order to implement
Neuron Property #2, we
need the squashing function. To realize this, the
output of summer IC1A is
fed into op-amp IC1B,
which is configured as a
comparator. The third pot
R4 on the negative input
sets the threshold of the
neuron. Since the amp operates in
open loop mode, the high gain will
drive the output of the amp to the
positive supply if the positive input
is above the threshold voltage, and
toward the negative supply voltage
if it is below. In this mode, it acts
mostly as a hard step function,
although there is some “play”
around the zero voltage point. The
LED — with its limiting resistor at
the output — indicates whether the
output is high or low. The bidirectional LED given in the Parts List
results in a green or red signal,
which is more interesting than a
single-color LED.
This is all that is needed to
implement the basic neuron operation. To make things a little more
interesting, a third op-amp IC1D
from the LM324 is configured as an
analog inverter and can be used to
feed back the inverted output as an
input to the neuron. This can be
used to realize a simple oscillator,
which will be covered later in the
article.
Construction
PARTS LIST
SEMICONDUCTORS
❑ IC1 LM324N quad op-amp
❑ LED1 T1 3/4 dual color red/green, two-lead LED
RESISTORS (all 1/4W, 5%)
❑ R1,R7,R8,R10-R12 100K
❑ R5 470Ω
❑ R6 1M
❑ R9 220K
❑ R13,R14 1K
❑ R2-R4 10K linear pot
CAPACITORS
❑ C1 1µF 16V ceramic or other nonpolarized
ADDITIONAL PARTS AND MATERIALS
❑ SW1 SPDT center off submini toggle switch
❑ SW2-3 SPST submini toggle switch
❑ Knobs (to fit potentiometers), case (PacTec HM-
9VB 4” x 2 1/2” x 1” or similar), LED holder, 9V battery connector, PCB or perf board, 14-pin socket,
ribbon cable or other hookup wire, 9V battery
A printed circuit board pattern is
provided on the Nuts&Volts website
( www.nutsvolts.com) if you want to
create a PCB along with the parts
layout. But you don’t have to take
this approach — the circuit can be
constructed using simple perfboard
and soldered wires. If you are not
very good at soldering, you should
consider using a 14-pin socket and
place the chip in after you are done
soldering. If you use a socket, it is
easier to solder this in first — otherwise you can save soldering the IC for
later in order to minimize the risk of
heat damage.
Next, solder the resistors and
capacitor to the board, followed by
the 9V battery clip. You don’t have to
be paranoid about too much when
soldering but as always, you should
try to make good solder connections.
The rest of the components —
switches, pots, and LED — will be
soldered using insulated wire. I like
46
January 2006