Presentation is loading. Please wait.

Presentation is loading. Please wait.

A lecture for Arduino Course, Winter 2017/18

Similar presentations


Presentation on theme: "A lecture for Arduino Course, Winter 2017/18"β€” Presentation transcript:

1 A lecture for Arduino Course, Winter 2017/18
A few useful circuits Boris van Sosin, Commissar-Engineer A lecture for Arduino Course, Winter 2017/18 Technion, IIT

2 Voltage Divider 𝐼= 𝑉 𝑅 Ohm’s Law: 𝐼= 𝑉 𝑅 πΆπ‘’π‘Ÿπ‘Ÿπ‘’π‘›π‘‘= π‘‰π‘œπ‘™π‘‘π‘Žπ‘”π‘’ π‘…π‘’π‘ π‘–π‘ π‘‘π‘Žπ‘›π‘π‘’

3 Voltage Divider Assume: When open: Voltage reader has R=∞ to ground
𝐼= 𝑉 𝑅 Assume: Voltage reader has R=∞ to ground When open: V read = 0V 𝑉=0𝑉 𝐼=0 𝑉= 𝑉 𝐺𝑁𝐷 =0𝑉

4 Voltage Divider Assume: When closed: Voltage reader has R=∞ to ground
𝐼= 𝑉 𝑅 Assume: Voltage reader has R=∞ to ground When closed: V read = 5V 𝑉=5𝑉 𝐼= 𝑉𝐢𝐢 𝑅1 𝑉= 𝑉 𝐺𝑁𝐷 =0𝑉

5 Generalized Voltage Divider
𝐼= 𝑉 𝑅 Total current: 𝐼= 𝑉𝐢𝐢 𝑅1+𝑅2 Equal to current over each resistor 𝐼= 𝐼 π‘‚π‘£π‘’π‘Ÿ 𝑅2 Therefore: 𝑉 π‘‚π‘£π‘’π‘Ÿ 𝑅2 = 𝐼 π‘‚π‘£π‘’π‘Ÿ 𝑅2 β‹… 𝑅 2 =𝑉𝐢𝐢⋅ 𝑅 2 𝑅 1 + 𝑅 2 𝐼= 𝑉𝐢𝐢 𝑅1+𝑅2 𝑉= 𝑉 𝐺𝑁𝐷 =0𝑉 𝑉 π‘‚π‘£π‘’π‘Ÿ 𝑅2 =𝑉𝐢𝐢⋅ 𝑅 2 𝑅 1 + 𝑅 2

6 Voltage Divider Uses: Lots of Arduino inputs

7 Low-Pass Filter Charging a capacitor through a resistor
Initially capacitor is empty 𝑉 π‘Ÿπ‘’π‘Žπ‘‘ =0𝑉 As capacitor charges, 𝑉 π‘Ÿπ‘’π‘Žπ‘‘ rises

8 Low-Pass Filter Charging a capacitor through a resistor
RC Law: 𝑉 𝑑 = 𝑉 π‘šπ‘Žπ‘₯ β‹… 1βˆ’ 𝑒 βˆ’π‘‘β‹…πΆπ‘œπ‘›π‘ π‘‘ 𝑉 𝑑 Chart by desmos.com

9 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

10 Low-Pass Filter Uses: Smoothing a signal

11 Low-Pass Filter Uses: Smoothing a signal
Smoothing digital waveform to (nearly) analog Smoothing high frequency analog Noise filtering

12 H-Bridge Recall first tutorial: Powering a DC motor:
Reversing a motor:

13 H-Bridge Control direction via logic? Simplified solution: Switches

14 H-Bridge Control direction via logic
Close diagonal pair of switches to power motor Close other pair to reverse

15 H-Bridge Control direction via logic Problem: illegal states
Short circuit!

16 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?

17 H-Bridge Connecting to logic
Diodes, capacitor, protection against illegal state

18 H-Bridge Can be contained in a chip L293D 4x Half H-Bridge
L298 2x Full H-Bridge

19 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?

20 Shift Register Shift register
Recall from Digital Systems / Logic Design Convert Serial to parallel

21 Shift Register Shift register
Demo: Write 1100 to a 4-bit shift register Strategy: Write in reverse order

22 Shift Register Shift register Write 0 ? ? ?

23 Shift Register Shift register Write another 0 ? ?

24 Shift Register 1 1 Shift register Write 1 ?

25 Shift Register 1 1 Shift register Write another 1 1

26 Shift Register Problem: look at previous state Current output is 100
Is it valid? ?

27 Shift Register Problem: Intermediate output states
Solution: second layer of registers Requires β€œLatch out” control


Download ppt "A lecture for Arduino Course, Winter 2017/18"

Similar presentations


Ads by Google