Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

A bumper and contact switch let a robot sense when it has physically touched an obstacle. This is one of the simplest and most reliable forms of robot sensing because it uses direct mechanical contact instead of light, sound, or cameras. In a small mobile robot, a springy front bumper can press inward when it hits a wall, closing an electrical switch.

The robot controller reads that switch signal and can stop, reverse, turn, or follow along the wall.

Key Facts

  • A normally open contact switch has Vout = 0 or LOW until the bumper presses it closed.
  • A normally closed contact switch has Vout = HIGH until contact opens the circuit, which can be safer for detecting broken wires.
  • Ohm's law for the switch circuit is V = IR.
  • With a pull-up resistor, an open switch usually reads HIGH and a closed switch usually reads LOW.
  • Debounce time is often about 5 ms to 50 ms because metal contacts can bounce rapidly after impact.
  • A simple safety rule is if bumper = pressed, then motor speed = 0 or reverse.

Vocabulary

Bumper
A bumper is a movable protective part on a robot that compresses when it touches an object.
Contact switch
A contact switch is an electrical switch that changes state when two conductive parts touch or separate.
Debouncing
Debouncing is the process of filtering rapid false on-off signals caused by a mechanical switch vibrating after contact.
Pull-up resistor
A pull-up resistor connects a signal line to a positive voltage so the input has a known HIGH state when the switch is open.
Wall-following
Wall-following is a robot behavior that uses sensor feedback to move alongside a wall while keeping contact or distance under control.

Common Mistakes to Avoid

  • Ignoring switch bounce, which is wrong because one physical hit can appear as many rapid presses to the controller.
  • Connecting the switch input without a pull-up or pull-down resistor, which is wrong because the signal can float and randomly change state.
  • Assuming a bumper only means collision, which is wrong because contact information can also guide wall-following, docking, edge alignment, and safety stops.
  • Driving the motors at full power after contact is detected, which is wrong because the robot may keep pushing into the obstacle and damage the bumper or switch.

Practice Questions

  1. 1 A bumper switch bounces for 18 ms after impact. If the robot controller samples the input every 2 ms with no debouncing, about how many samples could show unstable readings during the bounce?
  2. 2 A contact switch circuit uses a 5 V supply and a 10 kΩ pull-up resistor. When the switch is closed to ground, what current flows through the resistor?
  3. 3 A robot has left and right bumper switches. Explain how it could use these two switches to decide whether to back up, turn left, turn right, or stop safely after hitting an obstacle.