In a school competition for my son, he wants to make a toy car that will stop before it hits a wall (before, not making an impact). It can go as slow as it likes and cannot be remote controlled. I was thinking maybe a phototransistor on the front, shrouded so when the wall becomes close the light level would become low enough to switch and turn off the motor.
Do you think that could work? I have a feeling it is too imprecise. Can you think of a better way? It may not be approaching the wall exactly perpendicularly if the car veers off slightly.
Extra thanks for circuit diagrams - it is a very long time since I did anything like this...