■ FIGURE 6. RS-232
DB9 connection.
provides a suitable substitute
component that the user must solder
to the Butterfly to use the light sensor
function. This sensor works with the
existing Butterfly software.
The CdS light sensor is a device
that has resistance proportional to
the incident light. As a resistor, the
device has no polarity so either leg
can be inserted in the pads shown
circled in red (see Figure 5). Seat
the sensor snug to the top of the
Butterfly, then solder the legs to the
bottom and trim them just above the
solder meniscus.
provided DB- 9 female connector
(calm down — it’s technical).
Strip about 1/8 inch from the
ends of each wire and then carefully
solder them to the Butterfly and the
DB- 9 connector as shown in Figure 6.
Notice that the upper wires in the
picture cross. Be very careful to get
this exactly according to Figure 6;
about half the emails I get for
problems turn out to be related to
either incorrect wiring or poor
soldering of this component.
Female Headers
foamcore box. (Details for this
construction can be found in
Smiley’s Workshop 1 Supplement:
AVR Learning Platform Foamcore Base
and Box at www.nutsvolts.com.)
You will need to carefully twist
the ends of the battery box wires
until they are straight, then soak
them with solder so that it runs up
under the insulation to make these
wires strong enough to insert into
the breadboard power bus. The red
wire goes to the + red bus and the
black wire goes to the – blue bus.
Connect the two power busses with
red and green wire and then put an
LED with a 2.2K resistor on the
breadboard. The resistor goes to
the + power; the LED short leg goes
to the – power. The LED and
resistor are then connected on a
breadboard strip.
The Butterfly receives power
from the bus as shown, the + red
wire goes to the rightmost top of the
header, and the – green wire goes to
the rightmost bottom of the header.
DB9 Female
Connector and Wire
In order to communicate with a
PC, the Butterfly must connect to a
serial cable. The mini-kit provides the
connector and wire to make the
connection to a serial cable.
The Butterfly has built-in RS-232
converters for serial communication
with a PC. Most serial cables will
have a DB- 9 male connector on the
device side that will mate with the
Refer to Figure 7 to see the
location of the ADC, USI, PORTB,
and PORTD pads. Solder the two-pin
header to the ADC pads; the four-pin
header to the USI pads; and 2x5
headers to the PORTB and PORTD
pads. Notice that Figure 7 shows a
male header on the ISP pad; this is
not included in the kit and won’t be
used for our work (maybe later).
Test Your Connection
Using Developer
Terminal
AVR Learning
Base Board
■FIGURE 7. AVR Workshop Learning
Platform.
The AVR Workshop Learning
Platform is
built on a
foamcore
board that
lives in a
protective
Hook your Butterfly DB- 9
connection to an RS-232 cable from
a PC. If you use a USB-to-serial
converter cable, you may have
problems if the voltage levels are
not robust. I’ve used several and
have not had a problem.
Open Developer Terminal.
You can read the user manual
(I recommend: RTFM) by clicking
the ‘Help/Manual.’ Click the
‘Settings/Port’ menu item to open
the settings window. Select the
RS-232 COM port that the Butterfly
is connected to. Set the baud rate
to 19200, data bits to 8, parity to
None, stop bits to 1, and handshaking
to none. You
can test that
your learning
platform is
■ FIGURE 8.
Close-upofpower
connections.
64
August 2008