|
|
(272 intermediate revisions by 6 users not shown) |
Line 1: |
Line 1: |
| {{ContentNeeded|This primer has the content from Power Supply primer?}}
| | #REDIRECT [[Improving Phidgets Hardware Reliability]] |
| | |
| | |
| ==Introduction==
| |
| | |
| This primer will help you power your Phidgets while being safe to the electronics. It mostly applies to Phidgets that:
| |
| * Use additional or external power such as being plugged into the wall power or a battery, or
| |
| * Need to be sensitive to external power such as powered digital inputs or analog voltage outputs
| |
| | |
| You've come to the right place if:
| |
| * You're looking to learn concepts for how to properly power a self-sufficient, wireless, battery-powered robot
| |
| * You're looking to use more than one motor controller and not destroy your controller or your PC in the process
| |
| * You need to isolate power in our out of the Phidget to make measurements as precisely as possible
| |
| | |
| We begin with the basic concepts and walk through hooking together a system.
| |
| | |
| You do not need to know much about electrical engineering to design a relatively robust system. However, without some forethought to power needs, cables, and hookups, you can generate problems ranging from spurious and strange to even destroying your Phidget and/or your computer.
| |
| | |
| ==Power Needs==
| |
| | |
| Let's say you want to run the SBC off of a battery. Or you want to run a motor controller with a power supply you bought from the hobby store. What do you need to buy? Will one you already have work? It is worth it to spend a moment with pencil and paper to work through this section and identify your power needs.
| |
| | |
| ===Voltage And Amperage===
| |
| | |
| Power supplies - whether wall power or batteries - are rated based on voltage and amperage.
| |
| | |
| These two concepts can be described with an analogy: a circuit is kind of like a water faucet. '''Voltage''' is the pressure on the faucet, and the water supply is '''amperage''', also known as current. Too much pressure behind your faucet, and the water mains or faucet will break. Likewise, if you have too much voltage from a power supply, your circuit will break.
| |
| | |
| But the faucet doesn't care whether there is a big reservoir or small reservoir feeding the system, as long as the pressure is managed. Likewise, you can choose a power supply with more amperage than you need (a big reservoir to draw from) as long as the voltage matches.
| |
| | |
| ===Picking a Power Supply===
| |
| | |
| The power requirements for Phidgets are given in volts, watts, or amps.
| |
| | |
| You should choose a supply with voltage that ''matches the range the Phidget can accept''. The voltage cannot be over the maximum (otherwise, like pressure in a pipe, the pipe will burst), and the voltage cannot be under the minimum (otherwise, like pressure in a pipe, no flow will occur).
| |
| | |
| You can safely choose a power supply with amperage over what the Phidget draws. In the same way that a faucet restricts water by design, electrical circuits draw and allow only the amperage that they need. However, the amperage cannot be less than the Phidget needs. In that case, you will either overextend (and break) your power supply, or the circuit simply will not turn on at all.
| |
| | |
| To obtain your power, you can get it from the wall mains, or from a battery bank.
| |
| | |
| ====Wall Power====
| |
| | |
| Wall power sources usually take the alternating current (AC) from the wall and convert it into a direct current (DC). These power supplies often take your familiar two-or-three prong wall connector and output power into a barrel plug-type connector. AC power (typically 110 to 240 volts) goes in the typical wall plug, and DC power (typically 5 to 24 volts) comes out the barrel plug. Most power supplies of this type list the conversion explicitly, such as: 110-240 Volts to 12 Volts at 2 Amps. You'll want to match your needs against the 12 Volts at 2 Amps
| |
| | |
| A wall power supply is essentially an inexhaustible supply of current, so you don't need to worry about it running out like you would with batteries.
| |
| | |
| ====Battery Power====
| |
| | |
| If you intend to use a battery bank (even of only one battery) to power your Phidget, you probably want to know what type of battery to purchase.
| |
| | |
| Batteries are chosen first by their voltage (V). Match the voltage exactly to the voltage the Phidget needs. Over or under this value, you could harm the board or have it simply fail to turn on.
| |
| | |
| Next, choose a battery that has adequate amperage to feed your device for the time you need. The lifespan of the battery will usually be listed in Amp-Hours (or Ah). For example, a double wide 12 V lantern battery will have usually around 7-8 amp hours. This means if you drew one amp from it for seven to eight hours, the battery would be totally drained. Or you could draw two amps from it and drain it in 3.5-4 hours. A deep cycle rechargeable 12 V car or marine battery for use in a solar setup would have 70-100 amp hours.
| |
| | |
| Finding the amperage or voltage sometimes needs to be done indirectly by using a specification of Watts. The relationship between amperage, voltage, and watts is:
| |
| | |
| <math>
| |
| \text{Amperage} =\frac{\text{Watts}}{\text{Voltage}}
| |
| </math>
| |
| | |
| For an example, let us say you want to use battery power to run the [[SBC|Phidget Single Board Computer]]. The specifications say that it uses 1.2 watts as a base value. The specifications also say that it can take 12 V DC power. If we choose to use a 12 V battery, at 1.2 watts it will use 0.1 amps according to the equation above. Going by amp-hours alone, if our battery is a double-wide lantern type 12 V battery, with 7 amp hours, with 0.1 amp draw it will last 70 hours, or almost three days.
| |
| | |
| <math>
| |
| \text{Maximum Running Days} =\frac{\text{Battery Amp Hours}}{\text{Device Amps} * \text{24}}
| |
| </math>
| |
| | |
| However, to estimate ''average'' running time, amp-hours cannot be used so directly. Over time, batteries decrease in voltage as their power is used up. Practically speaking, this means that a connected device will draw more amperage. Say that our 12 V battery has decreased to 10.9 volts. Using the SBC example above, at 1.2 watts the SBC would now draw 0.11 amps, which would escalate the draining of the battery. You should usually only count on about 60% of the stated amp hour rating to apply before you expect to run into problems from escalated drain due to battery voltage drop. This is especially true for deep cycle rechargeable batteries left in an installation, where draining more than 60% could also harm the battery.
| |
| | |
| Then, for lead-acid batteries, a typical battery is tested from full to complete drain over 20 hours by the manufacturer to obtain the advertised amp-hour rating. Draining a battery faster than this will result in even more reduction in capacity, by 10% or more. This due to [http://en.wikipedia.org/wiki/Peukert%27s_law Peukert's Law].
| |
| | |
| There are plenty of [http://www.google.ca/search?&q=battery+calculator battery calculators] around the Internet which take most or all of these additional factors into account when recommending an amp-hour rating. For longer-term installations, the solar power online community has some excellent resources.
| |
| | |
| You can hook up multiple batteries in series to get more voltage at the same amperage. For example, you can hook up two single-wide 6 V lantern batteries in series to produce 12 V. This system would still only have the amp hours of ''one'' of the lantern batteries, because you will be essentially using them both at once. Or, you can hook up multiple batteries in parallel to get more amperage at the same voltage. For example, you could hook up two 12 V deep cycle batteries in parallel to provide more amperage at 12 V, which is like having a deeper reservoir of power for your device to use.
| |
| | |
| <span style="color:red;">Picture/schematic of batteries in parallel and series</span>
| |
| | |
| Finally, weight matters - a car battery is much heavier than a lantern battery. Batteries vary widely by weight per amperage. Lithium batteries are usually very light for their power, followed by alkaline, followed by lead acid. This may not seem important at first, but if you are building a mobile robot it is worth calculating in the work of carting around a battery. You may find that, for the length of time you want it to run, your battery requires some system redesign.
| |
| | |
| ====Multiple Devices====
| |
| | |
| If you are using multiple of the same Phidgets, they probably take the same voltage. Therefore, you can hook them up in parallel to one another, where the power supply is split into one branch per Phidget, and then the grounds are combined and connected to the power supply ground. This will hold the voltage across all the Phidgets at the same value as the power supply.
| |
| | |
| However, the current (amperage) consumption of the Phidgets must be added together to determine the total amperage you need.
| |
| | |
| ==Selecting Cables==
| |
| | |
| ===USB Cables===
| |
| | |
| In general, use the shortest cables possible. There are many reasons for this:
| |
| | |
| ; Long cables reduce the voltage that reaches the Phidget.
| |
| : This happens in both directions. So, for every unit cable length added, the voltage decreases by twice the electrical resistance of that length of cable. With especially long cables (> 5m) the Phidget may drop below its 4.6 volt threshold and simply never turn on.
| |
| | |
| ; Long cables increase the width of your circuit.
| |
| :All circuits act as emitting antennas for the resonance frequency of the circuit structure. The longer the wires in the circuit, the lower the frequency, and the higher chance that it will be emissions that will interfere with your data and system.
| |
| | |
| ; Longer cables have more length exposed to external interfering emissions.
| |
| | |
| Also, use thick cables that are built to specification. Some USB cables with thinner wiring have higher electrical resistance. This can be equal to what a much longer wire would have, and thus create a similar voltage drop where the Phidget will not turn on.
| |
| | |
| ===Power Cables===
| |
| | |
| There are a few "DC Wire Table" references on the Internet which describe how to pick a wire appropriate for your voltage and amperage.
| |
| | |
| As with the USB cables above, cut the cables to the shortest length possible. This is again both for voltage drop reasons and frequency emission reasons.
| |
| | |
| ==Hooking Up The Pieces==
| |
| | |
| Here, things can be tricky. You might think: just plug everything in and go! But often it is not that simple. Systems that require special attention in hooking things up are:
| |
| * Projects with long cables
| |
| * Projects with special USB cables
| |
| * Projects with two different power supplies, including:
| |
| ** Battery and wall power
| |
| ** Power from two different batteries
| |
| ** PC power over USB and battery power or wall power
| |
| | |
| ===Ground===
| |
| | |
| All circuits have a '''ground'''. This electric ground provides a voltage reference throughout the circuit. Ground is always '''0''' volts as far as the circuit is concerned. The reference allows all the parts of the circuit to speak the same language to each other, which matters a lot when a certain voltage means "1" and a certain voltage means "0".
| |
| | |
| There is only one '''absolute''' ground, and that is the Earth, which is taken to be 0 volts as an absolute value. Circuits not well-grounded to the Earth (of which there are many - your cell phone, car, etc) operate at a '''relative''' voltage. With relative voltage, only the difference between local ground and the local high voltage matters.
| |
| | |
| For example, a cell phone might operate as a 3 volt device, which means relative to its ground it always operates between 0 and 3 volts. But if that cell phone were compared carefully to Earth ground, its absolute voltage could be, say, between 10 and 13 volts. Until comparison, the device doesn't "feel" charged. This is the same as how you don't "feel" charged after skidding your feet in socks across a carpeted floor. But, when you "compare" yourself to Earth ground by touching some well-grounded metal, you receive a static electricity shock.
| |
| | |
| The same thing can happen when you combine two different power supplies, as we discuss [[#Projects With Different Power Sources|below]].
| |
| | |
| ===Projects With Different Power Sources===
| |
| | |
| When you connect two different power sources through a Phdiget, they share a ground. Sharing power is not always obvious. Some examples include:
| |
| * The USB power into a motor controller and the wall power into a motor controller
| |
| *
| |
| | |
| This problem does ''not'' apply to using a different power source for a black power plug and for the green control terminal block on, say, a DC motor controller. Although
| |
| | |
| | |
| | |
| ====Increasing Input and Output Precision====
| |
| | |
| <span style="color:red;">Layout of</span>
| |
| | |
| ===Hubs===
| |
| | |
| Avoid hubs where possible. Unpowered hubs are good for reading data from memory keys, but not for powering many external devices.
| |
| | |
| Basics
| |
| * Your circuit is a collection of garden hoses
| |
| ** Voltage is pressure
| |
| ** Amperage is the amount of water
| |
| * Interference can be created and absorbed by your circuit, both are undesirable
| |
| ** This interference is EM energy that travels through the air
| |
| ** It is especially produced by sudden changes
| |
| *** Even common things do this such as plugging in a long extension cord with nothing on the other end
| |
| **** The cord must equalize its electron balance with the wall power
| |
| **** The electron flow that makes this happen creates EM waves that affect (and potentially disrupt) electronics in the area
| |
| | |
| Picking a power supply
| |
| * Over-voltage rating matters, this will probably kill your circuit
| |
| ** Similar to putting so much pressure within a garden hose it blows up
| |
| * Over-amperage does not matter, the circuit can already control this
| |
| ** Similar to using a smaller nozzle on a garden hose - less flow
| |
| * Under voltage or under amperage and your circuit will:
| |
| ** Just not turn on
| |
| ** Turn on and then realize demands are too high, then turn off
| |
| ** Turn on and off, trying to fill the demands and then protecting itself for a short time before trying again
| |
| * Power supplies (even AC) have a set voltage, but that voltage is relative.
| |
| ** When a connection is first made, the board and supply settle their relative voltages.
| |
| ** This can generate a spark and feedback loop within the board
| |
| *** The board will get hot and should be unplugged within the first few seconds to prevent permanent damage
| |
| *** How to prevent?
| |
| | |
| Shielding
| |
| * Hard to do right
| |
| * Emissions hit shield and travel back to ground with resonance
| |
| | |
| Cables
| |
| * USB cables should be thick, and to spec
| |
| * USB depends on the fluctuations going out on +5V and back on ground to be well matched in time and distance
| |
| ** Their nearness causes their emissions to cancel each other out
| |
| ** Some cables have ferrite beads, which are low-pass filters (low frequencies pass)
| |
| *** This helps prevent a situation called USB common mode, where
| |
| * Some voltage is lost along the USB cable
| |
| ** Thin cables are more susceptible to this loss because they have higher resistance
| |
| ** The loss happens both ways, so the Phidget is running on a slightly reduced voltage gap from 5V
| |
| ** The thinner the cable, the more likely the Phidget will drop below its 4.5-4.6 V reset point
| |
| | |
| Size of circuit
| |
| * Circuits are always loops, and loops will resonate like antennas at a frequency determined by their size
| |
| * The smaller the loop, the higher the frequency
| |
| * Higher frequencies have a smaller potential to interfere with circuit frequencies
| |
| **Keep hookup wires short
| |
| | |
| Multiple power sources
| |
| * USB is one source, wall and battery power is another
| |
| * With only one device, not really a problem
| |
| * With more than one device, you create a closed loop between the two devices and the power source
| |
| ** Electrons can return via the grounds connecting both devices and the PC motherboard rather than just straight to wall or battery ground
| |
| ** Solutions:
| |
| *** Make the connections between all devices and battery or wall really desirable to electrons
| |
| **** Low resistance
| |
| **** Big fat wire
| |
| **** As short a wire as possible
| |
| ***Use a USB isolator
| |
| ***Use Ethernet for data rather than USB (or wireless), only for future Phidgets
| |
| * SBC complicates things...(three phidgets)
| |