The pins on your Arduino can only be used to power devices that require a small amount of current (e.g. an LED). To power bigger loads (such as larger DC motors) we need to use an additional power supply other than your USB cable. For this exercise we will use the small DC motor that you were given on week 2. This motor can happily run off the Arduino power supply - but many motors cannot because they either draw too much current or they need a voltage higher than 5 volts. We will use this motor to learn what is needed for more powerful motors. Here is everything you need to build a circuit that will protect your Arduino when using an inductive load. All these parts are from your Arduino Starter Kit or were in the paper cup of additional parts you were given week 2.Inside a DC motor is a coil mounted on a shaft between two magnets. As current is applied, the coil is attracted to one magnet and repelled by the other resulting in a spinning motion. However, this also works in reverse - when you move a coil in a magnetic field it can induce current in the coil. This is called 'back' or 'kickback' voltage and it can constantly reset or even damage your Arduino. You can prevent this by putting a 'snubber' or 'kickback' diode in your circuit any time you are using an inductive load (DC motor, solenoid, etc.) ![]() ![]() You will also need another power source (such as a switchable bench-top power supply, as pictured) that is appropriate for the load you want to drive. A transistor is a semiconductor device commonly used to amplify or switch electronic signals. A transistor is made of a solid piece of a semiconductor material, with at least three terminals for connection to an external circuit. A voltage or current applied to one pair of the transistor's terminals changes the current flowing through another pair of terminals. Because the controlled (output) power can be much more than the controlling (input) power, the transistor provides amplification of a signal. The TIP 120 transistor (datasheet attached at the foot of this page) is a 3 pin device that acts like a 'switch'. The base controls the current passing through the collector and emitter. In this exercise we will use the power (+5V) from pin 9 on the Arduino to control the flow of current to a DC motor from an additional power supply. The base is the input that you will use to open and close the 'switch' across the collector and emitter. On this type of transistor you need to make sure the collector is always more positive than the emitter (the TIP 120 is an NPN transistor - for a detailed discussion of how this works see Chapter 3. Semiconductors in MIMS, Forrest M. 2007(4th Edition). Getting Started in Electronics. Lincolnwood, IL: Master Publishing, Inc.) Generally this is done by connecting the emitter to ground. Plug the 3 pins of the TIP 120 into 3 separate rows of the breadboard. In the orientation shown in the photo (with the printed side toward you) the order of the pins are from left to right: the base, the collector, and the emitter. Connect the 1N4004 Micro 1 Amp Rectifier Diode in parallel with the collector and emitter of the transistor. Note that the silver band on the diode points away from the emitter that will be connected to ground. Looking ahead, the base of the TIP 120 will be connected to pin 9 on the Arduino with a 1K resistor in between. The high-current load (the DC motor) will be attached to the power supply, and then to the collector of the transistor. The emitter of the transistor will be connected to ground. Be sure to add the diode to your circuit correctly. Put a 1K resistor in the breadboard connected to the base of the TIP 120. Connect the emitter of the transistor to the ground rail of the breadboard. Connect the 1K resistor to pin 9 on the Arduino. This connects the base of the TIP 120 to pin 9 with the resistor in-between. Connect one pole of the DC motor to the the power rail of the breadboard (this will eventually be connected to the power supply) and the other pole to the collector of the transistor (one pin of the diode is also connected to this row). Add a potentiometer from your Arduino starter kit to the breadboard. Here is a reminder of the function of the pins on the potentiometer. Connect the power pin of the potentiometer to +5v on your Arduino - or to the power rail of the breadboard (as in the photo) since this particular motor runs on +5v. Connect the signal pin of the potentiometer to analog pin 0 on your Arduino. Connect the ground pin of the potentiometer to the ground rail of the breadboard. Connect the ground and power leads of your power supply to the ground and power rails of the breadboard. Connect the USB to your Arduino and upload the code below. Before turning on the power supply make sure all the knobs are at zero. Turn on the power supply and slowly increase the voltage* to +5v. Control the speed of the motor with the potentiometer. *Amps and Volts measure totally different things. We measure the rate of flow of electricity as an electric current measured in Amperes, shortened to Amps. We call electrical pressure Voltage and measure it in Volts. If electricity was a water hose Volts = pressure and Amps = volume. /* Let's change this set up so that the speed of the motor is controlled by numerical input in the Arduino serial monitor. Turn off the power supply. Please be careful. Power supplies can hold a significant charge even after they have been switched off. Disconnect your USB cable from the Arduino. Remove the potentiometer from the circuit. Also remove the 3 wires that connected to the potentiometer. Leave everything else in place. Connect the ground rail of the breadboard to gnd on your Arduino. The ground connection must be shared between the Arduino and the additional power supply. Reconnect the USB cable to your Arduino and upload the code below. Before turning on the power supply make sure all the knobs are at zero. Turn on the power supply and slowly increase the voltage to +5v. Control the speed of the motor by typing 0-9 in the Arduino serial monitor. /* |