It’s a pumpkin! It’s a Jack-o-lantern! It’s an electronics project! It’s… a Cylon!

Cylons are great. They’re evil, menacing, and shiny. They have glowing red lights, computer-monotone voices, and they aim as precisely as imperial stormtroopers.

For halloween this year, we made Cylon Jack-o-lanterns in both large and small versions.

The design consists of two parts, a pumpkin-carving part and an electronics part. The big idea, of course, is to make the Cylon’s red eye scan back and forth.

How well does it work? Take a look! (Youtube)

This week’s Weekend Projects Podcast at Make Magazine is about making a programmable LED pumkin.

Our Cylon is made with a very different approach. It runs on a 9V battery and uses two cheap integrated circuits (a 555 and 4017) that together control six LEDs (or six groups of LEDs).

Circuits like this are quick, easy, and cheap to build. It’s also fun merely from the standpoint of making something that people might expect to require a microcontroller. For this particular circuit, it turns out to be cheaper and faster to do it without one.

If you’re handy with a soldering iron, you can build this circuit for less than ten dollars, in less than two hours, without any programming at all.





Let’s get started with the pumpkin. Here’s our first victim, a pie pumpkin roughly six inches across. The first step is to mark up the design. Some people like stencils, I like to draw on the pumpkin with a Sharpie, cleaning up later with rubbing alcohol. It works pretty well.

Digging around in the kitchen, I found a wide assortment of carving and garnishing tools. To these, I added my hobby knife, scissors, and precise tweezers. As it turned out, I ended up doing most of the carving with two tools: the hobby knife and the Microplane zester (not shown). All these other guys are nice, but they all seemed too clunky or specialized when it came down to it.

Here’s the completed carved pumpkin, ready for the eye to be inserted.

Electronics

The scanning eye of the Cylons is awfully similar to the one that KITT had on Knight Rider. It’s possible that KITT was built by Glen A. Larson using recycled Cylon technology.

As some people have pointed out, the scanner also similar to the eye of the robot Gort in The Day the Earth Stood Still. You can even watch the relevant clip from that movie on YouTube, but you might notice that it’s not quite the same.

Although the basic premise is the same, for some reason there are a lot more KITT circuits than Cylon circuits floating around on the net. (There are some Cylon circuits; Here is one that looks complicated!)

The starting point for our circuit is the “standard”

KITT scanner circuit. There are quite a few variations on the basic theme, and we’ll pick and choose the parts that we like.

This circuit is based around the CD4017 decimal counter chip. This is a chip that counts the cycles of a clock signal that is input to one of its pins. It counts from 0 to 9, sequentially turning on the outputs labeled #0 through #9 as it counts, and then it starts over. We will use outputs #0 through #5 to light up our six LEDs in order, and then use the output values #6 through #9 to light up the LEDs in the opposite order, like so:

LED Number Turned on by count value 4017 output pins 1: #0 3 2: #1 or #9 2 or 11 3: #2 or #8 4 or 9 4: #3 or #7 7 or 6 5: #4 or #6 10 or 5 6: #5 1

There are a number of ways to provide the clock signal. One nice way is to use a standard 555 timer chip.

Both the 4017 and the 555 are CMOS chips capable of operating with a 9 V power supply, so we’ll set things up (1) to use a convenient single 9 V battery and (2) to use a 555 timer chip.

555’s are almost as cool as Cylons. While I used the power-hungry NE555, you can also use the power-efficient version, the ICM7555. (See more

555 timer circuits here, here, here, and

here.)

We’ll build the circuit in a few separate blocks to keep things neat and orderly. All of the parts that we’re using are quite common; any decent electronics shop (i.e., not Radio Shack) should have everything that you need. (If you do have trouble locating parts, take a look at the list of “Suggested Parts” down below.)

Step 1: Let’s start by wiring up the 555:

Solder the 9 V battery connector where the battery is shown, with the negative (black) wire to pin 1 and the positive (red) wire to pin 8. We’ll refer to these points later as “Ground” and “+9 V”, respectively. (Yes, picky people, it’s an effective ground, not an earth ground.)

Pin 8 is connected to pin 7 through a 180 kilo-ohm resistor, and pin 7 is connected to pin 6 through a second a 180 kilo-ohm resistor. The 0.22 uF capacitor connects pin 6 to pin 1.

Use a wire to connect pin 2 to pin 6. Pins 4 and 5 should be left unwired.

Pin 3 is our “clock” output, which we’ll be taking to the 4017 in the next part of the circuit.

Note added: It’s an excellent (but optional) idea to test the output of the 555 at this point, to make sure that the clock signal is really coming out. You can do that as follows: take the output from the 555 and connect it, through a 330 ohm resistor, to an LED and then to ground. If everything is correct so far, the LED should blink rapidly.

Step 2: Wire up the inputs to the 4017.

There are quite a few connections to the 4017 chip, so we’ll split them into two diagrams for ease of reading.

First, connect the clock output from the 555 to the clock input at pin 14.

Besides the clock input, there are four other inputs to the 4017. Wire pin 16 to the + 9 V, either at pin 8 of the 555 or directly to the red wire from the battery connector. The remaining three connections are to the ground, so wire pins 8, 13, and 15 to the black wire from the battery connector or to pin 1 of the 555.

Step 3: Building some easy “OR” gates.

Connect a diode, such as a 1N914 or a 1N4001, to each of the ten decimal output pins of the 4017 and wire the cathodes of those diodes as shown, forming six outputs that will drive the LEDs.

Pin 12 is left unused.

[If you want to know why we’re using the ten diodes, please see the aside at the end of the story.]

Step 4: Driving the LEDs



You can hook your six LEDs directly to the outputs shown above; just connect the LED between where it says “For LED X” and ground, with the cathode side towards ground.

Well, that’s the easy way. It works, and it looks good. But if you look closely, it’s a little too perfect.

The lights in the original Cylons were incandescent, not LEDs, and the effect is quite different.

LEDs turn on and turn off very quickly. The result is that the lights in our circuit seem to blink on and off, rather than smoothly transition from one light to the next. In order to slow down the transitions, we can also use a low-pass driver circuit to drive each LED. To do this you will need six 47 k resistors, six 47 microfarad capacitors, six 2N3904 transistors, and one 330 ohm resistor.

A low-pass LED driver consists of a low pass filter and a simple NPN transistor amplifier.

To build one, begin by connecting one the outputs from the previous step (“For LED X“) to a 47 kilo-ohm resistor. The other end of the resistor connects to the base of a the transistor. (Look here if you need help identifying the Emitter, Base, and Collector of your transistor.)

The base of the transistor also connects to a 47 microfarad capacitor. The other end of the capacitor is connected to the Emitter of the transistor (labeled with an “E” in the diagram) and to ground (the negative terminal of the battery). The capacitor is probably a polarized type, meaning that it must be hooked up with the side labeled “-” (or a big stripe) towards ground.

To hook up the LEDs, start by attaching a single 330 ohm resistor to the + 9V supply. The LED connects from the 330 ohm resistor to the unused pin of the transistor, the Collector. (You can hook all six of the LED anodes to the same 330 ohm resistor, so you will only need one of those.)

Here’s what the completed circuit looks like. It’s actually a tiny circuit without much going on– not nearly as bad as I’m sure that I’ve made it sound!

You can see the battery on the snap connector, the 555 and 4017 chips, the six transistors, six capacitors, and six resistors of the output drivers, and six large LEDs. I used six giant (10 mm) orange LEDs that I got at the local shop for $0.40 each. I thought that the orange would complement the pumpkins nicely. In retrospect, it might have been better to use red ones.

Here is a close-up of the board, if you want a better look.

I made a little movie of the circuit operating in the dark, so that you can see the action of the low-pass filters, it’s pretty nifty. Take a look. (176 kB Quicktime .mov file)

Put the circuit in a plastic bag to prevent damage due to moisture inside the pumpkin.

It’s a Working Cylon! It looked awfully small, and not nearly imposing enough, so I propped it up on this toaster. (That helped.)

We also made an extra-large Cylon. Carving this one was much easier; these big pumpkins are just made for carving. The changes to the circuit are minimal. (1) The 330 ohm resistor was removed (shorted across), and (2) In place of each single LED, there are now four super-bright LEDs in series, for a grand total of 24 LEDs in the circuit. These are really bright.

Here’s the giant Cylon in his lit-up glory. If you really want to go for that 70’s look, you need to use a star filter, as in the photo on the right.

Repeat after me: “BY YOUR COMMAND!”

I made a little movie of this one operating, so you can see how it looks; it’s totally worth the effort to build one of these!

Take a look. (236 kB Quicktime .mov file, the same one that’s linked in the introduction.)

Have fun and Happy halloween!

Suggested Parts

Here is a partial list of parts you’ll need, which might give you a head start if you’re not used to shopping for electronic components. There are suggested part numbers from BG Micro where appropriate. You can get equivalent parts from other sources as well, for example Digi-Key. BG Micro does not sell individual resistors– they sell packs of 100 for $3. If you have neither a stash of resistors nor a local electronics shop that can sell you these, I suggest getting resistor assortment RES1363 from BG Micro for $10.95, which includes 10 each of 61 different resistance values. Approximate values for the resistors and capacitors are fine, but be sure to use matched (nominal) values for the six resistors and capacitors.

Description BG Micro Part No. Quantity Cost Each Total Cost NE555 or 7555 Timer Chip ICSNE555 1 0.39 0.39 CD4017 or MC14017B Counter Chip ICS4017 1 0.40 0.40 47 microfarad, 16 V electrolytic cap CAP1035 6 0.08 0.48 0.22 uF Cap CAP1007 1 0.13 0.13 Small signal diodes, e.g.,

1N914 or 1N4001 DIO1N4001 10 0.05 0.50 Regular Red LED LED1016 6 0.07 0.42 Bright Red LED



(optional, pricey) LED1060 6 0.35 2.10 2N3904 NPN transistor trN2N3904 6 0.06 0.36 3-1/4″x2-1/2 Protoboard BG Micro ACS1053 1 0.99 0.99 9V Battery Snap BAT1064 1 0.49 0.49 180 K resistor – 2 * – 47 K resistor – 6 * – 330 ohm resistor – 1 * –

*If you paid a dime, you got robbed.

Aside: Why use the diodes?

In the table above, we listed which LEDs are turned on by which of the 4017’s output pins. For example, LED 2 is turned on if the decimal counter reads #1 or #9, which are indicated by a “high” signal on pins 2 or 11 of the 4017. In order to perform the logical OR function, we will use a diode OR. A diode on each line points away from the chip, and the two cathodes are connected together to form the output. That way, current can flow away from the chip if either line is high, but neither pin is able to sink current. (You can, to some extent, just connect pins 2 and 11 together and call that your output for LED 2. However, if one pin is high while the other is low, current will flow out of one pin and into the other, and very little, if any, current will be available to drive an LED.)

There are four pairs of lines that need to be combined with a diode OR, so we obviously need eight diodes. If you were to use the circuit with only these eight diodes, you would find that the LEDs on the two ends (LEDs 1 and 6) are much brighter than the others. That’s because there is a voltage drop due to the OR-ing diodes, and so the output voltage on the two ends (LEDs 1 and 6) will be higher than for those in the middle. An easy fix is to just go ahead and add identical diodes to the two end outputs as well. So, you need ten diodes.

Update (9/30/2009):

We have designed and released an open-source kit called the Larson Scanner, which has a similar function to the circuit described here, but is (1) digital (2) more power efficient and (3) much easier to build.

You can find more pumpkin projects in our Halloween Project Archive.