* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Document
Survey
Document related concepts
Operational amplifier wikipedia , lookup
Valve RF amplifier wikipedia , lookup
Power electronics wikipedia , lookup
Power MOSFET wikipedia , lookup
Surge protector wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Electrical ballast wikipedia , lookup
Opto-isolator wikipedia , lookup
Current source wikipedia , lookup
Charlieplexing wikipedia , lookup
Galvanometer wikipedia , lookup
Transcript
Basic Electronics How do I hook up a ________ to my ________circuit? I R + V - Electricity in a circuit • Potential Volts [ V ] • Current Amps [ A ] • Resistance Ohms [ Ω ] • Power Watts [ W ] I R + V Image: http://www.productionapprentice.com/ Electricity in a circuit • Potential Volts [ V ] Fluid flow through pipe • “pressure” • Current Amps [ A ] • “rate of flow” • Resistance Ohms [ Ω ] • “pipe length or diameter” • Power Watts [ W ] • rate of energy Combining Stuff Series R (adds) Parallel R (decreases) Rtotal = R1 + R2 + R3 Rtotal = 1 / [1/R1 + 1/R2 + 1/R3] A B Kirchoff’s Current Law: I out = I in Node A: i2 = i3 Node B: I = I1 +I2 +I3 OHM'S LAW V=I * R I volts = amps * ohms volts = mA * Kohms + V R - Electrical Power (Watts) P=V*I = I2 * R = V2 / R Circuit Analysis How-To: 1. Draw schematic (e.g battery, LED’s, etc.) 2. For each component: Write down what you know (V, I, R, or Pmax) 3. Use equations to get the rest: V=I*R, P=V*I, Iin = Iout, Ic = b*Ib, 4. Still missing a value? look it up on a datasheet or I-V curve and go to step 2. How much Current is flowing through this resistor? I Answer underneath I = V/R = 9V/1K = 9mA = .009A resistor I 1/R V Diodes P-N Junction V-I Curve If |ID| > Imax “I’m on fire” • “One-way” Valve: only allows current flow in one direction • Vdiode 0.6v (when “on”) Using Diodes • Limit Current (I < Imax) • Vdiode ~ 0.6v Choose R >> (5v - .6)/ Imax R=? (VR = 5v-0.6v (V0.6v) R= 4.4v/ 20mA = 220 Ohms OK NO! How do I hook up an _LED_ to my Arduino circuit? Which of These Work? 0 NOPE: 330 10K OK NOPE: Answer underneath Not Enough Current 330 NOPE: LED Backwards LED Facts On fire • Only allows current in one direction (lights up) • Only happy at particular voltage and current give it both – About 10 to 20mA – About 1.7V for Red LED’s – Check a datasheet for exact info I ON OFF happy Von 1.5 V V Other Colors: LED anode Wants ~10 mA I cathode + 1.5 V - I = ?? Other Colors: V 5 1.5 I 10.6 mA Answer underneath R 330 10-20mA or More ARDUINO CONTROL OF LED ARDUINO Crucial 5V 0V PIN 0 20 mA max GND digitalWrite(0,HIGH); // applies 5V to pin 0 delay(1000); // waits a second digitalWrite(0,LOW); // applies 0V to pin 0 LED’s off a battery? Wants ~10 mA anode I cathode + 1.5 V Vbattery R VR=Vbatt-Vcolor Vcolor=? Idesired=? Vbatt R = ?? Other Colors: 3.3v R10mA= 160 5v 9v 12v 330 730 1K Answer underneath R = (Vbatt – Vcolor)/Idesired 10-20mA or More Light 3 LEDs via 1 Pin ARDUINO 5V Need 30 to 60 mA & 3 Resistors 0V PIN 0 20 mA max GND Only draws 10 to 20 mA Only needs 1 resistor Chose R = (9v – 3*1.7)/11mA How do I hook up a _____* to my Arduino circuit? *Anything other than an LED ARDUINO 5V, 20 mA PIN 0 DEVICE GND What if device needs more than 5V or more than 20 mA?? …Need Arduino-actuated Switch Computer controlled switch V big DEVICE ARDUINO PIN 0 GND I big Arduino I ON OFF V LOAD: MOTOR, SOLENOID, RELAY, LAMP, … Transistor current-controlled amplifier, current-controlled switch BASE COLLECTOR I small I big = b*I small EMITTER Think: spray can! COLLECTOR BASE EMITTER Ic = b*Ib Ib Ie = Ib + Ic ONE-WAY! Arduino 5V Arduino 0V + Vbe 0.6v - ON I ON I OFF V OFF Vce sat 0.1 – 2.0 V V LOAD: MOTOR, SOLENOID, RELAY, LAMP, … (BJT) Transistors V-I CurveIf |Ice| > Imax N-P-N Junction “I’m on fire” ON I Ib OFF Vce sat 0.1 – 2.0 V • “One-way” Amplifier • Can use as an on-off switch V Inside (BJT) Transistors Ic = b*Ib N-P-N Junction Ib Ie = Ib + Ic Vbe 0.6v Vce 0.6v to 2v (see datasheet) • 1 electron injected at base about 150 electrons flow at collector (exact number is called: b) • Vbe 0.6v (just like a diode) • Vce 0.6 to 2v How do I hook up a _____* to my Arduino circuit? *Anything other than an LED Transistors Require a Resistor Ib = (5-.6)V /1K = 4mA Ib = (5-.6)V/ 0 =A 5V 0V Vbe= 0.6v OK “I’m on fire” NO! Which Transistor? TO-92 TO-220 2N3904 TIP120 100 mA 1-2 A TO-3 20-50 A Things to look for on a data sheet • • • • • • Max current, Ic max Max volts, Vce max Max power, P max Vce sat Gain: Hfe or b Switching time 2N3904 TIP 120 Electronics Part II …w/ Demo’s Interfacing to Motors Hook motor straight to Arduino? Motor interface FOR SMALL MOTOR, USE 2N3904 Pin 2 GND - + Arduino pin limits 20 mA per PIN 40 mA TOTAL 10.6 mA 4.4 mA 1A POWER + V I P=V*I - P = ?? I = V/R = 9/10 = 0.9 A Answer underneath P = V*I = 9*.9 = 8.1 W I P = 12 * I HEAT I, V t, w WOW! WHAT A GREAT MOTOR I GOT AT AX-MAN! AND IT RUNS ON 12v! Later… YOUCH!! IT'S HOT! 12 V 5.0 0.6 ib 4.4 mA 1000 5V Ic Ib Vce sat ~ 2.0 V Let Ic = 5 A HOT PWR = V*I = 2.0*5 = 10 W !!! wasted 5V 0V ON I ON I OFF V OFF Vce sat 0.1 – 2.0 V V LOAD: MOTOR, SOLENOID, RELAY, LAMP, … RELAYS To control larger loads Relays • Electromagnet-controlled switch • User for (1) larger loads, (2) bi-directional motor COIL COIL control side 12V, 120 ohm, 100 mA 5V, 500 ohm, 10 mA CONTACTS load side 240 VAC/28 VDC, 10 A 100 VDC, 1A 120 VAC/24 VDC, 0.5 A/1.0A CONTACTS Types of relays GENERAL PURPOSE COIL: 12, 24 VDC; 120 VAC CONTACTS: 5-10 A REED COIL: 5, 12 VDC CONTACTS: .5-2 A SOLID STATE COIL: LOGIC INPUT CONTACTS: 2-25 A JAMECO 174431 COIL: 12 V, 400 OHM, I = V/R = 12/400 = 30 mA CONTACT: 24 VDC, 15 A Transistor drive for a relay NOTE: RELAY COIL CAN SUCK CURRENT SOLENOIDS For linear, short-range, on-off motion x F Force when energized MAX ON-TIME = ½ SEC ¼ in. x www.jameco.com SPST (NO, NC) Switches SPDT #define MOTOR 0 #define SWITCH 4 . . . digitalWrite(MOTOR,HIGH); delay(1000); // wait for motor to clear switch while (digitalRead(SWITCH) ; digitalWrite(MOTOR,HIGH);. . . Read the rest in the on-line notes WIRE 1. CONNECT POINTS OF EQUAL VOLTAGE 2. CARRY CURRENT STRANDED Flexible SMALL WIRE + HIGH CURRENT SOLID Higher current Type Gauge Max I Notes Wrap wire 30 200 mA wrapping, signal level only Hookup 24/22 1-2 A general purpose Lamp cord 18 5A House wire 14/12 15/20 A “CABLE” = multiconductor wire bundle e.g. modular phone cord: 28g solid, 4 conductor BATTERIES • Primary • Important specs – Zinc – Energy density – Alkaline (most – Voltage common) • Zinc/Alkaline: 1.5 V – Lithium (camera, • Lead Acid: 2.0 V watch) – cars: 6, 12 V • Secondary • NiCd: 1.2 V (rechargeable) – Power tools: 4.8, 6.0, – Sealed lead acid (car) 7.2, 9.6, 12, 18 V – Gel – Maximum current – NiCd • “Cold-cranking amps” – NiMH – Capacity – Lithium • Amp-hours or mAHrs Capacity and discharge • 12 V (10 cell) NiCd pack rated at 1300 mAH – 1.3 Amps for 1 hour – 520 mA for 2.5 hours…..in theory • Top-notch cells for RC racing can provide 2300 mAH • 9V alkaline – 580 mAH @ 12 mA (can deliver 12 mA for 48 hrs) 100 Service life Hrs 1 10 mA 100 Alkaline technology 9V Discharge curve t See www.duracell.com (or other sites) for more Battery technologies Chemistry NiCd Energy density Cell voltage (W-H/Kg) 38 1.2 Lead Acid 40 2.0 NiMH 70 1.2 Carbon-Zinc 75 1.5 Alkaline 130 1.5 Lithium-Ion 130 3.7 Lithium-Poly 190 3.7 Lithium 300 3.0 www.hardingenergy.com