How to stop a motor when car approaches wall - phototransistor?
Sir.

I am answering your question making these two assumptions, you have enough time (at least 2 weeks) and you have basic electronics knowledge.

One of the best solutions is using Arduino and Ultrasonic Sensor. There are quite enough resources on the internet about how to use an Ultrasonic sensor with Arduino. Arduino codes are also simple and have a very high learning slope.

After you understand and handle (with example codes) how to measure distance, you will need to control a motor. You can control a DC Motor with Arduino. The only thing you will need is to build a very very simple Motor Driver.

The motor driver for DC Motor is nothing but a transistor used as an ON/OFF switch. (Since microcontrollers use PWM to provide control signal).

And that's it.

NOTE:If you let your son learn how to use Arduino, he would have a basic knowledge about microcontrollers and programming, which is a good thing if your son is interested in electronics.
NOTE 2: Do not supply power to motor from Arduino board. Use an external battery.

Some of the things that I mentioned here may sound unfamiliar, but a short Google search with the "keywords" that I mentioned, it will be clear.