- Published on
KembaraXtra-Computer Science-SR Latch in a Vending Machine Circuit
I. Vending Machine Circuit with SR Latch
A. Requirements
A. Capacitor Basics
I. Vending Machine Circuit with SR Latch
A. Requirements
- Inputs:
- COIN button: Simulates coin insertion.
- VEND button: Initiates vending.
- Outputs:
- COIN LED: Indicates coin insertion.
- VEND LED: Indicates item vending.
- Functionality:
- Vending only occurs after coin insertion.
- Only one coin insertion is considered.
- Manual reset initially (later automatic).
- COIN Button:
- Sets the SR latch (COIN memory device).
- COIN LED turns on.
- 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.
- Reset:
- Manual reset required to clear COIN LED and reset the latch.
- Connects the AND gate output (VEND signal) to the Reset input of the SR latch.
- Intended behavior: Vending resets the coin memory.
- Problem: Reset happens too quickly. VEND LED barely turns on (or not at all).
- Problem: UI needs time for the user to see the action that has been performed
- Solution: Introduce a delay on the reset line.
- Implementation: Use a capacitor and resistor on the reset line.
A. Capacitor Basics
- Definition: An electrical component that stores energy.
- Terminals: Two terminals.
- Charging: Current flow charges the capacitor.
- Capacitance:
- Measure of charge storage ability.
- Unit: Farad (F). Commonly measured in microfarads (μF).
- Uncharged: Acts like a short circuit.
- Charged: Acts like an open circuit.
- Factors: Capacitance (C) and Resistance (R) in the circuit.
- Effect: Larger C and R = longer charging time = longer delay.
0 Comments