Introduction: Drive LED's With a Crystal Oscillator
Our mission: make something that does something. Not as easy as it sounds.
A 9-volt battery driving an LM317 power-supply outputting 5 volts, driving a tiny sliver of crystallized rock into resonance at one-and-a-half thousand vibrations per second, divided in half, 8 times, by a binary counter, down to a speed of about six vibrations per-second, driving an LED.
Meaning, we made a light blink 6 times per second. Then we added two more LED's for different blink rates. All without a microcontroller, arduino, or attiny. And i'm happy to say, not one 555 was used. This was my design goal (since everybody uses 555's for everything).
Here's how to do it.
(you may need to give the animated gif at the top of this page a moment to load).
Step 1: Gather Parts & Tools
Cost: about $15, not including tools.
Free, if you come to Noisebridge and raid our component shelves, 2169 Mission St, San Francisco.
Parts you'll need:
-a breadboard, about $4
-McCoy M55310/08-B01A crystal oscillator, or any crystal oscillator running at anything under 2 kHz, about $1 (this frequency range might be hard to find, we only found one distributor)
-LM317 voltage regulator (any manufacturer), about $fiddy cent
-one or more LED's, different colors, about $1
-SN74LS590N binary counter with output register, or any binary counter with output register with 8 or more bits, $fiddy cent
-2 capacitors, about $1
-0.1 uf. (if you're using caps with capacitor encoding, the numbers on the caps will be 104 and 105).
-1 kOhm trimpot, $fiddy cent
-1 resistor, about 250 ohms, pennies
-9 volt battery, $2
-battery clip, $fiddy cent
-insulated hookup wire, non-stranded, about 22 gauge thin, $4
-hot sauce, priceless
Tools you'll need:
-frequency counter or oscilloscope
The photo shows some of the parts donated by JameCo and Instructables.
Step 2: Power Supply
The components in this project require a 5 volt power supply, but we only have a 9 volt battery. The LM317 will convert our battery to a stable 5 volt supply.
Hook up the 9 volt battery to the LM317. The pinouts might not be the same for every manufacturer, so be sure to check a datasheet for the company that made your LM317. You're going to connect the 2 capacitors, 1 resistor, and trimpot.
Connect your battery clip to your 9 volt battery. The black lead is battery minus; the red lead is battery positive.
Find the rows of sockets running along the full length of your breadboard, top and bottom. These are called "buses". Sockets in a row like that are all connected to each other.
Connect your 9 volt battery positive lead to one bus, and your battery minus lead to another bus. The rest of your circuit will connect to these buses.
Now hook up the LM317:
Insert the chip into the board as shown in the photo.
The pins are numbered 1, 2, 3, going left to right.
Now use a hookup wire to connect Pin 3 to the battery positive bus.
Then connect the other components:
The resistor goes between pin 1 (adjust) and pin 2 (output).
The 0.1 uF cap goes from pin 3 (input) to battery minus bus.
The 1 uF cap goes from pin 2 (output) to battery minus bus.
The trimpot goes from pin 1 (adjust) to battery minus bus.
You do not need a heatsink for this project, the currents are too low to heat up the LM317.
Once connected, we check for proper output. Make sure your voltmeter is on and set to DC VOLTS. Set range, if your voltmeter has that, to the smallest scale that's bigger than 5 volts (eg 10 or 20 or 100). Connect one hookup wire to the battery minus bus, and connect your voltmeter ground probe to the end of that wire. Then attach another hookup wire to the LM317 output (middle pin on the chip in the photo) and connect your voltmeter positive probe to that.
Twist the trimpot with a flathead screwdriver until you're getting exactly 5 volts, or as close to 5 as you can get.
If you're not seeing an output voltage on your meter, check the datasheet for the manufacturer of your LM317-- the pinouts might differ from ours. Then recheck all your connections.
Step 3: Add the Crystal
You'll need to find the proper pinouts or datasheet for whatever counter you're using. In our case, the pinouts were hiding in a datasheet containing pinouts for many crystal types. Digging up the info you need might be more challenging than actually building the project!
Crystal Oscillator datasheet for the McCoy M55310/08-B01A:
Ground pin (pin 8 for the McCoy) to the ground bus.
V+ pin (pin 14 on the McCoy) to the 5 volt output pin of the LM317 (pin 2).
Connect a wire to the crystal output pin (pin 1 on the McCoy).
Notice that with oscillators in the type of flat metal package we used, we need only three connections to the oscillator, even tho it has many more pins (14 pins in our case).
To test, make sure your meter is set to Frequency or Hz. Or set up your scope properly (that's beyond the scope of this Instructable). Connect your oscillator output (pin 1 in our case) and battery negative to your meter or scope, and ensure you've got a solid vibration coming out of the crystal. If you see a 60 Hz signal, that's just electrical hum in the air, NOT your oscillator.
Step 4: Add the Counter
Next, throw in the binary counter. Those connections can be a little tricky, so trace your wires carefully. If you're using the 74HC590 as we did, you'll need to:
-send the crystal output to counter pins 11 (Counter Clock) and 13 (Register Clock).
-pin 12 (Clock Enable) must be pulled low (meaning, connected to battery minus) to enable the counter.
-pin 8 to the minus bus.
-pin 16 to the 5 volt output of the LM317.
The crystal drives pin 13 to ensure the register (ie., output pins) updates with each count.
The pics show pinouts from two different datasheets, but it's the same part, same pins, slightly different names.
8-bit Counter datasheet
Step 5: Plug in the LED's
Now for the fun part, installing the LED's. You want to experiment plugging one LED into each output-register pin until you find the blink rates you like. You're going to connect the longer anode (positive) lead of the LED to the counter pin, and the shorter cathode (negative) lead of the LED to battery negative. You can see in the pic how we used a hookup wire to get the LED lead connected to the minus bus.
You can see in the SN74LS590N datasheet, the output pins are 1 through 7, and 15. If everything is working properly, you should see the LED blinking at different rates, depending on which output you connect it to.
Depending on your crystal frequency, some pins may blink too fast to be seen by the naked eye-- the LED will appear to be a steady on. Put some clothes on that eye.
We found no resistor was necessary to protect the LED from excessive current, we could drive it directly off the counter pins.
The pizza step is optional.
(give the animated gif on this page a moment to load).
We have a be nice policy.
Please be positive and constructive.