A basic motor speed controller circuit and a silly but fun way to use it.
Motor speed controllers are very useful circuits and there are many applications all around us. However, we do not have to make ours practical, we think this one is just for fun! We are going to look at motor speed control as an idea and the different ways it can be done. Then, we will build one that you can use in future projects, as well as come up with a fun idea to make a paper plane launcher with speed control as a way to use this build.
Motor speed controllers are pretty important devices. Many electric motors, just because of the way they are made, go a lot faster than we need them to. Imagine if the motors in your ceiling fan went full speed all the time? Or worse, the motor in a lift? If your electric garage door or gate closes too quickly, it can be very dangerous. Have a wander around your house and see if you can find things that use motors that are not running full-tilt. You will probably surprise yourself.
There are many ways of controlling the speed of a motor, but some are harder to make than others. Also, some methods only work for certain types of motors. Most motors that are powered by alternating current (AC) mains power, for example, are controlled very differently to battery-powered direct-current (DC) motors.
The method we will use involves switching the motor on and off very fast. There are a couple of ways of doing that but the most common, and the method we use here, is 'pulse width modulation', a fancy phrase that just means turning power on and off, and changing the amount of on time but leaving the on and off total time together, the same. We'll expand on that and use some diagrams in the 'How It Works' section.
SOME HELPFUL HINTS
We encourage you to read all the way to the end of the article before you build. Not only will you then have a better feel for the overall picture as you build, but we sometimes discuss options or alternatives that you will need to have decided on. You will need some basic hand tools for most builds. Small long-nosed pliers and flush-cut side cutters meant for electronics are the main ones. Materials like tape or glue are mentioned in the steps, too. We always produce a tools materials list if you have to go shopping, but anything that is lying around in most homes is just stated in the steps.
As always with Kids' Basics, we avoid soldering to make the build more accessible to more people, but having an adult around can still be helpful. You won't need any particular skills besides being able to identify components at a basic level, and even then, we help as you go along. If, for example, you don't already know what a resistor is, you'll probably be able to work it out from the photos and description in each step.
We do provide a schematic or circuit diagram but this is just helpful if you already know how to read one. Don’t stress if you have never learned, but take the chance to compare the digital drawing of the breadboard layout (which we call a 'Fritzing' after the company that makes the software) to the schematic and see if you can work some things out. You can make this project from the Fritzing and photos alone. You might also like to check out our Breadboarding Basics from Issue 15.
The Build:
Parts Required | ID | Jaycar | ||
---|---|---|---|---|
1 x Solderless Breadboard | - | PB8820 | ||
1 x Packet Breadboard Wire Links | - | PB8850 | ||
4 x Plug-to-Plug Jumper Wires * | - | WC6024 | ||
1 x 330Ω Resistor * | R4 | RR0560 | ||
1 x 510Ω Resistor * | R3 | RR0565 | ||
1 x 4.7kΩ Resistor * | R1 | RR0588 | ||
1 x 50kΩ Potentiometer | R2 | RP7516 | ||
1 x 10nF Capacitor * | C3 | RM7065 | ||
1 x 100nF Capacitor * | C2 | RM7125 | ||
1 x 220µF Capacitor * | C1 | RE6158 | ||
2 x 1N4148/1N914 Small Signal Diodes * | D1, D2 | ZR1100 | ||
1 x 1N4004 1A Rectifier Diode * | D3 | ZR1004 | ||
1 x BC547 NPN Transistor | Q1 | ZT2152 | ||
1 x TIP41C NPN Transistor | Q2 | ZT2291 | ||
1 x CD4093 Quad NAND Gate IC | IC1 | ZC4093 | ||
1 x Pushbutton Switch | SW1 | SP0710 | ||
1 x Small 6V DC Motor | - | YM2712 | ||
1 x 4AA Battery Pack | - | PH9200 | ||
4 x AA Batteries | - | SB2425 |
Step 1:
Place the breadboard in front of you, with the outer red (+) rail facing away from you and the outer blue (-) rail closest to you. Install two wire links, one joining the two red (+) rails and one joining the two blue (-) rails.
Step 2:
Insert the CD4093 into the breadboard with the notch or dot that indicates pin 1 facing to the left. See the note further on about identifying pin 1. Connect pin 14 to the upper red (+) rail with a wire link, and pin 7 to the lower blue (-) rail with another wire link.
Step 3:
Place a 1N4148 or 1N914 diode with its stripe facing the right. One end goes to pin 3 while the other goes to a spot just to the left of the CD4093. Install a 4.7kΩ resistor (YELLOW VIOLET BLACK BROWN SPACE BROWN) between pin 1, and a row one space away from the other end of the diode. In other words, there will be one empty row between the end of the diode and the end of the resistor.
Step 4:
Install one more 1N4148 diode but with its stripe facing left. One end goes to pin 3 of the IC while the other goes one row away from the 4.7kΩ resistor. You should now have the end of a diode, then an empty row, the end of the resistor, another empty row, the end of the other diode, and then finally some space before the IC.
Step 5:
Insert four wire links. The two small ones are hard to see because they're uninsulated. We coloured them blue with a marker, between pins 1 and 2, and 5 and 6. There is an insulated one between pins 3 and 5, and a longer one from pin 4 off to the right of the IC.
Step 6:
Add a 10nF capacitor (10n or 103) between pin 2 of the IC and the lower blue (-) rail. Install a 100nF capacitor (100n or 104) between the lower red (+) and blue (-) rails. We have used MKT capacitors but ceramic or greencap would be fine too. Also, place a 220µF Electrolytic capacitor with its striped negative (-) leg in the lower blue (-) rail and its other leg in the lower red (+) rail.
Step 7:
Insert a 510Ω resistor (GREEN BROWN BLACK BLACK SPACE BROWN) between the end of the wire link from pin 4, and a spot to the right. Install a BC547 NPN transistor with its flat side facing you and its middle (base) leg to the other end of the resistor.
Step 8:
Place a TIP41C NPN transistor behind the BC547, with its metal tab facing away from you and its left-hand (base) leg in the same row as the right-hand (emitter) leg of the smaller transistor. These big TO220-packaged transistors can open the spring contacts inside the breadboard too much so wriggle the BC547 a bit to make sure it still has contact.
Step 9:
Add a 330Ω resistor (ORANGE ORANGE BLACK BLACK SPACE BROWN) from the left-hand (collector) leg of the BC547 to the lower red (+) rail. Install a 1N4004 diode with its striped end to the lower red (+) rail and its other end to the middle (collector) leg of the TIP41C. Finally, place a wire link from the right-hand (emitter) leg of the TIP41C to the lower blue (-) rail.
Step 10:
Cut the ends of two plug-to-something jumper wires and strip some of the ends. Twist the wires through the terminals of a small 6V motor, making sure they are very firm, and tape the ends. Plug one wire into the lower red (+) rail and the other into a space beside the transistor.
Step 11:
Cut the ends of two more jumper leads, leaving a pin end on each, and bare the wire before twisting it through the terminals of a pushbutton switch. Plug one end into the middle (collector) leg of the TIP41C, and the other one into the remaining motor wire.
Step 12:
Place a 50kΩ potentiometer so that its pins are in the same rows as the 4.7kΩ resistor and the two diodes, but with the shaft facing you. Turn it to half of its full rotation. Connect a 4xAA battery pack with the red wire in the upper red (+) rail and the black wire in the lower blue (-) rail. Add batteries and press the pushbutton. The motor should turn.
HOW IT WORKS
We are using two of the four NAND gates inside of the CD4093 as shown on the pinout diagram. A NAND gate is a logic gate with inputs that can be either high or low (1 or 0) and an output which can also be either high or low. The symbol for the individual gate is shown inside the pinout diagram. The dot in the output means it is an inverted AND gate. Inverted means 'the opposite of'. For an AND gate, both input A AND input B have to be high for the output to be high.
For a NAND gate, for the output to be high, both inputs must be low. If either one or both of the inputs are high, the output is low. When dealing with logic gates, we use 'truth tables' to see what they do. These are tables which show all of the inputs and outputs, and use 1s and 0s (or sometimes crosses or other marks) to show high and low. You read a table line by line. So, for the first line, both inputs are high, so the output is low.
The CD4093 was chosen because of the type of input it has. In most logic gates, the difference between high and low is generally set around half the supply voltage, while in others, it is set at some nominal value. A voltage below this is a 0, a voltage above is a 1, and anything right on the border can produce instability in some cases. The inputs on the CD4093 are called 'Schmitt Triggers'. Logic ICs of all sorts trigger on the edge of a wave or pulse. Even digital signals are waves, because the difference between high and low is not instant. It is close, but there is a slight time where the voltage is rising or falling and has a slight slope on a graph. Some devices trigger on the rising edge, when the voltage goes from low to high, while others trigger on the high to low falling edge. Some trigger on both, like gates do.
A Schmitt trigger has built-in feedback inside it from its output to its input, and this changes the threshold at which triggering occurs. By the way, triggering just means the change in output from high to low. So, a Schmitt trigger needs a greater change in the signal at the input. If the voltage is hovering on either side of the half-way point, no change happens. The voltage needs to rise quite a way above the threshold to trigger the output one way, and quite a way below it to trigger the other way. This concept is called 'hysteresis' and is used elsewhere in electronics, too.
In addition to the hysteresis making things stable, Schmitt triggers are also generally fast-acting and very crisp, with low switching noise at the output (stray high/low signals or part thereof) and very good immunity to noise at the inputs. Immunity means the input can ignore electronic noise.
We make full use of the hysteresis with this circuit. The inputs of the first NAND gate are connected together, so they act as one input. This input is connected to the junction of C3, a 10nF capacitor, and 510Ω resistor R1. The output is connected through two diodes to either side of the 50kΩ potentiometer R2, the wiper of which is connected to the other end of R1.
At first, the output is high because both inputs are low. Current flows from the output through D1 to the potentiometer, and through the wiper and R1 to charge the capacitor. The amount the potentiometer has been turned by determines how much resistance there is here and therefore how quickly the capacitor charges. As it charges, the voltage across it rises. However, it has to rise to the hysteresis threshold, not the half-way point like some logic inputs. When the voltage at the connected inputs pins 1 and 2 rises far enough, the output at pin 3 goes low.
The inputs are very high impedance, meaning only a tiny amount of current flows into them. It is not even enough to calculate for this case. With the output low, however, it can sink current, which means it can pass current to ground. For some ICs, a low output is not connected to anything, called 'floating' and cannot sink current, only source it (give or provide) when high. The output of the CD4093, like our friend the NE555, does both. However, the CD4093 can only sink around 1mA. That's why we have R1, to make sure the capacitor does not discharge with too high a current even if the potentiometer is turned all the way.
With the output low, the capacitor discharges through R1 and the potentiometer. However, because of the diodes, current can only flow one way. It flows through the other half of the potentiometer through D1 and to the output, which sinks the discharge current to ground. With the junction of R1 and C3 connected to the inputs of the NAND gate, the falling voltage eventually reaches the lower hysteresis point, now read as 'low' triggering the output high again. The charge cycle now starts.
Why do we not just have the potentiometer connected as a variable resistor with one end connected to the wiper? If the resistance varies, then the length of the timing cycle varies, right? Yes, it does. But, it varies evenly. It would stay the same charge time and discharge time. All we would do is change how fast the whole cycle is completed.
By using diodes, we keep the amount of resistance involved the same. Some is used in the charge cycle, some in the discharge cycle, but the total is the same. Therefore, the cycle time is the same. Because the diodes only let current flow one way, turning the potentiometer adjusts the amount of the resistance dedicated to the charge cycle and the amount dedicated to the discharge cycle, but it keeps the total the same. Therefore, what we do is charge the length of the on time when compared to the off time. We can vary it from off almost the whole time, to on almost the whole time, and anything in between.
This is called 'Pulse Width Modulation' or 'PWM'. We vary the width of the pulse, which is the on time. The more on time the motor has, the faster it spins. We do this because the motor works best at its rated voltage.
It has the most torque (the power to turn) at its rated voltage. Also, when a motor spins, the magnets create a voltage that flows the other way, pushing back on the supply current. If the voltage is reduced, this backwards current (called the back-EMF for ElectroMotive Force) can be higher than the supply voltage, or just not high enough to slow the current. The motor can burn out by having too much current through the coils.
Incidentally, this backwards current is still there for a moment when power is cut, which is why we have D3. This diode lets that current get straight to the supply rail (which is like ground to it because the current is going the other way to the circuit current) and not through the rest of the circuit to cause damage. These 'freewheeling' or 'flyback' diodes are essential when working with motors on DC circuits, or other 'inductive' loads like relay or solenoid coils.
Back to the circuit, that output at pin 3 is also connected to the joined inputs of the second NAND gate. This is a buffer, which means it helps isolate the output from other factors. If there is anywhere else for current to flow, like out a resistor through a transistor base and emitter and on to ground, all the timings will be affected because the capacitor will not have all the current to charge with when the output is high and have somewhere else to discharge to when the output is low. So, the very high-impedance inputs of the second NAND gate are used and the output of the second NAND gate is used to drive the transistors, keeping the timing circuit isolated.
Speaking of output transistors, the pin 4 output of the second NAND gate flows through R3, a 510Ω resistor. This is for current limiting to keep the base of the BC547 to its safe current limit, but it is probably unnecessary because the output current of the CD4093 is so low. Still, it's good design practice to take the safe side. Through R3, the output current turns on the BC547's base, allowing current from its collector to its emitter. The current to the collector is limited to a safe level by the 330Ω resistor R4, which will allow 18mA at 6V.
While we can turn on the BC547 with 5mA down to less than 1mA, the TIP41C is less sensitive. It also has a lower gain, which means the number of times greater the current across the collector to emitter path than from the base to emitter. To make it turn on fully, it needs more current than a BC547. However, it can also pass a lot more current across its collector/emitter than a BC547: 6A compared to 100mA!
The motor draws much less than 1A but more than we feel comfortable feeding through, say, a BC337 at 500mA max. For a short moment when the current first turns on (at the beginning of every pulse, too, not just when power is first applied) in a DC motor, the current drawn through the coil is up to five times higher than its regular operating current. A BC337 could handle the operating current of the motor, but not the spikes.
This is known as a 'Darlington' arrangement, where a sensitive transistor with a lower collector/emitter current drives a less sensitive transistor with a higher collector/emitter current. You can buy Darlington devices in one package but we went down the 'show you how it works' road.
The reason we placed the switch between the motor and the transistor rather than just powering on and off the whole circuit is because at first, the capacitor takes longer to charge from 0V. After that, it only discharges to the lower hysteresis threshold, not 0V, and this is the proper timing cycle.
As a side note, this very simple circuit does not actually have the same frequency (the number of on/off cycles per second) for the whole of the potentiometer's rotation. Diodes have a voltage drop and internal resistance that varies a bit with the amount of current flowing through them. As the turning potentiometer changes how much current is flowing through a diode, its properties change and so the frequency changes.
However, for a circuit like this, that doesn't matter much. It will matter on other circuits, however, like servo controls which require the same frequency, and only a variation of the amount of on time versus off time. So, without modification, you could not use this circuit to drive a servo, for example.
Making the Launcher
Tools & Materials Required |
---|
String |
Corrugated Cardboard or Foam-core Board |
Knife |
Ruler |
Holt Melt Glue Gun and Glue |
Paper |
Barbeque Skewer |
Pencil |
Step 1:
Decide how long you want your launcher. The length of the launcher is up to you, but after a certain point, it won't make any difference. Take a flat piece of foam-core board or corrugated cardboard and cut three pieces that are the length of the launcher. Two are 3cm wide while one is 1cm wide. Also cut a wider piece about 10cm more than the launcher length.
Step 2:
Use hot melt glue to bond the two 3cm pieces on either side of the 1cm piece. Glue a small piece of harder material like a broken-off barbeque skewer to the very end of the launcher, but not above the 1cm bit otherwise the planes will catch as they leave.
Step 3:
At the other end, glue a strip of paper under the launcher and fold it under itself. Glue it to the base board like a hinge. Use some Blu Tack or similar to prop the other end of the launcher to become a ramp.
Step 4:
Cut a flat bit of cardboard into a broad 'H' shape, and glue it to the motor shaft as shown. You will have to stick the shaft into the middle, not on the back or front, to make it rotate evenly. Glue the motor in front of the launcher, being careful not to cover air vents.
Step 5:
Cut a hook shape from the foam-core or cardboard, and glue a string to the front. The bottom should be long but short, to guide it down the slot without twisting, but not more than about 4cm long. Make the hook slope forward, to catch on the plane.
Step 6:
Glue the other end of the string to the H-shape on the motor, which has become our winch drum. Hand-wind the excess onto it. Place the hook at the far end of the launcher rail, and the circuit next to the motor. You can glue down the switch or keep it hand-held.
USING IT
Why speed control? There is such a thing as too fast for a paper plane, especially glider-style ones. For some planes, slower is better. For others, the faster the better. To use the launcher, you can cut out a place for the hook at the front of the plane, or put the hook behind at the back. Which one is best depends on the design of the plane and will take some experimenting. Also, start slower on the motor then increase speed until results start to reduce again.
Push the button to start the motor, but be ready to release it as soon as the hook is clear of the launch rail or plane. If you don't, it will flick around the winch and damage itself and other things. It probably will anyway. This system is far from perfect but that's the compromise for being easy to build. Many launchers use flywheels for example, but DIY flywheels are hard. Finding the exact centre of the circle is nearly impossible.
MAKING PAPER PLANES
Making paper planes is a topic well-covered online in both videos and written instruction. However, in many cases rear-push launching is not effective as the tip of the plane flips up. You will most likely need a cut-out for the hook. Make it as pictured, with the triangle sloped forward slightly. You might need to reinforce the cut. We found masking tape works well, as does glueing on extra paper or even cardboard, to either the middle or outsides of the body. Make lots of different designs and see which one works best.
WHERE TO NEXT
The system can be improved if you are willing to make things more complex. Lifting it higher so that it doesn’t matter if the hook spins around the winch would be a great start if you want to make a stand for everything. Also, a longer hook would be better if you can make the stand higher still.
You could adapt the motor to other construction methods. You could think of a way to mount pulleys in the channel and use a large rubber band with the hook glued to it as a launcher instead of the string. You could also play with flywheels if you really were adventurous. As we mentioned, however, these are hard to get right.
MOTOR POWER AND RELEASE CHALLENGES
There is quite a lot of friction, or grip, between the launching channel and the plane, and on the path of the drag rope. You may find that you need to use some other material to bulk out the channel a bit, like ice cream sticks or sheets of cardboard. The other way of improving the launcher is to add a bigger motor. We have used the smaller of the 6V motors we could buy, but there are bigger, more powerful ones, too. These may give a better launch power and overcome the friction involved a bit better.
We used a TIP41 NPN transistor as our motor driver These can handle the current of a bigger motor, at least as big as any 6V hobby motor you are likely to find. However, they are not the best choice because the base current needed is quite high: They have a low gain. You might like to look for a transistor with a big collector-emitter current but a smaller base-emitter current. In other words, better gain. However, we chose this one because it is available over the counter, and it is not as expensive as some of the higher-gain options.
The result is that you will need to keep an eye on the the heat of the transistor, as it will be operating below saturation and not completely on. You can reduce the value of resistor R4, but it may heat up if it is made much smaller because values below 150Ω for a 1/4W resistor and 75Ω for a 1/2W resistor, will exceed their power dissipation rating. Also, the collector-emitter current limit of the BC547 is 100mA, so this cannot be exceeded either.
FINDING PIN 1
Finding Pin 1 of any IC is a bit confusing for anyone new to it. That's because there are different marking systems around. Generally, the text will be printed so that when reading it, pin 1 is to the left. Pin 1 always starts in the same place on any IC, so it is always the top left when the IC is held vertically, or the lower left when held horizontally. But what if the text is not there, or is hard to see? All ICs have another way of identifying Pin 1.
The most common today is a notch. This is a u-shaped depressed moulding in the left-hand end of the IC. It is always in the middle of the left-hand side of the IC when held horizontally, or the top when held vertically. Then, Pin 1 can be found because it is always to the left of the top of the IC for the vertical orientation, or below the left for the horizontal.
Some ICs have a dot moulded over pin 1. This one is obvious, sort of. The dot may be a rounded detent moulding, a printed dot, or maybe a circular impression. The problem with the circular impression, which often doubles as the mould gate where air and excess plastic leave the mould in the making process, is that it is not always clear. The bigger problem is with the IC below, where there is a printed dot but also a mould gate at the end, which is a bigger round circle in this case. Always check closely if you are unsure if a mark is a mould gate or an actual pin 1 indicator. A dot never replaces the notch in the middle, so in this photo, the mould gate cannot be the pin 1 marker.