Robot Driving Backwards Hits Wall

Previously, we saw how the Back-And-Forth Robot backs up. It will continue to back up until the rear switch (SW2) is pressed.

As before, the change to a forward state happens almost immediately. But, I’ve broken it down into three steps to help the understanding. In fact, these are the same three steps as before, just on the opposite side of the circuit.

6 Back button pressed Forward step one

6. Back button pressed. Forward step one.

The back button (SW2) is pressed -- perhaps because the robot backed into a wall, pet, or small child. The switch sets Input A (pin 2 of IC1) to low (0 V). This overrides the signal coming from Output B (pin 5) due to the constraining effects of resistor R2.

7 Back button pressed Forward step two

7. Back button pressed. Forward step two.

The chip inverts the low signal from Input A (pin 2) to set Output A (pin 7) to high. Everything connected to Output A is also set high. SW3 isn’t pressed, so it doesn’t matter.

8 Back button pressed Forward step three

8. Back button pressed. Forward step three.

Lastly, Output B is made to be the opposite of Input B. The motor terminals are set to the forward direction again. The robot drives forward.

1 Forward No bumpers pressed

1. Forward No bumpers pressed.

The robot drives away from the wall or obstacle, releasing SW2. We’ve come full circle back to the forward state again!

The low signal from Output B maintains Input A in the same state. Therefore, the robot continues to drive forward even when SW2 is no longer pressed.

On the next page, we'll see the circuit animated to show the entire process. Also, we'll see what happens when some jerk presses both bumper switches at the same time.