Skip to main content
Arduino

Return to Answer

+ ASCII art schematic
Source Link
Edgar Bonet
  • 45.1k
  • 4
  • 42
  • 81

Edit: Below is an ASCII art rendering of the circuit. Beware that the motor is ON when the Arduino output is LOW.

+-----------+
| 5V|-----------------+-------------------+
| | | |
| Arduino | | |
| | ,-----. B |< E ___ +
| D13|----| |----| PNP _
+-----------+ `-----' |\ ___
 |C _
 | ___
 +---------+ _
 | | ___ 9 V batt.
 | | _
 --- | ___
 ^ motor _
 / \ | ___
 --- | _ −
 | | |
 | | |
 +---------+---------+

Edit: Below is an ASCII art rendering of the circuit. Beware that the motor is ON when the Arduino output is LOW.

+-----------+
| 5V|-----------------+-------------------+
| | | |
| Arduino | | |
| | ,-----. B |< E ___ +
| D13|----| |----| PNP _
+-----------+ `-----' |\ ___
 |C _
 | ___
 +---------+ _
 | | ___ 9 V batt.
 | | _
 --- | ___
 ^ motor _
 / \ | ___
 --- | _ −
 | | |
 | | |
 +---------+---------+
Source Link
Edgar Bonet
  • 45.1k
  • 4
  • 42
  • 81

When connecting together several circuits that have different supply voltages, common practice is to make them all have a common negative supply rail. This is called "common ground". As explained in Majenko’s answer, you would need an NPN transistor for that.

If you want to use a PNP instead, then you could forget the common practice and do everything "backwads": if you connect together the positive ends of the power supplies, you will have a "common VCC" instead of a common ground. Relative to the Arduino ground, your 9 V battery will have one pole at +5 V and the other at −4 V.

The wiring is the following:

  • connect the emitter to +5 V (Arduino +5 and battery +)
  • connect the base to an Arduino output through a resistor
  • connect the collector to the motor
  • connect the other end of the motor to the battery −
  • put a free wheeling diode in parallel with the motor.

AltStyle によって変換されたページ (->オリジナル) /