Glue Logic Safety System and Actuation
ME E4058 Mechatronics & Embedded Microcomputer Control, Columbia University
Team of 4 · Combinational logic · Safety-critical design
Not every decision in an embedded system should run through the microcontroller. Firmware can hang, crash, or ship with a bug, and I/O pins cost money on every unit you build. This case study was about the layer between the processor and the real world: glue logic. That means small combinational circuits built from AND, OR, NOR, and XOR gates, which do their job with no clock, no code, and no way to hang.
We designed two circuits, one for safety and one for I/O, and then watched the same sequencing idea drive real hardware.
1. Two-of-Three Voting for an Aircraft Airspeed Warning
The problem. An aircraft's low-airspeed warning can't depend on one sensor. A single failed sensor would either trigger false alarms or hide a real stall. The standard fix is triple modular redundancy: three independent sensors, and the warning fires only when at least two of them agree.
The design. Each pair of sensors feeds an AND gate, giving 1·2, 2·3, and 1·3. The three AND outputs are ORed together. The output goes HIGH whenever any two sensors agree, so one faulty sensor can't set off the alarm alone, and it can't silence a real one either.

Two-of-three majority voting circuit and truth table.
This is a majority function, the same voting pattern used in flight computers, nuclear plant trip systems, and railway signaling. It shows up in all of them because it tolerates a single-point failure in either direction.
2. Driving Four Outputs from Two Pins
The problem. We needed to switch four loads on in sequence, but the microcontroller in our budget had only two free outputs.
The design. A 2-to-4 decoder built from discrete gates. Two inputs give four possible states, and each state activates exactly one output:
A = NOR(1, 2). It is active only at (0, 0).
B = 1 AND (1 XOR 2). It is active only at (1, 0).
C = 2 AND (1 XOR 2). It is active only at (0, 1).
D = 1 AND 2. It is active only at (1, 1).
Stepping the two pins through (0,0) → (1,0) → (0,1) → (1,1) fires A → B → C → D, one at a time. The outputs are mutually exclusive by construction, so two loads can never be on at once, even if the firmware tries.

2-to-4 decoder circuit and truth table.
3. Seeing It in Hardware: Stepper Motor Phase Sequencing
We then physically built this circuit, then designed a second circuit to spin a stepper motor to actuate the safety system. A stepper motor turns by energizing its coils one at a time in a fixed order. Each new coil pulls the rotor forward one step. It's the same problem the decoder solves: four outputs firing in sequence, never overlapping.
We drove a stepper from the lab's function generator, with each clock pulse advancing one step. We watched the coil drive signals on the Keysight MSOX2014A's logic-analyzer channels, with the threshold set to 2.73 V.

Four stepper phase signals (D0–D3) captured on the oscilloscope's digital channels.
The capture shows the phases handing off in a steady rotation (D2 → D3 → D0 → D1), then repeating, with only one phase active at a time. The handoff order sets the rotation direction, and the clock frequency sets the step rate: speed up the function generator and the motor spins faster; reverse the sequence, and it spins the other way. Reading the step rate straight off the time base turned an abstract "pulses in, rotation out" block into something we could measure.
4. Why This Matters
Reliability: hardware safety interlocks keep working when the software doesn't.
Cost: a few cents of logic can replace a bigger microcontroller with more pins.
Determinism: the output is valid within gate propagation delay, with no interrupt latency or scheduling jitter.
Separation of concerns: firmware decides what to do, and hardware guarantees what can't happen.
Same pattern, real load: the one-hot sequencing we built with gates in the decoder is exactly what a stepper driver does to its coils.
The same thinking ran through the rest of the case study. We looked at safety interlocks in appliances, like a washer door lock that holds during any active cycle. We looked at why automakers use Hall-effect sensors for ABS wheel-speed sensing and crankshaft timing: they're contactless, sealed, and tolerate dirt and vibration. And we looked at how "back doors" that bypass designer-set limits can undo all of it.
5. Skills Demonstrated
Boolean algebra, truth tables, and combinational logic design
Redundancy and fault-tolerant architecture (TMR/majority voting)
I/O expansion with decoders
Stepper motor phase sequencing and logic-analyzer debugging
Thinking about safety-critical systems: which checks belong in hardware and which in software




Comments