Skip to content
Adaptive AgroTech NetworkUniversity of Southern Denmark · SDU Drone Center
Cover for Raspberry Pi Pico Two-Way Counter | Sensor Order & Debounce

Video by Adaptive AgroTech. If the embedded player is unavailable, open the original video ↗.

Raspberry Pi Pico Two-Way Counter | Sensor Order & Debounce

Two sensors along a passage reveal direction through the order in which they activate. A Raspberry Pi Pico can interpret one completed sequence as a crossing.

Understand the concept

The key idea

A transition from A to B represents one direction, and B to A represents the opposite direction. Debounce and a return-to-clear condition help keep a held or noisy signal from being counted repeatedly.

What to remember

  • Assign direction to a complete sensor sequence.
  • Handle partial crossings and reversals explicitly.
Pause & think

Check your understanding

What can the counter infer from a trigger on A alone?

Show the explanation

It knows A was activated but lacks a completed sequence that identifies a crossing direction.