TECHNOLOGY 

Published on
KembaraXtra-Computer Science-SR Latch in a Vending Machine Circuit
I. Vending Machine Circuit with SR Latch
A. Requirements
  1. Inputs:
    • COIN button: Simulates coin insertion.
    • VEND button: Initiates vending.
  2. Outputs:
    • COIN LED: Indicates coin insertion.
    • VEND LED: Indicates item vending.
  3. Functionality:
    • Vending only occurs after coin insertion.
    • Only one coin insertion is considered.
    • Manual reset initially (later automatic).
B. Conceptual Implementation (Figure 6-7)
  1. COIN Button:
    • Sets the SR latch (COIN memory device).
    • COIN LED turns on.
  2. VEND Button:
    • AND gate: Requires both COIN (latch output = 1) and VEND button press.
    • If both conditions are met:
      • VEND LED turns on.
    • If no coin was inserted: nothing happens.
  3. Reset:
    • Manual reset required to clear COIN LED and reset the latch.
C. Automatic Reset Implementation (Figure 6-8)
  1. Connects the AND gate output (VEND signal) to the Reset input of the SR latch.
  2. Intended behavior: Vending resets the coin memory.
  3. Problem: Reset happens too quickly. VEND LED barely turns on (or not at all).
D. Automatic Delayed Reset (Figure 6-9)
  1. Problem: UI needs time for the user to see the action that has been performed
  2. Solution: Introduce a delay on the reset line.
  3. Implementation: Use a capacitor and resistor on the reset line.
II. Capacitors for Delay
A. Capacitor Basics
  1. Definition: An electrical component that stores energy.
  2. Terminals: Two terminals.
  3. Charging: Current flow charges the capacitor.
  4. Capacitance:
    • Measure of charge storage ability.
    • Unit: Farad (F). Commonly measured in microfarads (μF).
B. Capacitor Behavior
  1. Uncharged: Acts like a short circuit.
  2. Charged: Acts like an open circuit.
C. Delay Control
  1. Factors: Capacitance (C) and Resistance (R) in the circuit.
  2. Effect: Larger C and R = longer charging time = longer delay.



Picture
0 Comments