Fireplace ControlProjectCombinational Logic
On this page

Activity 2.2.5 — Fireplace Control Design Challenge

flowchart LR
    subgraph Inputs["Safety Sensors"]
        T["T<br/>Thermocouple"]
        P["P<br/>Pilot Light"]
        O["O<br/>Overheat"]
        M["M<br/>Manual Switch"]
    end
    subgraph Logic["Logic Circuit"]
        AND["4-input AND"]
    end
    subgraph Outputs["Outputs"]
        G["G<br/>Gas Valve"]
    end
    T --> AND
    P --> AND
    O --> AND
    M --> AND
    AND --> G
    style Inputs fill:#1A1A2E,color:#E8E8F0
    style Logic fill:#C9A227,color:#1a1a2e
    style Outputs fill:#1A1A2E,color:#E8E8F0

Learning Objectives

By the end of this lesson, students will be able to:

  1. Apply the systematic design process to a real-world combinational logic problem
  2. Define inputs and outputs based on a system specification
  3. Create a truth table from word problem requirements
  4. Simplify Boolean expressions using K-maps
  5. Design and implement a working circuit

Vocabulary

Vocabulary (click to expand)
TermDefinition
Design ProcessSystematic approach: define inputs/outputs → truth table → Boolean expression → simplification → circuit
Safety InterlockA mechanism that prevents equipment operation when unsafe conditions exist
Truth Table to CircuitThe complete design process from requirements to working hardware
BreadboardingBuilding a circuit on a temporary prototyping board

Part 1: The Design Challenge — Fireplace Control

Scenario

You are an engineer at a company that manufactures gas fireplace control systems. Your team needs to design a safety control system that ensures the gas valve only opens when ALL safety conditions are met.

System Requirements

A gas fireplace has the following safety inputs:

InputDescriptionLogic Level for “Safe/OK”
TThermocouple (detects flame)1 = Thermocouple generating voltage (flame present)
PPilot light sensor1 = Pilot light is lit
OOverheat switch1 = Normal temperature; 0 = Overheat detected
MManual ON/OFF switch1 = ON; 0 = OFF
OutputDescriptionLogic Level
GGas valve control1 = Open gas valve; 0 = Keep closed

Safety Logic Rules

The gas valve should open (G = 1) ONLY when:

  1. Thermocouple is OK (T = 1) AND
  2. Pilot light is lit (P = 1) AND
  3. Overheat is NOT detected (O = 1) AND
  4. Manual switch is ON (M = 1)

In other words: G = T · P · O · M

Key insight: Safety systems use AND logic — ALL conditions must be met (safe) for operation. This is called “fail-safe” design — if any input fails or goes unsafe, the system turns off.


Part 2: Design Process Step-by-Step

flowchart TD
    A["Step 1: Define<br/>Inputs & Outputs"] --> B["Step 2: Create<br/>Truth Table"]
    B --> C["Step 3: Write Boolean<br/>Expression"]
    C --> D["Step 4: Simplify<br/>(K-map)"]
    D --> E["Step 5: Draw<br/>Circuit"]
    E --> F["Step 6: Build &<br/>Test"]
    style A fill:#C9A227,color:#1a1a2e
    style F fill:#C9A227,color:#1a1a2e

Step 1: Define Inputs and Outputs

We’ve already done this:

Inputs:

  • T = Thermocouple (1 = OK/flame)
  • P = Pilot sensor (1 = lit)
  • O = Overheat switch (1 = normal)
  • M = Manual switch (1 = ON)

Output:

  • G = Gas valve (1 = open)

Step 2: Create Truth Table

With 4 inputs, we have 16 possible combinations (2^4 = 16 rows).

TPOMG (Output)
00000 (all off)
00010 (no flame)
00100 (no flame)
00110 (no flame)
01000 (no flame)
01010 (no flame)
01100 (manual off)
01110 (no main flame)
10000 (no pilot)
10010 (no pilot)
10100 (manual off)
10110 (no pilot)
11000 (overheat)
11010 (overheat)
11100 (manual off)
11111 (ALL conditions met!)

Step 3: Write Boolean Expression

Only one row has G = 1: T=1, P=1, O=1, M=1

Minterm: G = T · P · O · M

This is already in simplest form! No K-map needed.

Key insight: In this case, the “all 1s” minterm is the only case where output = 1, so no simplification is possible. But we’ll still verify with K-map.

4-variable K-map with only m15 = 1:

CD=00CD=01CD=11CD=10
AB=000000
AB=010000
AB=110000
AB=100001

Only one 1 at position 15 (1111). Can’t group with anything else. Expression from K-map: T·P·O·M

Same result! ✓

Step 5: Draw Circuit

Circuit: Four inputs (T, P, O, M) all go to a 4-input AND gate → output G

Step 6: Build/Implement

Use:

  • 4 switches for inputs
  • 4-input AND gate (or cascaded 2-input ANDs)
  • LED for output

Part 3: Adding a Warning LED

Let’s extend the design: add a warning LED that turns ON when the fireplace is in a dangerous condition (gas is on but shouldn’t be for any reason).

Actually, better: Warning LED (W) = ON when conditions are NOT safe but could become safe, vs OFF when clearly unsafe.

Revised Requirements

OutputCondition
G (Gas Valve)ON only when T=1, P=1, O=1, M=1
W (Warning LED)ON when M=1 but (T=0 OR P=0 OR O=0)

This means: W = M · (\overline{T} + \overline{P} + \overline{O})

Simplify: W = M · (\overline{T} + \overline{P} + \overline{O}) = M · (T·P·\overline{O})’ [using De Morgan’s]

Truth table for W:

TPOMW
00000
00011 (no flame, but manual on)
00100
00111
01000
01011
01100
01111
10000
10011
10100
10111
11000
11011 (overheat!)
11100
11110 (all safe, no warning)

Using K-map simplification, W = M·\overline{T} + M·\overline{P} + M·\overline{O} = M(\overline{T} + \overline{P} + \overline{O})

This can also be written as: W = M · (T·P·\overline{O})‘


Part 4: Hardware Implementation

Components Needed

  1. Logic Circuit:

    • 4-input AND gate (e.g., 74HC21 or cascade 3-input ANDs)
    • OR gate for warning logic
    • NOT gates for inversions
  2. Input Devices:

    • 4 SPST switches for T, P, O, M
    • Pull-down resistors (10kΩ) on each input
  3. Output Devices:

    • Green LED for gas valve (G)
    • Red LED for warning (W)
    • Current-limiting resistors (330Ω)

Circuit Diagram (Conceptual)

Vcc
 |
R(10k)
 |---[T switch]---|→ [4-AND]---|→ [G LED]
 |                |
 |---[P switch]---|→ [GND]
 |                |
 |---[O switch]---|→ [GND]   
 |                |
 |---[M switch]---|→ [GND]

Warning circuit:
[M]---+---[OR]---+---[W LED]
[\overline{T}]--|          |
[\overline{P}]--|          |
[\overline{O}]--|-----------|

Build Steps

  1. Insert AND gate IC into breadboard
  2. Connect Vcc and GND to IC
  3. Connect switches to inputs with pull-downs
  4. Connect LEDs with current-limiting resistors
  5. Test: All switches must be ON for green LED; with manual ON but others off, red LED should light

Key insight: Always include pull-down (or pull-up) resistors on switch inputs to ensure defined logic levels when switches are open.


Practice Problem — Fireplace Design

Problem: Add a “pilot override” feature that allows the pilot light to stay lit (P = 1) even when the main manual switch is off. This is useful for lighting the pilot without full operation.

What additional input is needed, and how would you modify the truth table and circuit?

Show Solution

New Input: Let’s call it S (Special/Pilot mode)

When S = 1: Pilot can stay lit even without M (manual ON) When S = 0: Normal operation (same as original)

New truth table with S (5 inputs = 32 rows):

With S=1 and M=0:

  • If T=1, P=1, O=1, S=1: This is pilot mode, gas valve OFF (M=0)
  • Need separate output for pilot valve vs main gas?

Actually, let’s keep it simpler:

  • Pilot light can be on (P) when S=1, even if M=0
  • But main gas (G) still requires M=1

The logic becomes: G = T · P · O · M (unchanged) But we need P to be controllable by S when M=0

This changes from a pure combinational logic problem to one that might need additional latching/memory, which is covered in sequential logic.

For combinational only: We could add a condition where if S=1 and T=1, gas can flow with reduced output. But that’s beyond simple combinational logic.

For this exercise: The current design with G = T·P·O·M already works. The pilot valve typically has its own control in real systems. This is an extension into sequential design.


Summary

  • The systematic design process: Define inputs/outputs → Truth table → Boolean expression → Simplify → Draw circuit → Build
  • For safety systems, use AND logic — all conditions must be met for operation
  • Always verify truth table against requirements carefully
  • K-maps help simplify expressions but aren’t always needed (already simple expressions)
  • Build and test your circuit to verify it works as specified

Key Reminders

  • Start by clearly defining what each input and output represents
  • Write complete truth table — don’t skip any combinations
  • Double-check: Does your expression produce the correct output for ALL inputs?
  • Use pull-down or pull-up resistors on switch inputs
  • Test incrementally: verify each input affects the output correctly

Assessment Rubric — Fireplace Control

Criterion4 — Exemplary3 — Proficient2 — Developing1 — Beginning
Truth TableComplete, accurate, all 16 rows correctComplete, minor errorsIncomplete (missing rows)Missing or incorrect
Boolean ExpressionCorrect from truth tableCorrect expressionMinor errors in expressionIncorrect
SimplificationK-map used correctly (if applicable)No simplification neededAttempted but errorsNo attempt
CircuitClear diagram, all connections shownCircuit shown, minor omissionsCircuit incompleteNo circuit
DocumentationClear explanation of each stepExplanation presentLimited explanationNo documentation

Custom activity — adapted from PLTW Digital Electronics