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.
Understanding Robotics: Bumper and Contact Switch
A useful bumper is more than a strip of plastic at the front of a robot. It is a mechanical system that transfers a push from an obstacle to a small switch. The bumper needs enough travel to move before the robot body reaches the obstacle.
Springs, flexible plastic, foam, or a hinged arm can provide this travel. The position of the pivot matters.
A long bumper arm can make a light touch easier to detect, but it may bend too much or snag on objects. The design must survive repeated impacts without changing shape.
The electrical input needs a definite state at every moment. A controller pin connected to a switch by itself can float. Electrical noise may then make the robot report a contact that never happened.
A pull resistor gives the input a known voltage when the switch is not changing the circuit. The chosen wiring determines whether the controller interprets a low signal or a high signal as pressed.
Students should check this carefully in both the circuit diagram and the program. A reversed input rule can make a robot drive when it should stop.
A collision is not always a single clean event. When metal contacts meet, they can separate and reconnect many times in a tiny fraction of a second. This contact bounce creates a burst of signals.
Software can handle it by waiting for one stable reading for a short time before accepting a press. Another method is to record the time of the first press, ignore extra changes briefly, then check the switch again.
This is called debouncing. It prevents a robot from treating one bump as several separate collisions and making erratic turns.
Bumper shape affects what the robot can sense. A narrow switch at the center may miss a wall hit near a corner. A wide curved bumper can guide an object toward the switch.
Two separate bumper zones give more information. A left press suggests that the robot should turn right, while a right press suggests a left turn.
Robots used in schools often meet table legs, books, walls, cables, and other robots. A contact sensor works in dim rooms and on clear objects that can be difficult for some distance sensors to notice.
Testing should include gentle presses, hard impacts, angled collisions, and holding the bumper down. Watch for cases where the switch releases slowly or the bumper catches on the floor. Motor vibration can trigger a poorly mounted sensor, while a loose wire can imitate a press or hide a real one.
Good robot programs use the bumper signal as part of a safety response, but they should not assume that every obstacle is safe to touch. Speed, mass, and battery condition affect stopping distance. A robot moving quickly may hit before its code has time to react, so physical design and careful speed limits matter.
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 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 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 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.