Aug 18, 2016

Project 04: the Multi-LED flasher

Tags

LED, flasher, blinker, pulser, oscillator, digital, 4060.

Difficulty Rating

3 on my scale.

Purpose

OK, this next one is a leap. It uses some new parts. Like our starting circuit, it starts out as an LED flasher. And like that, it can be modified to do more things. But instead of using transistors, it uses an Integrated Circuit ("IC" or "chip"). And it can flash more than one LED, with a more complex pattern.

Bill of Materials

In this circuit, the IC (integrated circuit) does practically all of the work. As its name says, all of the things that need to get done are "integrated" into that little sealed package. There are hundreds of microscopic transistors and resistors inside of it. It has many leads or "pins" coming out of it, to give circuit-builders many options about connecting it in different ways.

LabelDescriptionImage
ICSN74HC4060N or CD74HC4060E

There are many other versions of the "4060" IC. But only one of the two versions listed above will work in this circuit.
R1Resistor, 100 kilohms (= 100,000 ohms).

Color stripes: brown-black-yellow.

150 kilohms or 220 kilohms would be OK, too.
C1Capacitor, 22 nanofarad (= 0.022 microfarad).

I'm showing a ceramic disc here. But any type of capacitor will work as long as its value is around 22 nanofarads. A 22-nanofarad capacitor is typically labeled "223".
LEDsGreen-light-emitting, small size (3mm).

Seven (7) of them. The circuit will work with less of them, too.

Either blue, white, or green LEDs will work with this circuit. If you like, you can use a mix of white, blue and green LEDs. Your LEDs may have a clear plastic body instead of a color-tinted body.

The next parts are jumper wires. You can buy them pre-made. Or, you can make your own using some 22 or 24-gauge solid tinned-copper wire.

The pre-made jumpers have lengths in increments of 0.1-inch (1/10 of an inch), because the holes on breadboards are 0.1-inch apart. The pre-made jumpers under 1-inch come in lengths from 0.1 to 0.9-inch. The longer ones come in sizes like 1, 2, 3, 4 and 5 inches. When a pre-made jumper is labeled "1-inch", that means it will plug into breadboard holes that are 1-inch apart.

For this project, we only need two sizes - so you might just make these yourself. As we do more mods, we'll need more jumpers, and in different sizes too.

J1Jumper, 0.8 inch

0.9 or 1.0-inch would work too.
J2Jumper, 0.4 inch

And finally, these general parts...

Solderless plug-in breadboard
AA carbon-zinc cells.

Two (2) of them.

AAA cells will work too.
Battery holder for the two AA cells.

It comes in two different styles: the cells are inserted side-by-side, or, one on top of another. Either one is OK.

If you're using AAA cells, then your holder will be a little smaller, and made to fit AAA cells.

Style 1:

Style 2:


Assembly

Step 1

We'll plug the IC into the solderless breadboard. But first, take note of a few things:

  • The IC's notch goes towards the left.
  • The IC should be centered over the ravine of the breadboard.
  • The left end of the IC should be flush with the left edge of the breadboard.


Step 2

Insert jumper J1. Bend it around the IC, or let it pass on top of the IC.


Step 3

Insert jumper J2, resistor R1, and capacitor C1.


Step 4

Insert the LEDs. Take note: orient them as shown. Remember that they're polarized - they have two leads, one is positive, the other is negative. The negative lead is by the "flat" of the LED's skirt.

Here's the LEDs close up. Take note of the orientation of the "flat" on each LED.


Step 5

Finally, attach the battery wires. Be careful: Do not to mix up the red (+) and black (-) wires! Do not insert them in the wrong holes! Getting this step wrong can damage the IC.

Success

The LEDs will keep flashing on and off, non-stop. Some LEDs flash quickly, some flash slowly. But it's a complex pattern, and very eye-catching!



Schematic

I realize the schematic might mean nothing to absolute beginners. But it does quickly communicate many details to those who know how to read it. If you've never before seen a schematic, maybe this will be educational.

I labeled the circuit nodes (pin1 to pin16) to help me explain how the circuit works.

Images

Typically, we analyze how a circuit works by studying the waveforms. And when the circuit design is centered around an IC, we study the waveforms at each of the IC's pins. So I'll include these. But the circuit activity is more easy to see by looking at the LED waveforms, so I'll include these too.

IC Waveforms

Here are voltage waveforms of nodes pin1 thru pin7 and pin13 thru pin15. These pins are output voltage pulses that are driving the LEDs. (The other nodes waveforms are uninteresting).


Click on the image to see a larger version.

This circuit's nodes have a very wide range of frequencies. The higher-frequencies (faster moving pulses) shown at the top of the image are blurry. Here's another image of all of the same nodes, but zoomed in 80x, to clearly see the faster pulses.


Click on the image to see a larger version.

LED Waveforms

These waveforms show when each LED lights up. When a waveform voltage is "high" (at 3 volts), the LED is on and lit up brightly. And when a waveform voltage is "low" (at 0 volts), the LED is off. There are seven (7) LEDs in the circuit. In the chart, I refer to the fastest-blinking LED as Led7.

All of these are taken from the circuit simulator software, and not from an oscilloscope connected to a live circuit. So they may be very slightly off from reality, but accurate enough.

How Does It Work

Generalities

The IC (integrated circuit) is the heart of this design. There are many different kinds of ICs. The proper name of this IC is "74HC4060 14-stage asynchronous binary counters and oscillator" -- wow.

As that long name implies, and as mentioned above, inside that little chunk of plastic, the IC contains a complex circuit, using around a 170 transistors (by my estimate - they don't disclose the actual number). That internal complexity allows us to make working circuits that are relatively simple to build.

An easy way to learn how this IC works is to study its internal block diagram:


Internal block diagram of the IC.
Click on the image to see a larger version.

Each of those square, triangle, and half-ovals are themselves sub-circuits, each containing 4 to 8 transistors (the number varies by sub-circuit). Each square is a binary counter (or "toggle flip-flop"). The triangles are "buffers". The half-ovals are "NAND gates". These are common digital "building blocks".

Learning about these digital building blocks would be taught in an intro-level digital electronics course.

So this IC is using a lot of these simple digital building blocks, strung together, to form a complex circuit. In fact, a lot of digital ICs are designed just like this -- many little blocks strung together or inter-connected to get a particular complex circuit.

Circuit Family

This project is basically using the IC as it was intended to be used. So I would start by calling it like the IC's name: oscillator and binary counter. Although the IC wasn't intended to directly drive LEDs, it can! (as long as the input voltage isn't too high. If we supplied it a voltage higher than 3 volts, the IC would quickly overheat and be destroyed.)

So then we can tack on something about LEDs, and call it an "oscillator, binary counter, multi-LED flasher".

What's extra interesting about this circuit is how the LEDs are connected to the IC. The LEDs are "bridged" across the IC output pins. Instead of one IC pin driving one LED, it has one IC pin drive 2 or more LEDs. This makes the flashing pattern more visually interesting.

IC Sub-circuits

The IC has two sections inside.

  • Oscillator
  • Counters

The oscillator, we discussed in Project 1. In this project, the oscillator is mostly inside the IC (made up of the triangle and half-oval shown in the bottom-left corner of the IC block diagram). Except for resistor R1 and capacitor C1: The resistor and capacitor values are chosen by the designer to set the oscillator frequency. The frequency is many times higher (faster) than what we need at output pins, because the IC has long string of counters that divide down the pulses. We want the output pulses to flash the LEDs at rates that we can easily see (under 20 flashes per second).

The counters are a string of 14 flip-flop circuits (the square blocks in the IC internal block diagram). Each flip-flop sends out one complete pulse when its input receives two pulses. That means each flip-flop is a divide-by-two stage: The output pulse is half the speed of its input pulse. So by stringing together 14 of them, the final output is much, much slower than the oscillator driving that first flip-flop at the front of the string.

I chose R1 = 100k and C1 = 22nF to make the IC oscillator run at about 120 hertz, or 120 pulses per second. The first four counters divide this fast frequency down, so the output pulse at pin 7 (for LED7) runs at about 15 flashes per second. The next counter in the chain feeds pin 5 (re: LED3, LED4) which runs at half of 15, or 7.5 flashes per second. And the divide-by-2 continues on, down the string of counters.

History

In the late 1940's, soon after transistors became available, the general idea for an Integrated Circuit arose. But it took many years before the technology existed to actually make an IC. Many people contributed to the technologies that were needed to make ICs. The first working IC prototypes were made in 1958 by Jack Kilby. Robert Noyce and others also deserve credit for some key innovations during this time. In 1959-1961, ICs sold for around $450 to $1000 each, the main customers were U.S. military and space programs. By the mid-1960s, the cost for ICs dropped to $20-30 each. The military and "space age" fed a lot of development, improvement, and cost-reductions. By 1970, ICs were selling at Radio Shack for $1.50 to $3.50.

The IC in this project, the SN74HC4060, belongs to the "High-speed CMOS" family that was first sold in the late-1990's. (CMOS is an acronym that means complementary-symmetry metal-oxide semiconductor.)

Simple Mods

Here are some pretty basic mods (modifications) we can easily do.

  1. LED Color — The circuit will work with either green, blue or white LEDs. What about red, yellow, or orange LEDs? I discuss this farther down.
  2. Flash Rate — We can change the rate or frequency of the pulses several ways.
    • R1 — Using a higher (or lower) value for R1 will slow down (or speed up) the rate.
    • C1 — Using a higher (or lower) value for C1 will slow down (or speed up) the rate.
  3. Adjustable Flash Rate — We could add in series with R1 a "variable resistor" (technical name: rheostat) or more practically, a potentiometer using its leads 2 and 3. I discussed the potentiometer in Project 1: Hack 01-02.
  4. Light-sensitive Flash Rate - We could add in series with R1 a photoresistor. I discussed the photoresistor in Project 2: Hack 02-02.

Other Color LEDs

Red, yellow, or orange LEDs operate a lower voltage than green, blue, and white LEDs. This difference is important in this circuit because the IC drives the LEDs directly. The "low-voltage" LEDs will draw too much current that would overheat the IC. The simple solution would be to lower the power supply voltage (the battery) from 3 volts to 2 volts. However, a 2-volt battery is not readily available. Another almost-as-easy solution is to put a resistor in series with our 3-volt battery. The resistor will limit the overall current and keep the IC from overheating. A 51-ohm resistor would be a good value.


← Previous ArticleNext Article →
Home Page

No comments:

Post a Comment