Introduction: Electronic Tribble, "Fuzzy Logic" Type

Remember way back in the early 1970s when you would watch Star Trek? Remember how much you wanted to have a Tribble of your very own? Well, now you can! You just have to build it ... using the stone knives and bear skins of 1970s era semiconductor microelectronics. These are instructions for how to build your own purring, electronic Tribble (almost just like from Star Trek) using digital CMOS Schmitt Trigger NAND gates as analog oscillators. The instructions include theory of operation and construction, electronic schematic diagram, parts and tools lists, and detailed, step-by-step description of how to assemble the project.

Back in the late 70s, when I was in high school, I used to build these and give them to girls I had a liking for. I even managed to get a date or two from some of the recipients. Heh, the life of a high school science geek. Well, anyway...

The first few specimens I built used three 555 IC oscillators slaved to each other. After those first few I'd made of 555 chips I started thinking about how to make an equivalent circuit out of fewer, cheaper, more clever parts. Like 4xxx series CMOS inverter gates. After all, almost anyone can build a three-oscillator circuit using off-the-shelf oscillator IC chips (or a microcontroller, for the more sophisticated).

Step 1: Theory (such As It Is) - Waveforms

As noted above,this version of the electronic Tribble consists of three simple oscillator circuits: main "tone", modulation, and "breathing cycle". The main tone is at a few hundred Hertz, the modulation is at a couple dozen Hertz, and the breathing cycle is at about a third of a Hertz. The oscillators are made of a form of CMOS gates and simple RC networks.

Why CMOS? High circuit impedance and very low current requirements lead to long battery life and, as we'll see below, lower parts cost and better "character" in the finished toy. Why CMOS 4xxx series? Because they can be run from a wide voltage supply: from 3 to 18 Volts -- just the thing for a toy using a 9V battery as a supply.

Aside from its extremely low current requirements digital CMOS provides a few other advantages in this analog application. First, the extremely high impedance of CMOS circuits leads to increased "noise susceptibility" -- the opposite of noise immunity -- which is something that we want in this application. Nose susceptibility adds character to the Tribble. The extremely high impedance and low internal leakage of CMOS also allows us to use small capacitor values and high resistor values in our RC networks. Resistors (of a given precision and thermal dissipation capacity) generally cost the same regardless of their Ohmic value. The same is not true of capacitors; the higher capacitances tend to cost more, and be of larger physical size, than the lower ones.

But perhaps the main attraction of using CMOS gates is the satisfaction of knowing that you are using digital logic blocks to do an analog task. A corruption of logic ... so to speak.

Some of you may have seen oscillator circuits that use simple inverters, and you could certainly build our three oscillators from a single hex inverter IC, but then you would still need a way of multiplying (AND-ing) the outputs together. Worse, since the inverter circuits require two gates per oscillator they are not the most clever, parsimonious way to build this particular toy. Therefore, the IC that I've selected for this version of the Tribble is the 4093B quad 2-input NAND Schmitt Trigger. It can provide all three oscillators as well as do the multiply/mixing of the signals.

(Actually, I would have used a hex Schmitt Trigger inverter, the 40106B, if I could have found one at the store. As I'll show below an oscillator using a Schmitt Trigger needs only a single inverter. Perhaps I'll do that one another day because it is even more interesting than the current design as an example of Micky Mouse logic and applied bullshit.)

Figure 1 shows the voltage vs. time graph of the three signals we want to mix (and the mixed result). Red traces are the RC voltages. Blue traces are the outputs from the "inverters" (actually NAND Schmitt Trigers) of the stages.

Figure 2 shows the three signals multiplied (AND-ed) together.

Note that the frequency ratios in the figures are not to scale.

Step 2: Theory (such As It Is) - Electronics

Figure 1 is the schematic diagram of the circuit that will do the creation and multiplying of the waveforms shown above.

How does the circuit above function? Take a look at the first oscillator section, the one with NAND1, R1, and C1. The first thing to note about this section is that the NAND1 gate has its inputs joined together making it act as a simple Schmitt Trigger inverter. When the circuit is turned on by closing switch S1 the output of NAND1 goes high. This charges the capacitor C1 through the resistor R1. When the voltage on C1 gets up to the "logic high" trigger threshold of NAND1's inputs then NAND1 switches to a low output. The capacitor C1 then discharges back through the resistor R1 until the voltage on C1 goes below NAND1's "logic low" input threshold, which causes NAND1 to switch back to having a high output. The cycle then repeats.

The following two oscillator stages (NAND2 and NAND3) have a similar operation except that their inputs are not joined together to make them into inverters. Instead one of the inputs on each NAND is used as an "enable" line with a signal coming from the first stage. When the "enable" inputs of NAND2 and NAND3 are held high then NAND2 and NAND3 are allowed to oscillate just like the NAND1 stage does (but with different time constants). But when the "enable" inputs of NAND2 and NAND3 are held low then their outputs are forced to be high since the only way their outputs could go low would be for both inputs to be high. The NAND truth table below spells it all out.

Figure 2 shows the NAND truth table.

The final stage, NAND4, simply takes the second and third stages and multiplies them together. The result is a modulated signal (from the "tone" and "modulation" oscillator circuits) that cycles on and off as if the Tribble were breathing. This signal is then passed, through resistor R4, to a simple emitter follower amplifier that drives a speaker (yeah yeah, I know there is supposed to be a diode in parallel with that inductive load ... but the circuit works just fine without it).

The last aspect of the circuit is the variable capacitor C4 in the third oscillator stage. This capacitor is added in parallel with C3 and is constructed of two sheets of copper foil with a compressible spacer between them. The purpose of C4 is to add a bit of "character" to the sound made by the toy. When the foil plates are squeezed together the gap between them is decreased which will increase the capacitance of C4 (capacitance is proportional to plate area and inversely proportional to plate separation). Increasing the combined capacitance of C3 and C4 lowers the frequency of the third stage "tone" oscillator a bit. The effect is small but noticeable.

The use of Schmitt Triggered logic is necessary because our oscillators require the built in hysteresis that it has in order to have the required phase delay in the feedback loop. The hysteresis is in the form of a separation between the voltage levels required for logical low and high states. Ordinary CMOS logic has transition from low to high logic at about the midpoint of the difference between supply and ground voltages. When an input is above half the supply voltage then it is interpreted as high. When an input is below half the supply voltage then it is interpreted as low. Schmitt Triggers, on the other hand, interpret inputs differently. In order for an input to be considered high it must go above the voltage midpoint plus half of the built in hysteresis voltage. And for an input to be considered low it must go below the voltage midpoint minus half of the built in hysteresis voltage. It is the hysteresis "dead zone" that allows oscillation.

An oscillator stage like one of the three described above that was made of ordinary CMOS logic would simply settle down to the voltage midpoint and not oscillate properly (but it would still draw current). Whereas one made of Schmitt Triggers will oscillate as required. Ordinary CMOS logic (inverters, for instance) can be made to oscillate as used here but additional inverters/buffers are required to compensate for the lack of internal voltage hysteresis. These additional gates would increase our gate count beyond what is available on a single 4xxx series IC. So we won't do things that way, we'll use Schmitt Trigger gates instead.

Step 3: Construction

First, read all the way through the construction steps so you have an idea of how things go together, then wrangle your parts and tools.

Figure 1 shows the collection of tools and parts you'll need for assembling the Tribble's electronics and Figure 2 shows the collection of tools and parts you'll need for assembling the Tribble's fur fabric case.

* soldering iron, solder, solder wick
* diagonal cutters
* wire stripper
* needle nose pliers
* X-acto knife
* X-acto saw (only used to cut perf board)
* cloth cutting scissors
* sewing pins
* sewing needle, thread

* 1 2" by 1.5" patch of G10 perf board with holes on 1/10 inch grid (with or without copper pads on back side)
* 1 3" by 3" plastic "card" (I used the lid to a take-out container) or scrap of G10 board
* 2 3" by 3" squares of copper foil
* 1 SPST momentary close push button switch (needs to be tallest component on circuit board)
* 1 small speaker (~1" dia., 8 Ohm, 100 mW)
* 1 14 pin DIP socket
* 1 4093B CMOS quad 2-input NAND Schmitt Trigger gate IC
* 1 2N2222 npn general purpose transistor (almost any general purpose npn will do)
* 3 22M Ohm resistors (1/4 watt or 1/8 watt, any tolerance -- whatever's cheap and available)
* 1 10k Ohm resistor (1/4 watt or 1/8 watt, any tolerance -- whatever's cheap and available)
* 1 220nF, 10V capacitor (choose small and cheap)
* 1 2.2nF, 10V capacitor (choose small and cheap)
* 1 68pF, 10V capacitor (choose small and cheap) { I had to use 47pF and 22pF in parallel because I did not have 68pF handy }
* 1 terminal with leads for 9V battery
* 1 9V battery
* 22 AWG insulated solid core wire
* a few inches of small insulating tubing (~1/16 inch dia heat shrink or ~1/32 inch teflon)
* small quantity of double-stick foam tape
* polyester batting "stuffing"
* 1 4" by 3/4" Velcro (choose color to match fur)
* 1 9" by 18" patch of suitable fur fabric

Step 4: Step 1: Parts Layout

Lay out parts on perf board to get an idea for how they will all fit together (and stay out of each other's way). I used a perf board with small copper pads at each of the holes because they can be helpful for anchoring parts. Thread the leads through the holes so that the parts are arranged something like in Figure 1.

You may want to bend the part's leads slightly so that they do not fall out of the perf board too easily. You may also want to eventually anchor the speaker's magnet side to the perf board by means of a small patch of double-stick tape or it will flop around in an annoying way. Warning: do not place the CMOS IC on the board yet! Place only the 14 pin DIP socket and keep the IC in its protective packaging until you are finished with building the circuit board.

Figure 2 shows a front photo of my parts layout.

Figure 3 shows a rear view of the same parts on the circuit board.

Note that I used a 47pF capacitor in parallel with a 22pF capacitor for C3 because I did not have a 68pF handy. It makes no real electrical difference.

Step 5: Step 2a: Lead Bending & Soldering - C1, C2, C3

Figure 1 is an illustration (x-ray view from front side of circuit board) of how the parts are to be arranged and wired together. Don't worry, we'll go through things step-by-step.

Start by wiring the ground leads of C1, C2, and C3 to pin 7 of the DIP socket. This will form a sort of "ground bus", anchor the capacitors, and get some of the wires out of the way. Then connect C1 to R1, C2 to R2, and C3 to R3 as shown schematically in Figure 2 and as seen from the rear side of the board in Figure 3.

Step 6: Step 2b: Lead Bending & Soldering - Stage 1

Next, wire up the rest of the first oscillator stage (R1, C1) as shown schematically in Figure 1 and as seen from the rear side of the board in Figure 2.

Insulation on the leads is optional since they can be bent such that they do not short with any other connectors.

Step 7: Step 2c: Lead Bending & Soldering - Stage 2

Next wire up the second oscillator stage, shown schematically in Figure 1 and as seen from the rear side of the board in Figure 2.

You will need to add insulating tubing to the leads shown schematically in purple to prevent short circuits.

Step 8: Step 2d: Lead Bending & Soldering - Stage 3

The third oscillator stage is similar to the second one. It is shown schematically in Figure 1 and as seen from the rear side of the board in Figure2.

Again, you will need to add insulating tubing to the leads shown schematically in purple to prevent short circuits.

Step 9: Step 2e: Lead Bending & Soldering - Output

Next wire up the output stage, again shown schematically in Figure 1 and as seen from the rear side of the board in Figure 2.

Easy, short leads, no insulation needed.

Step 10: Step 2f: Lead Bending & Soldering - Power & Ground

Power and ground wiring are next. Use 22 AWG insulated solid core wire for the leads shown schematically in purple to prevent short circuits. The red lead from the battery goes to one terminal of the switch S1. The other terminal of S1 goes to both pin 14 of the DIP socket and to the collector of the transistor Q1.

Shown schematically in Figure 1 and as seen from the rear side of the board in Figure 2.

Step 11: Step 2g: Lead Bending & Soldering - Speaker

Connect the speaker's leads to the emitter of transistor Q1 and to the ground at pin 14 of the DIP socket. The speaker probably came with insulated leads but if it did not then use some of the 22 AWG solid core insulated wire. Attach the magnet of the speaker to the (front side of the) perf board using double-stick foam tape.

Arrangement shown schematically in Figure 1 and as seen from the rear side of the board in Figure 2.

Step 12: Step 2h: Lead Bending & Soldering - Variable Capacitor

Now you will need to construct the variable capacitor C4. Take each of the two 3 by 3 inch sheets of copper foil and solder an insulated lead to a corner of it. Use about 6 inches of the 22 AWG solid core insulated wire for each piece of foil.

Next "sandwich" one end of a 4 by 12 inch patch of the fluffy stuffing material between the foil plates. The padding material should be about 1/4 to 1/2 inch thick when uncompressed. Select one side of the capacitor C4 to be "ground" and keep track of it -- this will be the upper side of C4 and will be facing out and away from the toy and towards the outside world. Place the 3 by 3 inch piece of plastic "card" (or scrap circuit board, or whatever) against the outside of the lower capacitor plate (the one that is NOT ground) this will serve to stiffen the foil "sandwich" and will be used to push on the power switch. Be sure that the stiffening plate is not between the foil pieces. (Since I was using copper foil with (optional) adhesive on it I simply stuck the foil to the plastic card.) Then wrap the rest of the 3 by 12 inch patch of padding around the capacitor plates to make a "sandwich roll". See illustration and picture below for visual aid.

Figure 1 shows the design of variable capacitor C4.

Figure 2 shows the variable capacitor C4 un-rolled.

Figure 3 shows the variable capacitor C4 all rolled up.

The resulting stack should be quite squashable.

Step 13: Step 2i: Lead Bending & Soldering - Finish

With the variable capacitor in hand, it is time to finish the circuit build.

Attach the variable capacitor C4 to the circuit in parallel with the capacitor C3 as shown schematically in Figure 1 and seen in the photo Figure 2.

You may need to "boost" the height of the switch S1's button so that it gets pressed closed easily when the variable capacitor C4 is "mashed" down on the electronics board. Do this by adding a shim made of a small scrap of G10 board (or whatever) to the top of the switch. Attach the shim to the switch's button with a small bit of double-stick foam tape.

At last. Install the CMOS 4093B IC in the 14 pin DIP socket, plug in the 9V battery and test the circuit. It should sound something like the mp3 file found at this link: <tribble.mp3tribble.mp3>. Try "mashing" the variable capacitor (you will need to insulate it, and all the rest of the electronics, from your hand) and note the change of pitch.

Once the electronics are working up to expectations it is time to build a fur casing, stuff the electronics into it, and finish the build.

Step 14: Step 3a: Case Construction

Figure 1 shows the tools and parts needed for construction of the fur fabric case for the Tribble.

Cut the fur fabric into two 9 inch diameter circles as in Figure 2. You can use a pie plate, or similar, as a template for the circles. Then place the circles against each other with the furry side of the fabric facing each other and pin them in place as in Figure 3.

Join the fabric circles to each other by stitching about 80% of the circumference of a circle 1/2 inch in from the edge of the fabric. Leave about a 5 inch gap in the stitched circle. The gap is present to allow the fur fabric "bag" you have just made to be turned inside-out (right-side-out, actually) -- thus placing the fur on the outside -- and to allow the stuffing and electronics to be inserted.

Step 15: Step 3b: Case Construction - Finish

Turn the fur fabric "bag" inside-out so that the fur is on the outside. You may now need to spend a bit of time picking at the seam to free the fur trapped in the stitching. Wrap the circuit board in a bit of polyester stuffing to insulate it from the metal case of the battery and carefully stuff the electronics "module" into the fur fabric bag taking extra care with the foil of the variable capacitor C4. Make sure that the battery will be accessible from the opening in the case. Add more stuffing until Tribble is of the correct shape.

After the electronics and stuffing have been inserted into the "bag", sew a 4 inch strip of 3/4 inch Velcro onto the outsides of the its opening. You might want to remove the fur, as shown in Figure 1, under where the Velcro is to be attached before stitching it in place. You may also want to stitch the edges of the opening closed a little to reduce its size. The opening with Velcro closure will be the portal through which the 9V battery can be changed so it does not need to be big enough to get the whole electronics module through once the electronics are stuffed inside. The Velcro will get (mostly) hidden when the portal is closed because it will be folded in. Figure 2 shows confirmation of battery access.

Close the Velcro on the access port by folding it in and sticking it together and you are done. If nothing went wrong the electronic Tribble should now be a functioning stuffed toy.

Figure 3 shows the finished electronic Tribble plush toy.

The Instructables Book Contest

Participated in the
The Instructables Book Contest