how to use an npn as a switch between battery and motor?
simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. NPN motor control.


When the microcontroller output goes high a current will flow through R1 into the base of Q1. 
The transistor will turn fully on and, effectively, connect the bottom of the motor to GND. (You could expect to see about 0.2 V drop across the transistor. The rest of the 3 V will be across the motor.)
When the micro output goes low the transistor will turn off.
D1 protects the transistor from any high-voltages generated by the inductance of the motor at the instant of turn off. It might not be essential with your low powered circuit but it is recommended.