basic electronics how do i hook up a ________ to my ________circuit?
TRANSCRIPT
+ V -
Electricity in a circuit• Potential
Volts [ V ]
• Current
Amps [ A ]
• Resistance
Ohms [ Ω ]
• Power
Watts [ W ]
R
I
+ V -
Electricity in a circuit• Potential
Volts [ V ]
• Current
Amps [ A ]
• Resistance
Ohms [ Ω ]
• Power
Watts [ W ]
Fluid flow through pipe • “pressure”
• “rate of flow”
• “pipe length or diameter”
• rate of energy
Image: http://www.productionapprentice.com/
R
I
Combining Stuff
Series R (adds)
Rtotal = R1 + R2 + R3
Parallel R (decreases)
Rtotal =
1 / [1/R1 + 1/R2 + 1/R3]
Kirchoff’s Current Law: I out = I in
Node A: i2 = i3
Node B: I = I1 +I2 +I3
A
B
V = I * Rvolts = amps * ohmsvolts = mA * Kohms
OHM'S LAW
I
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.
Diodes
• “One-way” Valve: only allows current flow in one direction
• Vdiode 0.6v (when “on”)
P-N Junction
V-I CurveIf |ID| > Imax“I’m on fire”
ID = 0“I’m off”
@ Vd < Vbreakdown, ID = is Negative“OK, I give up”
Using Diodes
• Limit Current (I < Imax)• Vdiode ~ 0.6v
NO!OK
Choose R >>(5v - .6)/ Imax
R= 4.4v/ 20mA = 220 Ohms
R=?(VR = 5v-0.6v
(V0.6v)
Which of These Work?
330 10K 3300
OK NOPE:Not Enough
Current
NOPE:LED
Backwards
NOPE:Answer underneath
LED Facts
• 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
Other Colors:
I
V
OFFON happy
Von
1.5 V
On fire
anode
cathode
I
LED
+ 1.5 V -
Wants ~10 mA
I = ??
mA 6.10330
5.15
R
VI
Other Colors:
10-20mA or More
Answer underneath
digitalWrite(0,HIGH); // applies 5V to pin 0delay(1000); // waits a seconddigitalWrite(0,LOW); // applies 0V to pin 0
ARDUINO CONTROL OF LED
ARDUINO
PIN 0
GND
5V
0V
20 mA max
Crucial
anode
cathode
I
LED’s off a battery?
+ 1.5 V -
Vbattery
R = ??Other Colors:
10-20mA or More
Vbatt 3.3v 5v 9v 12v
R10mA= 160 330 730 1K
RVR=Vbatt-Vcolor
Vcolor=?Idesired=?
R = (Vbatt – Vcolor)/IdesiredAnswer underneath
Wants ~10 mA
Light 3 LEDs via 1 Pin
ARDUINO
PIN 0
GND
5V
0V
20 mA max
Need 30 to 60 mA & 3 Resistors
Only draws 10 to 20 mAOnly needs 1 resistor
Chose R = (9v – 3*1.7)/11mA
DEVICEPIN 0
GND
5V, 20 mA
ARDUINO
What if device needs more than 5V ormore than 20 mA??
…Need Arduino-actuated Switch
Transistorcurrent-controlled amplifier, current-controlled switch
I big = b*I smallI small
BASE COLLECTOR
EMITTER
Think: spray can!
5V
0V
LOAD: MOTOR, SOLENOID, RELAY, LAMP, …
I
V
I
V
ON
OFF OFF
ON
Vce sat0.1 – 2.0 V
Vbe 0.6v
+
-
Arduino
Arduino
(BJT) Transistors
• “One-way” Amplifier• Can use as an on-off switch
N-P-N Junction V-I CurveIf |Ice| > Imax“I’m on fire”
Ice = 0“I’m off”
IbI
V
OFF
ON
Vce sat0.1 – 2.0 V
Inside (BJT) Transistors
• 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
N-P-N Junction
Ic = b*Ib
Ie = Ib + Ic
Ib
Vbe 0.6v
Vce 0.6v to 2v (see datasheet)
5V
0V
OK NO!
Vbe=0.6v
Ib = (5-.6)V /1K = 4mA
Ib = (5-.6)V/ 0 = A
“I’m on fire”
Transistors Require a Resistor
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
Relays• Electromagnet-controlled switch• User for (1) larger loads, (2) bi-directional motor
COIL control side12V, 120 ohm, 100 mA5V, 500 ohm, 10 mA
CONTACTS load side240 VAC/28 VDC, 10 A100 VDC, 1A120 VAC/24 VDC, 0.5 A/1.0A
COIL CONTACTS
Types of relays
GENERAL PURPOSECOIL: 12, 24 VDC; 120 VACCONTACTS: 5-10 A
REEDCOIL: 5, 12 VDCCONTACTS: .5-2 A
SOLID STATECOIL: LOGIC INPUTCONTACTS: 2-25 A
#define MOTOR 0#define SWITCH 4...
digitalWrite(MOTOR,HIGH); delay(1000); // wait for motor to clear switch while (digitalRead(SWITCH) ; digitalWrite(MOTOR,HIGH);...
WIRE
1. CONNECT POINTS OF EQUAL VOLTAGE2. CARRY CURRENT
SMALL WIRE+
HIGH CURRENT
STRANDED SOLIDFlexible 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 5 A
House wire 14/12 15/20 A
“CABLE” = multiconductor wire bundlee.g. modular phone cord: 28g solid, 4 conductor
BATTERIES• Primary
– Zinc– Alkaline (most
common)– Lithium (camera,
watch)• Secondary
(rechargeable)
– Sealed lead acid (car)
– Gel– NiCd– NiMH– Lithium
• Important specs
– Energy density– Voltage
• Zinc/Alkaline: 1.5 V• Lead Acid: 2.0 V
– cars: 6, 12 V• NiCd: 1.2 V
– Power tools: 4.8, 6.0, 7.2, 9.6, 12, 18 V
– Maximum current• “Cold-cranking amps”
– Capacity• 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)
Discharge curve
t
9V
Alkaline technology
See www.duracell.com (or other sites) for more
mA
Hrs
100
1
10010
Service life
Battery technologiesChemistry Energy density
(W-H/Kg) Cell voltage
NiCd 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