Glitch-Free Smart Parking Occupancy Tracker Using 4-bit Binary-To-Gray Code Sub-circuit

Authorised-Tested--Video-Proof-Provided

Within half an hour, build a low-complexity glitch-free smart parking occupancy tracker in the FOSS Logisim. Be sure to do it yourself, based on the pointers given.

By converting 4-bit up/down binary counter outputs into Gray Code via a custom XOR-based subcircuit IC, it eliminates multi-bit switching noise (glitches). Vehicle counts are displayed on a hex display while 4-colour LEDs visualise single-bit Gray transitions.

Working Principle

In automated parking garages, digital sensors detect vehicle arrivals and exits. Standard binary counters toggle multiple bits simultaneously (for instance, counting from 1 ‘0001’ to 2 ‘0010’ flips two bits). Hardware propagation delays cause brief intermediate ‘ghost states’ or glitches, leading to sensor false triggers or flickering displays.

Glitch-free smart parking occupancy tracker

Gray Code ensures that only one bit changes per state transition (e.g., 0001 -> 0011). The system utilises an Up/Down binary counter whose output is processed by a custom Binary-to-Gray (B2G) converter subcircuit using XOR gate logic:

  • G3 = B3 (MSB Direct Pass)
  • G2 = B3 ⊕ B2
  • G1 = B2 ⊕ B1
  • G0 = B1 ⊕ B0 (LSB)

Since only a single output bit flips per increment/decrement, switching glitches are mathematically eliminated.

What will you learn?

By building this project, you will learn:

  • The origin of digital switching glitches/noise in multi-bit binary systems.
  • Mathematical conversion principles between binary and Gray Code using XOR logic.
  • How to design, encapsulate, and label modular subcircuit ICs in Logisim.
  • How to interface up/down counters with clock sensors, direction switches, and reset logic.
  • How to drive hex-digit displays and multi-colour LED indicators for real-time status tracking.

List of software elements

List of software elements

Circuit

The circuit operates through three main digital functional blocks:

  • Counter and input control block: A 4-bit up/down counter receives pulse signals from a clock generator labelled ‘CAR SENSOR’. The ‘ENTRY/EXIT’ switch selects direction (0 = Entry / Count Up; 1 = Exit / Count Down). A ‘START/STOP’ pin enables the counter, while a ‘RESET’ pin clears memory to 0.
  • Binary-to-Gray (B2G) subcircuit: The 4-bit binary output (Q) routes through a 4-bit bus splitter into a custom B2G subcircuit block containing 3 XOR gates, outputting single-bit transition Gray code.
  • Dual Display Output: The binary output bus connects directly to a hex digit display showing the vehicle count (0 to F). Simultaneously, the B2G subcircuit drives a 4-LED status array (G3-Red, G2-Yellow, G1-Green, G0-Blue) illustrating glitch-free state transitions.
Fig. 2: Binary-to-Gray code converter

Troubleshooting

  • Display not updating: Ensure the START/STOP switch is set to ‘1’ (High) to enable counter operation.
  • Incorrect LED colours/logic: Verify XOR gate inputs in the B2G subcircuit. Ensure B3 connects directly to G3, B3/B2 to G2, B2/B1 to G1, and B1/B0 to G0.
  • Counter decrementing instead of incrementing: Check the ENTRY/EXIT switch state (0 = ‘Vehicle Entry/Increment’, 1 = ‘Vehicle Exit/Decrement’).
  • Bus splitter connection error: Ensure the splitter Bit Width is set to 4, and fan-out is set to 4 in Logisim attributes.

Possible applications

  • Industrial conveyor belt object counters (glitch-free optical counting)
  • Rotary and absolute shaft encoders in robotics and computer numerical control (CNC) machinery
  • High-speed asynchronous digital data transmission systems
  • Smart toll booth and automated gate occupancy monitoring

Loading form…
Rakesh Jain, Assistant Professor-ECE, GITS, Udaipur
Rakesh Jain, Assistant Professor-ECE, GITS, Udaipur
Rakesh Jain, Assistant Professor in ECE Department in Geetanjali Institute of Technical Studies, Udaipur, holds a master’s degree in VLSI, BE degree in electronics and communication, and diploma in electronics. His research areas are sensors and microcontrollers, and he has 31 copyrights, 9 design patent registrations, 3 Indian utility patents. He is recipient of Mewar Scientist Award 2023.

SHARE YOUR THOUGHTS & COMMENTS

Latest DIY Projects

Truly Innovative Electronics

Electronics News

Electronics Components

Electronics Jobs