Hardware Reference
In-Depth Information
Capacitor
Transistor
Battery
DC motor
Diode
Figure 4-3: DC Motor wiring
4. Make sure that the orientation of the diode is correct. Current flows from
the side with no stripe to the side with the stripe. The stripe on the physi-
cal device matches the line in the schematic symbol. You use a ceramic
capacitor for this exercise, so the polarity doesn't matter.
Next up, it's time to get this motor spinning. You might want to attach a piece
of tape or a wheel to the end of the motor so that you can more easily see the
speed at which it is spinning. Before you write the program, you can confirm
that the circuit is working correctly by providing power to the Arduino over
the USB connection, plugging in the 9V battery, and connecting the transistor's
base pin (after the resistor) directly to 5V from the Arduino. This simulates a
logic high command and should make the motor spin. Connecting that same
wire to ground will ensure that it does not spin. If this doesn't work, check your
wiring before moving on to the next step: programming.
Search WWH ::




Custom Search