Switch that turns on both arduino and motor shield that use different power supplies
You need either a double pole double throw or a double pole single throw switch if you would like to have both be controlled from the single switch. It is important the switch is on the positive voltage rail and that you are NOT using a single pole single throw on the ground of the power supplies. If you cut the ground to the power supplies you are actually creating a scenario where current will flow backwards through your micro and possibly damaging the arduino. 








simulate this circuit &ndash; Schematic created using CircuitLab


The arduino can be powered from anything over ~7V, so a 9V batter would be just fine. For the motor however you CAN NOT use a 9V battery and need a battery that is capable of supplying high current without the internal resistance of the battery hindering your output voltage. I highly recommend looking into either a LiPo or NiMh battery for driving the motor. The size of battery will be dependent on what the motor is rated for. For example if you have a 12V motor, you will want a 12V battery for them.
This depends on the battery you are using, and can most likely always be traced back to the battery. In your picture you show a 9V radio battery being used, which is in fact a very poor choice for any sort of motorized circuitry - it simply isn't able to supply the needed current. When you ask a battery like a 9V for more current than it can supply it begins to compensate by reducing the output voltage (ok there is actually a lot going on internally chemistry wise but that is a valid way of thinking about it). This fluctuation in output voltage will effect high sensitivity devices such as analog circuits or high speed digital circuits (which the ultrasonic sensor is). Switching over to a battery that can supply high amounts of current would fix this, or switching to a two battery solution.