This communicator will allow two colleagues to message each other to see if they want to go for a coffee or walk. The device will vibrate and light up whenever the other person is sending anything.
Figure 1. Version 1 of the device
The vibration motor has two connections: One goes to the output pin and the other goes to ground. The output pin does not generate enough current for the vibration motor to work so we use a transistor to allow for more current across the vibration motor.
Below is a semantics of adding the transistor. The gate of the transistor is connected to the output pin. The source is connected to the power source of the microcontroller. The drain is connected to the motor whose other leg is connected to ground (see Fig.
Figure 2. Basic schematics of vibration motor
There is an issue with this though. The vibration motor has a coil that is inductive. This means that the current passes through the coil to create a magnetic field that then causes the movement (vibration). When the current stops, the magnetic field takes time to dissipate and can end up generating current. This forces to drive current from a transistor even when the gate is off (high resistance). This can damage the resistor.
Figure 3. Fixed schematics for vibration motor
By adding a diode, we create a wheel that allows extra current due to induction to dissipate in the form of heat. When the gate is closed, The current moves from top through the vibration motor to ground. The reserve diode prevents it from going down the other route. When the gate is open and there is still current induced at the vibration motor, the current runs down the vibration motor but then goes through the diode loop instead of damaging the transistor.