In this section, we will build a prototype where a DC motor will spin for a second every time a push button is pressed.
For building the distance measurement device, the following parts will be required:
- Arduino Uno R3
- USB connector
- Four pieces 1.5V batteries
- One battery holder (for 4 batteries)
- One full sized breadboard
- One push button
- One piece 10K Ohms resistor
- One small DC motor
- One N2222 transistor
- One IN4001/IN4007 diode
- Two pieces 150 Ohms resistors
- Some Jumper wires
Follow the schematic diagram shown below to build the DC motor circuit. In the following breadboard diagram, notice that an external battery-based power source has been used for powering the DC motor; whereas the Arduino board has been powered via the computer USB.
Using a separate power source for the DC motor is important, because the 5V pin of the Arduino board is not designed...