|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following is the work of Ivan Thorson. Ivar Thorsons Electronic Crash Course The Fundamentals and Ohm’s Law: Current is the number of electrons flowing through something. Current is usually measured in Amperes (or amps). One amp is defined as one coulomb (6,280,000,000,000,000,000 electrons!) of electrons flowing per second. If you want to use the water analogy, think of this as the volume of water flowing through a pipe. Voltage is the difference in electrical potential between two points. Positive voltage is usually defined as the absence of electrons; negative voltages have an excess of electrons. Ground is defined as totally neutral, with an even amount of protons and electrons. Think of voltage as the amount of pressure the water in the pipe is under. Another analogy might be to think of a rock. (Before you start laughing at the rock bit, let me continue!:-) The rock’s voltage is its height relative to ‘ground’ level, which is where it would normally rest. If, for example, you lifted the rock above the ground, it would have a positive electrical potential equal to its height; conversely, if you dug a hole and put the rock in it, the rock would have negative potential relative to ‘ground’. This is a very loose description, but may help you understand it better. Resistance is measured in Ohms. At a given voltage, the resistance determines the amount of current that can flow, according to Ohm’s law. Think of resistance as the size of the pipe the water is flowing through. The larger the pipe (Lower resistance), the more water (current) can flow through. IMPORTANT: Voltage and resistance determine how much current will flow. Current and resistance do NOT determine the voltage. In electronics-speak, "the voltage leads the current". Ohms law is: I = E/R When: So, to show a relevant example, let’s pretend that I have a 9 volt battery, and I want to use it to power a solarengine instead of a solar cell (maybe I broke all my solar cells, as I sometimes do). Grabbing a resistor that I have lying around, I read the color coding (more on that later), and find that it is a 2.2K Ohm resistor (2200 Ohms). Plugging these two variables into the formula, I get: I = E/R 0.00409 amps rounds to 0.0041 amps, or 4.1 mA. This should be more than enough to power your average solarengine, unless it’s very inefficient or was made incorrectly. Remember, you can still work backwards with this formula. For example, if you needed 10 mA (0.01 Amps) to power something, such as a coil with a resistance of 1000 Ohms, you get: I = E/R By the way, it’s the current that will kill you. High voltages are dangerous because your even though your body has a fairly high resistance (varies from 100K Ohms or less to several Megs), a high voltage allows more current to be passed through your body.
Resistors
Resistors come in a few different wattage ratings; common power ratings are 1/8, 1/4, 1/2, 1, and 2 watts. If a circuit doesn't specify which wattage rating to use, I generally use 1/4 watt carbon film resistors. Larger watt resistors are physically larger and able to dissipate more heat.
Resistor color code chart
There are two kinds of resistor color coding, the four-band system and the five-band system. In the four-band system the first two color bands are the first and second digits of the resistance, the third is the multiplier, and the fourth digit is the tolerance. Example: Brown-Black-Green-Gold Red-Red-Red-Gold How do you tell which band is the first band? It's the one closest to the edge of the resistor. The 'last' band should be somewhere near the center of the resistor. In the five-band resistor system, the first three bands are the first three digits, and the fourth and fifth bands are the multiplier and tolerance, respectively. Since this allows you to be more precise (three significant digits), the five band system is generally on precision resistors. A resistor with a tolerance of 10% means that it will vary plus or minus ten percent of it's rated value. A 300 Ohm resistor with a 10% tolerance will vary 30 Ohms either way, meaning its actual resistance is between 270 and 330 Ohms. The most common tolerance is 5%, and there is usually no need for a smaller tolerance unless the circuit demands it. Potentiometers Potentiometers, or pots, are very useful when dealing with analog electronics. They are essentially a long resistor hooked up to a 'wiper' that slides along the resistor, which provides adjustable resistance. Pots are sometimes called trim pots when used to 'trim' a circuit so that it runs straight. This is often literally true when dealing with microcore walkers; once trimmed, they walk considerably straighter. I was going to have pictures of the different sizes and shapes of pots, but my scanner just broke. So I'll describe them. Cylinders with shafts sticking out, little boxes with a flathead screw on one side, or oblong shapes with other methods of adjustments. All potentiometers have three terminals and a shaft or screw head that can be turned to change the resistance. Pots have three terminals, which makes them very versatile. The pot has a fixed resistance between the outside two terminals(we'll say 1 meg, for this example), and the center terminal sort of slides (or rotates) back and forth along the resistor. When the pot's shaft is turned all the way clockwise or counterclockwise, there is 1 meg of resistance between the center terminal and (for example) the left terminal. Between the right terminal and the center terminal, there is now (ideally) no resistance. Turning the shaft all the way the other direction should reverse the situation, and there should be 1 meg of resistance between the center terminal and the right terminal. Turning the shaft somewhere in between gives some ratio in between, for example 600K of resistance from the center terminal to one terminal, and 400K to the other terminal. The resistance between the center terminals and the outside terminals must always equal the resistance between the outside two terminals There are two main kinds of pots: linear taper and logrimithic or exponential taper. Linear taper means that turning the wiper alters the resistance by a linear amount (ie. one hundred ohms per degree). Logrithimic or exponential taper means that turning the first degree may vary the resistance by a 4 ohms, the second degree is 9 ohms, the third degree is 16 ohms, etc. This sort of exponential taper is common when used with sound systems, as sound does not get 'louder' at a linear rate. Capacitors
Capacitors are measured in Farads. One Farad is equal to one Coulomb of
charge at one Volt of potential. Again, one amp is equal to Coulomb of electrons
per second. One Farad of Capacitors come in two general flavors, polarized and non-polarized. Polarized capacitors have a positive and negative terminal, and you had better pay attention that you stick it in the circuit right, because certain capacitors can explode when connected backwards at their rated voltage. There are many different kinds of capacitors (Figure three shows a few kinds), all of which have different tolerances (this is just like a resistor's tolerances, but I will explain it again). A tantalum capacitor may have a rating of +/- 20%. This means that value of a 10uF (0.00000001 Farad) capacitor may actually have a capacitance of 8 to 12 uF, depending on the temperature of the capacitor. Don’t worry, this should affect your circuits little unless it is sensitive. Ceramic capacitors are often the worst; they usually have a +60% / -40% rating, so a cap rated 10uF may actually be between 6 and 16 uF! I prefer using +/-5% capacitors, but that’s a personal preference. Many circuits use ceramic capacitors with no trouble at all. When building microcores, it is generally wise to stay away from caps with ratings worse than +/- 20%. Other commonly known types of capacitors are polyester, electrolytic, polypropylene, stacked metallized film, gold foil, and others. Safety note: Don’t play with high voltage or super large capacitance capacitors, such as the ones out of camera flashes. They can be very dangerous! Though it may only have a few mF of capacitance, it is at a very high voltage and is designed to discharge very rapidly! Always discharge a capacitor before touching it by using a resistor (Use ohm's law to figure out how larger, generally bigger than 2K is fine for most voltages) to short out the two terminals in the capacitor. Hold it there for 30 seconds to assure that it is discharged. I once touched my thumb to a camera flash capacitor that I assumed was discharged and I received a nasty shock, and assumed I had discharged it entirely. WRONG! I got shocked 2 times more, though not as badly as the first...
Parallel and series circuits Figure 4 is the standard parallel circuit using resistors as an example. The resistors could be replaced with, capacitors, diodes, solar cells, and other components and it would still be a parallel circuit.
Figure 6 is a series-parallel circuit, named so because it is a combination of a series and parallel circuit. Makes sense, doesn't it?!
The math of series and parallel circuits For resistors, the formula for resistors in series is: RTotal = R1 + R2 + R3 + ... +Rn Simple, huh? Just add all the values together. For resistors in parallel it gets more difficult. RTotal = 1 / [(1/ R1) + (1/ R2) + (1/ R3) + ... + (1/ Rn)] And for calculating series parallel circuits (fig 3), you just calculate the parallel portion of the circuit first (usually), and then take the equivalent resistance of the parallel circuit and substitute that into the series circuit equation. Then repeat those two steps again, if need be. Just use your math and logic skills; you’ll be fine. Finding the capacitance and voltage ratings of capacitors in series and parallel is simple as well. For finding the equivalent voltage of capacitors in series, just add the voltage ratings of all of the capacitors together. For finding the voltage rating of capacitors in series, you just take the value of the capacitor with the lowest voltage rating, as common sense suggests. Finding the combined capacitance of capacitors in parallel with one another is easy too; add the capacitance of all the capacitors together. However, finding the capacitance of capacitors in series, you must use a more complicated formula: CTotal = 1 / [(1/ C1) + (1/ C2) + (1/ C3) + ... + (1/ Cn)] Note that this is the same as the formula for resistors in parallel. For other components, (solar cells, coils, etc.) you can generally just guess which of the formulas to use, based on what you know about the component. Putting three solar cells in parallel will triple the current, putting them in series will triple the voltage. Simple, eh? Well, not quite, as a three identical solar cells in series will produce triple the voltage, and put out the same amount of current as one of the single solar cells. Above all, use common sense.
RC circuits ...and no, this doesn’t mean Radio Controlled...:-> RC circuits, or Resistive-Capacitive circuits are used very often in electronics as well as in BEAM (take a close look at the microcore).
You’re charging a capacitor with a 10 V battery. So, starting with a dead capacitor, the charge cycle goes as follows. 0 0V If you didn’t catch all that simple (and mildly rounded) math back there, then all that you really have to know is that after 5 time constants, a capacitor is considered charged for all intents and purposes. Mathematically, the capacitor will continue to charge closer and closer to the source voltage forever, but that doesn’t happen in real life, since capacitors leak and are imperfect. So, now that you know how a capacitor charges, how do you find the time constant? T = RC Simple, eh? So a 1 mega ohm resistor charging a one uF capacitor the time constant would be: T = (1,000,000)(0.000,001) Brilliant! From this we can find that it would take roughly 5 seconds for the capacitor to reach the source voltage. If you didn’t understand all of this, consider the water analogy again. We know that the resistance of a circuit is equivalent to the size of a pipe, generally speaking. A capacitor is kind of like a big water tank. As the water pours in from the pipe, it begins to fill up the tank. However there is "air" in the tank that keeps the water from coming in at a constant rate. The air compresses as the water comes in, causing the water to come in more and more slowly until the water has filled up the tank and compressed the air into an infinitely small space. When that has happened, the capacitor is charged. Generally speaking, though, after 5 time constants it's considered charged (99% worth, at least). Diodes and Transistors Diodes and transistors are generally comprised of two types of silicon; for lack of a better name, we’ll call them type P and type N silicon, and let's not go into molecular details, this is a crash course, after all....P means that it is positively charged, N is negatively charged. When combined together, these two types of silicon make diodes, transistors, and all that nifty stuff that allows computers to work...Transistors are also a whole lot smaller and cheaper than their predecessor...the vacuum tube. Diodes have a single junction, which is where the P silicon and N silicon touch. When the P silicon is connected to a positive voltage greater than what is called a threshold voltage (0.7 for silicon, 0.3 for germanium), the diode conducts almost like a closed switch and is called forward biased. If you connect the P silicon to a negative voltage, then it is considered reverse biased and will not conduct electricity. The P silicon in a diode is called the Anode, the N silicon is the Cathode. I don't have any pictures of diodes handy at the moment, but they are similar in shape to resistors. Cylindrical shaped, with two leads sticking out each end (Radial). However, diodes are smaller, lots of different colors, and have no markings except for possible black band denoting the Cathode. Transistors:
Bipolar transistors come in a variety of packages and types. They are called Bipolar because they have two junctions, and can be divided into two types: PNP and NPN. NPN means that it has two negative silicon plates sandwiching a positive silicon plate. They can almost be thought of as two diodes that were squished with the P or N sides together. Almost every transistor has three pins(Unless you broke off a pin, or it has four!); a collector, base, and emitter. The emitter pin is designated by a small arrow pointing in (towards the center of the circle) or out (away from the center). The easy way to remember if a transistor is a PNP or an NPN by looking at a schematic is to see if the arrow is pointing in or out. It's a NPN if the arrow is "Not Pointing iN", and a PNP if the arrow is "Pointing In Point. (I know it's fairly redundant, but it works for me!) Transistors can act like amplifiers or switches. They have something called gain (or beta) which is a term to describe the ratio of increase in current, voltage, or both of the transistor. A transistor with a gain of 150 (typical for small transistors, for power transistors it's more like 30 to 70) can amplify a signal coming to the base about 150 times before it reaches the collector. As for the actual transistor operation, it's magic until you read a book about it. Which I recommend you do.
Integrated circuits
Examples of DIP IC's are the 74ALS245, 74C14, 7404, and all those other cryptic part numbers that you will gradually pick up. You will learn to love IC's, as they will save you a lot of time since they contain tiny circuits that will prevent you from having to solder together lots of transistors and resistors to get a digital logic gate. What's that? See below. Digital Logic Gates Digital logic gates are generally 2-state devices (Off/On, Low/High, 0/1. All the same, just named different.) Here are the main variety of gates and their truth tables: (A and B are inputs, OUT is, well... the output! 1 is HIGH or close to positive source, 0 is low or close to ground/negative source)
...man it's a pain working with tables by hand...need an HTML editor... By looking at the tables, it's easy to find out what gate you need for different applications. See below for info on what they look like.
The Binary System It may help you to know the binary system. Generally you use hexadecimal (or hex for short) with small microcontrollers, so here are the first 16 numbers in decimal (base 10), hexadecimal (base 16) and binary (Base 2).
Notice that it takes four bits (each 0 or 1) to describe a single digit in Hex. Four bits is called a nibble, and 8 bit word is a byte. Other things to Know Voltage ratings: Voltage ratings are the maximum voltage that can be safely applied to a component. This doesn't mean you have to run it at that rating, though! I have often used a 63V capacitor for a 3V application and it works fine. A 10 or even 6 volt rated cap would have been preferable, but wasn't available to me at the time. Besides, a lower rated voltage cap will be smaller for it's capacitance. Static discharge: This usually isn't an issue in BEAM robotics. Watch out for MOS (Metal Oxide Semiconductor), they fry easily. Also, any Pentiums or Pentium II's are also easily fryable...If it worries you, ground yourself (touch metal or dig deep hole and stick arm in it...) before working with the parts. Wrist bands are available that will automatically keep you grounded, as well.
DC current: Direct current. Think batteries and the like. Current flows one way. Filter caps and Rectification: Filter caps and diodes are used to take an AC waveform and convert it into DC current. How's it do that? Well, figure 11 shows us all we need to know. Figure 11-A shows the standard sine wave of an AC circuit, 11-B shows it after it's been half wave rectified by using diodes in the pattern used in figure 11-C. 11-D shows what happens when a large enough capacitor is placed between positive and ground, and acts as a filter capacitor. This is greatly exaggerated, as good filter capacitors and voltage regulators can make the ripple virtually nonexistent. This process is basically what happens in your household AC adapters used for CD players and other systems. However, they also use transformers to step down the voltage. Transformers: Transformers have to main coils, a primary coil and a secondary coil. The primary coil is attached to the AC source voltage, and the secondary coil(s) will step up or step down the voltage according to the number of turns it has relative to the primary coil. If the primary coil has a 100 turns, and the secondary has 200, it will double the voltage and halve the current. So a 1 amp of current at 10 volts flowing through the primary coil would yield us 20 volts at 0.5 amps at the secondary coil. Transformers lose energy in the transfer, however, and only work with AC current. Zener Diodes: Zener diodes act like normal diodes, except their forward voltage threshold is built to be many times higher, for example 3.3 volts or more. Up until their forward threshold voltage, they act like a reverse-biased diode.
FLED's : Flashing Light Emitting Diodes. They have a built in circuit that flashes the LED on and off. Their forward threshold voltage is around 2.3 volts., making them useful for solarengines. Photoresistors: Resistors that change their resistance in different light levels. Great for making walkers phototropic. Phototransistors: Transistors that change their gain in different light levels. Photodiodes: Diodes that both emit a small current and have their forward threshold voltage change in response to different light levels. 3-State logic: High, low, and a high impedance state. Basically, this allows a computer or logic circuit to output a 1, a 0, or switch to a high impedance (almost like high resistance, see below)state where it doesn't affect the circuit it's connected to. Impedance: Impedance is defined in Ohms, just as resistance is, but describes the "total" opposition to AC current flow, taking into account both resistive and reactive (like a capacitor) components into consideration. Wires and copper traces: Those copper lines on the bottoms of circuit boards. They conduct electricity from component to component.) are assumed to have no resistance, so as not to affect the operation of the rest of the circuit. In real life, there is some resistance, but it can usually be ignored unless it is a very sensitive circuit. A larger wire will have less resistance then a small one; there's more metal for the electricity to flow through. Same goes for traces on the bottoms of copper clad boards.
Reading a schematic Reading a schematic isn't tough, just takes practice and a little thought. Here's a diagram with all of the commonly used electronics symbols on it...Keep in mind that these symbols may differ from schematic to schematic in some slight ways. For example, the resistor may have two or three little zigzags. Good circuit diagrams will also explain what obscure components are, anyway.
Notes : Switches : N.O. and N.C. stand for normally open and normally closed. SPST=Single Pole Single Throw. SPDT (Single Pole, Double Throw). Not shown is the DPDT (Double Pole, Double Throw) which is basically two SPDT's. Transistors : To find out which pin is emitter and which is collector (Base is always the center pin), check the data sheets of the transistor (usually in the catalog that you ordered the transistor from). Most 2NXXXX and 39XXseries general purpose transistors have a pin out of (from left to right, looking at the flat face of the transistor with the pins pointing down) Emitter, Base Collector.
Methods of building a circuit
The circuit shown at left is a half finished microcore. It works, but barely. If you decide to go with free form, STICK TO THE SCHEMATIC! Otherwise, you will get very confused and solder it together incorrectly.
Breadboard/Protoboard : They are wired up the same as the solderless breadboard, except that they are made up of fiberglass with copper traces on one side and holes drilled every 10th of an inch in a grid. Stick the leads through the holes, and solder them in place. No picture, I'm out of film. PCB : A lot of work. It's usually not worth designing one for just one robot. PCB's are those green things that you see everywhere inside of electronics. Homemade ones are usually yellowish, but no less effective. AUTHOR: Ivar Thorson I will take it from here
This is an awesome book by Paul Horowitz and Winfield Hill. Just get it. It costs Rs.300($6) in Moore market whereas you might have to pay Rs.375 in a branded book store like Higginbotham's. Awesome pricing because its a Cambridge low price edition. These are the links to some good basic electronic tutorials. Don't forget to come back! Ben Hitchcock's INFO - A basic electronics guide
|