Built-in project · no microcontroller

Decoder chaser

A 74HC14 oscillator clocks a 74HC161 counter and a 74HC138 decoder lights one LED of eight at a time. There is no microcontroller in it: the simulator solves the 21 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

AdvancedRuns in your browser. Free, and no account needed.

Decoder chaserlive0.000 s 0.00x
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.

How it works

There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.

sketch.ino
// Count, then decode: a 74HC161 and a 74HC138 light one LED of eight.
//
// 1. The clock. Gate 6 of the 74HC14 has a 100k resistor from its output back
//    to its input and a 4.7 uF capacitor from its input to ground. A Schmitt
//    input switches at two different voltages (about 2.8 V going up, 1.8 V
//    going down), so the capacitor chases the output up and down between them
//    and it oscillates: about 0.8 x R x C, a little under 3 Hz.
//
// 2. The count. The 74HC161 adds one on every rising edge of CP. All four
//    outputs change on the same edge: a synchronous counter.
//
// 3. The decode. Q0, Q1 and Q2 go to the 138's address pins A0, A1, A2, and
//    the 138 pulls exactly one of Y0..Y7 low: Y3 when the address is 3. Each
//    LED runs from 5 V through 330 ohms into one output, so the low one lights.
//
// Q3 is not used, so the light runs along the eight LEDs twice for every
// sixteen counts. Change C1 in the properties panel to change the speed.

Parts list

23 parts, plus the jumper wires. Every one is in the editor's parts bin.

How it is wired

23 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.

  • 5 V: 74HC14 Schmitt inverter pin VCC; 74HC161 4-bit counter pin MR; 74HC161 4-bit counter pin CEP; 74HC161 4-bit counter pin PE; 74HC161 4-bit counter pin CET; 74HC161 4-bit counter pin VCC; 74HC138 3-to-8 decoder pin E3; 74HC138 3-to-8 decoder pin VCC; Resistor, 330 Ω (1) pin 1; Resistor, 330 Ω (2) pin 1; Resistor, 330 Ω (3) pin 1; Resistor, 330 Ω (4) pin 1; Resistor, 330 Ω (5) pin 1; Resistor, 330 Ω (6) pin 1; Resistor, 330 Ω (7) pin 1; Resistor, 330 Ω (8) pin 1
  • Ground: 74HC14 Schmitt inverter pin GND; Capacitor, 4.7 µF pin 2; 74HC161 4-bit counter pin GND; 74HC138 3-to-8 decoder pin E1; 74HC138 3-to-8 decoder pin E2; 74HC138 3-to-8 decoder pin GND
  • 74HC14 Schmitt inverter pin 6Y; Resistor, 100k Ω pin 2; 74HC161 4-bit counter pin CP
  • 74HC14 Schmitt inverter pin 6A; Resistor, 100k Ω pin 1; Capacitor, 4.7 µF pin 1
  • 74HC161 4-bit counter pin Q2; 74HC138 3-to-8 decoder pin A2
  • 74HC161 4-bit counter pin Q1; 74HC138 3-to-8 decoder pin A1
  • 74HC161 4-bit counter pin Q0; 74HC138 3-to-8 decoder pin A0
  • 74HC138 3-to-8 decoder pin Y7; LED, yellow (8) pin C
  • 74HC138 3-to-8 decoder pin Y6; LED, yellow (7) pin C
  • 74HC138 3-to-8 decoder pin Y5; LED, yellow (6) pin C
  • 74HC138 3-to-8 decoder pin Y4; LED, yellow (5) pin C
  • 74HC138 3-to-8 decoder pin Y3; LED, yellow (4) pin C
  • 74HC138 3-to-8 decoder pin Y2; LED, yellow (3) pin C
  • 74HC138 3-to-8 decoder pin Y1; LED, yellow (2) pin C
  • 74HC138 3-to-8 decoder pin Y0; LED, yellow (1) pin C
  • Resistor, 330 Ω (1) pin 2; LED, yellow (1) pin A
  • Resistor, 330 Ω (2) pin 2; LED, yellow (2) pin A
  • Resistor, 330 Ω (3) pin 2; LED, yellow (3) pin A
  • Resistor, 330 Ω (4) pin 2; LED, yellow (4) pin A
  • Resistor, 330 Ω (5) pin 2; LED, yellow (5) pin A
  • Resistor, 330 Ω (6) pin 2; LED, yellow (6) pin A
  • Resistor, 330 Ω (7) pin 2; LED, yellow (7) pin A
  • Resistor, 330 Ω (8) pin 2; LED, yellow (8) pin A

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.