useful circuitsx
Download
Report
Transcript useful circuitsx
A few useful circuits
Boris van Sosin,
Commissar-Engineer
A lecture for Arduino Course, Winter 2016/17
Technion, IIT
Voltage Divider
β’ Ohmβs Law:
ππππ‘πππ
πΆπ’πππππ‘ =
π
ππ ππ π‘ππππ
π
πΌ=
π
π
πΌ=
π
Voltage Divider
π
πΌ=
π
β’ Assume:
β’ Voltage reader has
R=β to ground
β’ When open:
β’ V read = 0V
πΌ=0
π = 0π
π = ππΊππ· = 0π
Voltage Divider
π
πΌ=
π
β’ Assume:
β’ Voltage reader has
R=β to ground
β’ When closed:
β’ V read = 5V
ππΆπΆ
πΌ=
π
1
π = 5π
π = ππΊππ· = 0π
Generalized Voltage Divider
π
πΌ=
π
β’ Total current:
πΌ=
ππΆπΆ
π
1+π
2
β’ Equal to current
over each resistor
ππΆπΆ
πΌ=
π
1 + π
2
πππ£ππ π
2
π
2
= ππΆπΆ β
π
1 + π
2
πΌ = πΌππ£ππ π
2
β’ Therefore:
β’ πππ£ππ π
2 = πΌππ£ππ π
2 β
π
2
π
2
= ππΆπΆ β
π
1 + π
2
π = ππΊππ· = 0π
Voltage Divider
β’ Uses:
β’ Lots of Arduino inputs
Low-Pass Filter
β’ Charging a capacitor through a resistor
β’ Initially capacitor is empty
β’ πππππ = 0π
β’ As capacitor charges, πππππ rises
Low-Pass Filter
β’ Charging a capacitor through a resistor
β’ RC Law:
βπ‘β
πΆπππ π‘
π π‘ = ππππ₯ β
1 β π
π
π‘
Chart by desmos.com
Low-Pass Filter
β’ Charging a capacitor through a resistor
β’ RC Law
β’ RC Constant depends on
resistor and capacitor
π‘
π
β
πΆ
β
β’ π π‘ = ππππ₯ β
1 β π
β’ Greater resistance and/or
capacitance means slower
charge
Low-Pass Filter
β’ Uses:
β’ Smoothing a signal
Low-Pass Filter
β’ Uses:
β’ Smoothing a signal
β’ Smoothing digital waveform
to (nearly) analog
β’ Smoothing high frequency
analog
β’ Noise filtering
H-Bridge
β’ Recall first tutorial:
β’ Powering a DC motor:
β’ Reversing a motor:
H-Bridge
β’ Control direction
via logic?
β’ Simplified solution:
Switches
H-Bridge
β’ Control direction
via logic
β’ Close diagonal pair
of switches to power
motor
β’ Close other pair to
reverse
H-Bridge
β’ Control direction
via logic
β’ Problem: illegal states
Short circuit!
H-Bridge
β’ Connecting to logic:
Replace switches with
transistors
β’ HIGH (or PWM) to D5
β’ HIGH (or PWM) to D6
for reverse direction
β’ NEVER POWER BOTH!
β’ What is missing?
H-Bridge
β’ Connecting to logic
β’ Diodes,
capacitor,
protection
against
illegal state
H-Bridge
β’ Can be contained
in a chip
β’ L293D
4x Half
H-Bridge
β’ L298
2x Full
H-Bridge
Increasing No. of Outputs
β’ Arduino UNO has 20 I/O pins
β’ TX/RX
β’ 12 digital I/O
β’ 6 digital Out + Analog In
β’ How can this be increased?
Shift Register
β’ Shift register
β’ Recall from
Digital Systems / Logic Design
β’ Convert Serial to parallel
Shift Register
β’ Shift register
β’ Demo:
Write 1100 to a 4-bit
shift register
β’ Strategy:
Write in reverse order
Shift Register
β’ Shift register
β’ Write 0
0
0
?
?
?
Shift Register
β’ Shift register
β’ Write another 0
0
0
0
?
?
Shift Register
β’ Shift register
β’ Write 1
1
1
0
0
?
Shift Register
β’ Shift register
β’ Write another 1
1
1
1
0
0
Shift Register
β’ Problem: look at previous
state
β’ Current output is 100
1
1
0
0
β’ Is it valid?
?
Shift Register
β’ Problem: Intermediate
output states
β’ Solution: second layer of
registers
β’ Requires βLatch outβ control