Skip to content

Commit

Permalink
docs: 📝 enhance readability of KaTeX (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNZL committed Aug 19, 2022
1 parent ac5ca65 commit 5035367
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 71 deletions.
76 changes: 38 additions & 38 deletions presentations/AnalogL1/presentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@

- A source that produces a nearly sinusoidal AC voltage is provided to you
- The voltage generated by this source can be expressed in time-domain as
\\[ v\_{L(t)} = V\_{L(pk)}sin \left( \omega\_{L} t \right) \quad \text{where} \quad \omega\_{L} = 2 \pi f\_{L} = 1000 \pi \quad \because \ f\_{L} = 500Hz \\]
\\[ v\_{\text{L}}(t) = V\_{\text{L(pk)}}\sin \left( \omega\_{\text{L}} t \right) \quad \text{where} \quad \omega\_{\text{L}} = 2 \pi f\_{\text{L}} = 1000 \pi \quad \because \ f\_{\text{L}} = 500\,\text{Hz} \\]
- RMS of this voltage, V<sub>L</sub>, can be set to between 13.6V<sub>RMS</sub> and 15.4V<sub>RMS</sub> via a software application
- This AC source needs to be powered by providing 30V<sub>DC</sub> from a bench-top DC power source
- It employs a switched-mode converter to synthesize an AC output voltage from a DC input voltage
Expand All @@ -301,7 +301,7 @@

- A load that consists of a fixed inductor, L<sub>L</sub>, in series with a variable resistor, R<sub>L</sub>, is provided to you
- The impedance of this load can be expressed in the phasor-domain as
\\[ Z\_{L} = R\_{L} + j \omega\_{L} L\_{L} \quad \text{where} \quad \omega\_{L} = 2 \pi f\_{L} = 1000 \pi \quad \because \ f\_{L} = 500Hz \\]
\\[ Z\_{\text{L}} = R\_{\text{L}} + j \omega\_{\text{L}} L\_{\text{L}} \quad \text{where} \quad \omega\_{\text{L}} = 2 \pi f\_{\text{L}} = 1000 \pi \quad \because \ f\_{\text{L}} = 500\,\text{Hz} \\]
- The inductor has a fixed inductance of 4mH &plusmn; 20%
- The resistance of the variable resistor can be set between 5&ohm; and 105&ohm; using the knob
- Helps control complex power of the load to between specified 2.5VA and 7.5VA
Expand Down Expand Up @@ -431,7 +431,7 @@
- Voltage is a measure of the charge imbalance that provides the force to move the electrons through a circuit branch
- Resistance of a circuit branch is a measure of how hard it is for the electrons to flow through that branch
- Ohm's law relates voltage, current and resistance of a resistor
\\[ V\_{DC} = I\_{DC}R \quad \text{OR} \quad v\_{(t)} = i\_{(t)}R \\]
\\[ V\_{\text{DC}} = I\_{\text{DC}}R \quad \text{or} \quad v(t) = i(t)R \\]
]

.right-column[
Expand Down Expand Up @@ -507,27 +507,27 @@
<tbody>
<tr>
<th class="tg-wp8o">R</td>
<td class="tg-wp8o">\(V_{DC} = I_{DC}R\)</td>
<td class="tg-wp8o">\(v_{(t)} = i_{(t)}R \)</td>
<td class="tg-wp8o">\(V_\text{DC} = I_\text{DC}R\)</td>
<td class="tg-wp8o">\(v(t) = i(t)R \)</td>
<td class="tg-wp8o">\(\bar{V} = \bar{I}R\)</td>
<td class="tg-wp8o">\(v_{(t)} = i_{(t)}R \)</td>
<td class="tg-wp8o">\(V_{(s)} = I_{(s)}R \)</td>
<td class="tg-wp8o">\(v(t) = i(t)R \)</td>
<td class="tg-wp8o">\(V(s) = I(s)R \)</td>
</tr>
<tr>
<th class="tg-wp8o">L</td>
<td class="tg-wp81">Short Cct.</td>
<td class="tg-wp8o">\(v_{(t)} = L \frac{\mathrm{d} i_{(t)}}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(v(t) = L \frac{\mathrm{d} i(t)}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(\bar{V} = j X_L \bar{I} = j\omega L \bar{I}\)</td>
<td class="tg-wp8o">\(v_{(t)} = L \frac{\mathrm{d} i_{(t)}}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(V_{(s)} = s L I_{(s)}\)</td>
<td class="tg-wp8o">\(v(t) = L \frac{\mathrm{d} i(t)}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(V(s) = s L I(s)\)</td>
</tr>
<tr>
<th class="tg-wp8o">C</td>
<td class="tg-wp81">Open Cct.</td>
<td class="tg-wp8o">\(i_{(t)} = C \frac{\mathrm{d} v_{(t)}}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(\bar{V} = j X_C \bar{I} = \bar{I}/j\omega C \)</td>
<td class="tg-wp8o">\(i_{(t)} = C \frac{\mathrm{d} v_{(t)}}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(V_{(s)} = {I_{(s)}} / {sC} \)</td>
<td class="tg-wp8o">\(i(t) = C \frac{\mathrm{d} v(t)}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(\bar{V} = j X_C \bar{I} = \frac{\bar{I}}{j\omega C} \)</td>
<td class="tg-wp8o">\(i(t) = C \frac{\mathrm{d} v(t)}{\mathrm{d} t} \)</td>
<td class="tg-wp8o">\(V(s) = \frac {I(s)} {sC} \)</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -556,10 +556,10 @@

- Solve the simultaneous equations from KVL and KCL by substituting for V & I relationships from 1st step
- As an example for circuit here there are 3 unknown Is and Vs, and the 3 equations to solve are
- At node KCL<sub>1</sub>: `\( \quad I_{in} - I_{1} - I_{2} = 0 \)`
- From loop KVL<sub>1</sub>: `\( \quad V_{in} - V_{1} - V_{3} = 0 \quad \Rightarrow \quad V_{in} = I_{1}R_{1} + (I_{1} + I_{2})R_{3} \)`
- At node KCL<sub>1</sub>: `\( \quad I_\text{in} - I_{1} - I_{2} = 0 \)`
- From loop KVL<sub>1</sub>: `\( \quad V_\text{in} - V_{1} - V_{3} = 0 \quad \Rightarrow \quad V_\text{in} = I_{1}R_{1} + (I_{1} + I_{2})R_{3} \)`
- From loop KVL<sub>2</sub>: `\( \quad V_{1} - V_{2} = 0 \quad \Rightarrow \quad I_{1}R_{1} = I_{2}R_{2} \)`
- Solving the 2 KVL equations and substituting circuit parameters we get `\( I_{1} = I_{2} = 0.5A \ \ \text{&} \ \ I_{in} = 1A \)`
- Solving the 2 KVL equations and substituting circuit parameters we get `\( I_{1} = I_{2} = 0.5\,\text{A} \ \, \text{\&} \ \, I_{\text{in}} = 1\,\text{A} \)`
- Could have used a circuit transformation to combine R<sub>1</sub> & R<sub>2</sub> in parallel and simplified the analysis

---
Expand Down Expand Up @@ -601,7 +601,7 @@
- These circuit elements include resistors (dissipate energy), batteries (store energy), LEDs (convert energy), etc.
- In AC circuits, inductive and capacitive circuit elements result in reactive power since they absorb energy from electrons during part of the time period and release this energy during the remainder of the period
- To understand and define real, reactive and apparent power we use **instantaneous power** given by
\\[ p\_{(t)} = v\_{(t)} i\_{(t)} \\]
\\[ p(t) = v(t) \cdot i(t) \\]
- Note, AC circuits may not always use sinusoidal sources, and they can be of any wave shape

---
Expand All @@ -613,11 +613,11 @@
- Real power by **definition is the average of p<sub>(t)</sub> over a time period, T<sub>L</sub>**
- Consider the resistive load in ['Example 1'](#S17), which only consumes real power
- From our analysis we know that
\\[ v\_{L(t)} = V\_{L(pk)} \ cos (1000 \pi t) \quad \text{and} \quad i\_{L(t)} = V\_{L(pk)} \ cos (1000 \pi t) / R\\]
\\[ v\_{\text{L}}(t) = V\_{\text{L(pk)}} \cos (1000 \pi t) \quad \text{and} \quad i\_{\text{L}}(t) = \dfrac{V\_{\text{L(pk)}} \cos (1000 \pi t)}{R}\\]
- Instantaneous power in the resistive load in ['Example 1'](#S17) is therefore
\\[ p\_{L(t)} = \frac {V^2\_{L(pk)}} {R} \ cos ^2 (1000 \pi t) = \frac {V^2\_{L(pk)}} {2R} \left[ \ cos (2000 \pi t) + 1 \right] \\]
\\[ p\_{\text{L}}(t) = \frac {V^2\_{\text{L(pk)}}} {R} \cos ^2 (1000 \pi t) = \frac {V^2\_{\text{L(pk)}}} {2R} \left[ \cos (2000 \pi t) + 1 \right] \\]
- Real power delivered to the resistive load in ['Example 1'](#S17) is therefore
\\[ P = \frac{1} {T\_L} \int\_{0}^{T\_L} p\_{L(t)}\,dt \ = \frac{1} {T\_L} \int\_{0}^{T\_L} v\_{(t)} i\_{(t)} \,dt \ = V^2\_{L(pk)}/2R \\]
\\[ P = \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} p\_{\text{L}}(t)\,dt \ = \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} v(t)\cdot i(t) \,dt \ = \frac{V^2\_{\text{L(pk)}}}{2R} \\]
]

.right-column-s[
Expand All @@ -631,11 +631,11 @@

- RMS value of an AC voltage or a current is defined to provide a measure of (real) power dissipated in a resistive load in an AC circuit
- Using the definition of real power and Ohm's law, power dissipated in a resistive load is given by
\\[ P = \frac{1} {T\_L} \int\_{0}^{T\_L} p\_{L(t)}\,dt \ = \frac{1} {T\_L} \int\_{0}^{T\_L} v\_{(t)} i\_{(t)} \,dt \ = \frac {1} {RT\_L} \int\_{0}^{T\_L} v^2\_{(t)} \,dt \ \overset{\underset{\mathrm{OR}}{}}{=} \ \frac{R} {T\_L} \int\_{0}^{T\_L} i^2\_{(t)} \,dt\\\]
\\[ P = \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} p\_{\text{L}}(t)\,dt \ = \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} v(t)\cdot i(t) \,dt \ = \frac {1} {RT\_\text{L}} \int\_{0}^{T\_\text{L}} v^2(t) \,dt \ \overset{\underset{\mathrm{OR}}{}}{=} \ \frac{R} {T\_\text{L}} \int\_{0}^{T\_\text{L}} i^2(t) \,dt\\]
- From this, we could develop the definition of RMS value of an AC voltage or a current as
\\[ V^2\_{RMS} = \frac{1} {T\_L} \int\_{0}^{T\_L} v^2\_{(t)} \,dt \quad \text{and} \quad I^2\_{RMS} = \frac{1} {T\_L} \int\_{0}^{T\_L} i^2\_{(t)} \,dt \\]
\\[ V^2\_{\text{RMS}} = \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} v^2(t) \,dt \quad \text{and} \quad I^2\_{\text{RMS}} = \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} i^2(t) \,dt \\]
- As an example, RMS value of a **sinusoidal** AC voltage (and similarly a current) is give by
\\[ V\_{RMS} = \sqrt{ \frac{1} {T\_L} \int\_{0}^{T\_L} V^2\_{L(pk)} \ cos ^2 (\omega\_{L} t) \,dt } = \sqrt{ \frac{1} {T\_L} \int\_{0}^{T\_L} \frac {V^2\_{L(pk)}} {2} \ \left[ cos(2\omega\_{L} t) + 1 \right] \,dt } = \frac {V\_{L(pk)}} {\sqrt{2}}\\]
\\[ V\_{\text{RMS}} = \sqrt{ \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} V^2\_{\text{L(pk)}} \cos ^2 (\omega\_{\text{L}} t) \,dt } = \sqrt{ \frac{1} {T\_\text{L}} \int\_{0}^{T\_\text{L}} \frac {V^2\_{\text{L(pk)}}} {2} \ \left[ \cos(2\omega\_{\text{L}} t) + 1 \right] \,dt } = \frac {V\_{\text{L(pk)}}} {\sqrt{2}}\\]

---
name: S21
Expand All @@ -655,10 +655,10 @@

- Apparent power is a measure of the voltage and current required to drive an AC circuit
- The definition of apparent power is therefore simply
\\[ \left| S \right| = V\_{RMS}I\_{RMS} \\]
\\[ \left| S \right| = V\_\text{RMS}\cdot I\_\text{RMS} \\]
- Apparent power required to drive an AC circuits that has inductors and/or capacitors is greater than real power consumed by this circuit
- The ratio between the real power and apparent power is defined as the power factor of an AC circuit
\\[ p.f. = \frac {P} {\left| S \right|} \\]
\\[ \mathit{p.f.} = \frac {P} {\left| S \right|} \\]
- It is important for an electrical circuit to have a power factor of 1 (or close to 1)
- Higher power factors minimizes the voltage and current that is required to drive an AC circuit

Expand All @@ -685,11 +685,11 @@
.left-column-s[
- Consider the inductive load in ['Example 1'](#S17), which only results in reactive power (i.e., the average of p<sub>(t)</sub> over a time period, T<sub>p</sub> should be zero)
- From our analysis we know that
\\[ v\_{L(t)} = V\_{L(pk)} \ cos (1000 \pi t) \quad \text{and} \quad i\_{L(t)} = V\_{L(pk)} \ cos (1000 \pi t - \pi/2) / \omega\_{L} L\\]
\\[ v\_{\text{L}}(t) = V\_{\text{L(pk)}} \cos (1000 \pi t) \quad \text{and} \quad i\_{\text{L}}(t) = \frac{V\_{\text{L(pk)}} \cos (1000 \pi t - \frac{\pi}{2})} {\omega\_{\text{L}} L}\\]
- Instantaneous power in the inductive load in ['Example 1'](#S17) is therefore
\\[ p\_{L(t)} = \frac {V^2\_{L(pk)}} {\omega\_{L} L} \ cos (1000 \pi t) \ cos (1000 \pi t - \pi/2) = \frac {V^2\_{L(pk)}} {2\omega\_{L} L} \ sin (2000 \pi t) \\]
\\[ p\_{\text{L}}(t) = \frac {V^2\_\text{L(pk)}} {\omega\_{\text{L}} L} \cos (1000 \pi t) \cos \left(1000 \pi t - \tfrac{\pi}{2}\right) = \frac {V^2\_\text{L(pk)}} {2\omega\_{\text{L}} L} \sin (2000 \pi t) \\]
- Real and reactive power delivered to the inductive load in ['Example 1'](#S17) are
\\[ P = \frac{1} {T\_L}\int\_{0}^{T\_L} p\_{L(t)}\,dt \ = 0 \quad \text{and} \quad Q = \frac {V^2\_{L(pk)}} {2\omega\_{L} L} = \frac {V^2\_{L(RMS)}} {\omega\_{L} L} \\]
\\[ P = \frac{1} {T\_\text{L}}\int\_{0}^{T\_\text{L}} p\_{\text{L}}(t)\,dt \ = 0 \quad \text{and} \quad Q = \frac {V^2\_\text{L(pk)}} {2\omega\_{\text{L}} L} = \frac {V^2\_\text{L(RMS)}} {\omega\_{\text{L}} L} \\]
]

.right-column-s[
Expand All @@ -703,10 +703,10 @@

- As engineers we tend to use simplified expressions to calculate electrical quantities
- In previous courses you may have learnt that RMS of a voltage or a current is related to its peak as
\\[ V\_{pk} = \sqrt{2} V\_{RMS} \quad \text{and} \quad I\_{pk} = \sqrt{2} I\_{RMS} \\]
\\[ V\_\text{pk} = \sqrt{2} V\_\text{RMS} \quad \text{and} \quad I\_\text{pk} = \sqrt{2} I\_\text{RMS} \\]
- These RMS relationships **only hold valid for perfect sinusoidal** voltages and currents
- Similarly, you may have learnt that power is a function of RMS voltage and/or current as
\\[ P = V\_{RMS} I\_{RMS} = I^2\_{RMS}R = V^2\_{RMS}/R \\]
\\[ P = V\_\text{RMS} I\_\text{RMS} = I^2\_\text{RMS}R = \frac{V^2\_\text{RMS}}{R} \\]
- These power relationships **only hold valid for ideal resistors**
- In practice, **perfect sinusoidal** sources do not exists and there are components other than resistors that consume real power (e.g., LEDs)
- In these situations, fundamental relationships we derived help us determine P, S, Q and RMSs
Expand Down Expand Up @@ -751,7 +751,7 @@
- The functionality of the voltage sensor circuitry is to step-down the voltage to be measured to a safer level that can be passed through the signal conditioning circuitry to the microcontroller
- The most common approach is to use a voltage divider to implement the voltage sensor
- The voltage divider is designed to step-down the voltage to be measured to the required level
\\[ v\_{vs(t)} = v\_{L(t)} \ R\_b/(R\_a + R\_b) \\]
\\[ v\_\text{vs}(t) = v\_{\text{L}}(t) \ \frac{R\_\text{b}}{R\_\text{a} + R\_\text{b}} \\]
<div style="line-height:50%;">
<br>
</div>
Expand Down Expand Up @@ -779,9 +779,9 @@
- In the labs you will be guided to determine a more suitable peak-peak amplitude
- We need to consider the highest v<sub>L</sub> to be measured measured (i.e., 15.4V) to ensure V<sub>vs(pk-pk)</sub> &le; 1V
- Using this information we can derive the relation
\\[ V\_{vs(pk-pk)} = V\_{L(pk-pk)} \ R\_b/(R\_a + R\_b) \quad \Rightarrow \quad 1 \geq 15.4\times 2\sqrt{2} \ R\_b/(R\_a + R\_b) \quad \Rightarrow \quad R\_a \geq 41.4 R\_b\\]
\\[ V\_\text{vs(pk-pk)} = V\_\text{L(pk-pk)} \ \frac{R\_\text{b}}{R\_\text{a} + R\_\text{b}} \quad \Rightarrow \quad 1 \geq 15.4\times 2\sqrt{2} \ \frac{R\_\text{b}}{R\_\text{a} + R\_\text{b}} \quad \Rightarrow \quad R\_\text{a} \geq 41.4 R\_\text{b}\\]
- The power dissipated as loss in R<sub>a</sub> & R<sub>b</sub> can be expressed as
\\[ P\_{vs-loss} = V^2\_{L(RMS)}/(R\_a + R\_b) \\]
\\[ P\_\text{vs-loss} = \frac{V^2\_\text{L(RMS)}}{R\_\text{a} + R\_\text{b}} \\]
- To determine appropriates values for R<sub>a</sub> & R<sub>b</sub> we need to minimize P<sub>vs-loss</sub> while making sure sufficiently large signal-to-noise ratio (SNR) and low sensitivity to the environment
- For UG work, avoid using resistance values greater than 500k&ohm; to minimize sensitivity

Expand Down Expand Up @@ -821,7 +821,7 @@
- The most common approach is to insert a small a current sense resistor in the path of current flow
- Current sense resistor should be sufficiently small so it does not impact the load current
- The voltage across the current sense resistor is proportional to the current through it since
\\[ v\_{is(t)} = i\_{L(t)} R\_s \\]
\\[ v\_{\text{is}}(t) = i\_{\text{L}}(t)\cdot R\_\text{s} \\]
- Alternatively, [hall-effect sensors](https://www.allegromicro.com/en/insights-and-innovations/technical-documents/hall-effect-sensor-ic-publications/non-intrusive-hall-effect-current-sensing-techniques-for-power-electronics) (AC or DC) or [current transformers](https://www.electronics-tutorials.ws/transformer/current-transformer.html) (AC only) can be used

<div style="line-height:50%;">
Expand Down Expand Up @@ -851,10 +851,10 @@
- We need to consider the highest i<sub>L</sub> to be measured measured to ensure P<sub>is-loss</sub> &le; 50mW
- Highest I<sub>L(RMS)</sub> is at lowest V<sub>L(RMS)</sub> and highest VA specified (i.e., I<sub>L(RMS)</sub> = 7.5VA/13.6V = 0.55A<sub>RMS</sub>)
- Using this information we can derive the relation
\\[ P\_{is-loss} = I^2\_{L(RMS)} R\_s \quad \Rightarrow \quad 0.05 \geq 0.55^2 R\_s \quad \Rightarrow \quad R\_s \leq 165 m\Omega \\]
\\[ P\_\text{is-loss} = I^2\_\text{L(RMS)}\cdot R\_\text{s} \quad \Rightarrow \quad 0.05 \geq 0.55^2 R\_\text{s} \quad \Rightarrow \quad R\_\text{s} \leq 165\, \text{m}\Omega \\]
- If R<sub>s</sub> is choosen as 160m&Omega;, V<sub>is</sub> measured at both highest and lowest i<sub>L</sub> are
\\[ V\_{is(pk-pk)-highest} = 0.55\times 2\sqrt{2}\times 0.16 \approx 250mV \\]
\\[ V\_{is(pk-pk)-lowest} = 0.16\times 2\sqrt{2}\times 0.16 \approx 72mV\\]
\\[ V\_\text{is(pk-pk)-highest} = 0.55\times 2\sqrt{2}\times 0.16 \approx 250\, \text{mV} \\]
\\[ V\_\text{is(pk-pk)-lowest} = 0.16\times 2\sqrt{2}\times 0.16 \approx 72\, \text{mV}\\]
- To determine an appropriate value for R<sub>s</sub> we need to minimize P<sub>vs-loss</sub>, size and cost while making sure sufficiently large signal-to-noise ratio (SNR)

---
Expand Down
4 changes: 2 additions & 2 deletions presentations/AnalogL6/presentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
# Resistors

- The DC resistance of a conductor made using a material with a resistivity, &rho;, has a cross-sectional area, A, and a length, l, is given by,
\\[ R\_{dc} = \frac{\rho l}{A} \\]
\\[ R\_\text{dc} = \frac{\rho\cdot l}{A} \\]
- A resistor is thus made using a conductor that has specific length and a cross-sectional area, which gives the required resistance
- The conductor is typically arranged as a helix to reduce the size of the resistor
- As a practical resistor uses a certain length of wire,typically in a helix arrangement, it not only has resistance but also has some inductance
Expand Down Expand Up @@ -401,7 +401,7 @@
# Capacitors

- The capacitance of a capacitor made using two conducting plates, where each plate has an area, A, separated by, d, and uses insulation material between the plates with a permittivity, &epsilon;<sub>r</sub>&epsilon;<sub>0</sub>, is given by,
\\[ C = \frac{\epsilon\_r \epsilon\_0 A}{d} \\]
\\[ C = \frac{\epsilon\_\text{r} \epsilon\_0 A}{d} \\]
- A capacitor is thus made using conducting plates that has specific area and a separation, which gives the required capacitance
- The plates typically arranged like a multilayer "wrap" to reduce the size of the capacitor
- A practical capacitor not only has capacitance but also has some inductance and resistance
Expand Down
2 changes: 1 addition & 1 deletion presentations/DigitalL1/presentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@
# Example: Reading Input & Driving LED (PI)

.questions[
Develop a program to read the input from a push-button and control an LED. As shown by the Proteus schematic below, one end of the push-button is connected PB7 on ATmega328P while the other end is connected to the ground. The pull-up resistor, `\( R_1 \)`, ensures the voltage at PB7 is pulled to 5V (i.e. VCC supplied to the MCU) when the push-button is released. The filter capacitor, `\( C_1 \)`, is used for debouncing. When the push-button is pressed it creates 0V at PB7, when released PB7 will be 5V. LED is connected to PB5 through a current limiting resistor, `\( R_2 \)`. Generating 5V at PB5 will create a current to flow turning-on the LED (i.e. `\( I_{LED} = \left ( 5 - V_{f} \right ) / R_2 \)` where `\( V_f \approx 2V\)` for a yellow LED). Setting PB5 to 0V will turn-off the LED.
Develop a program to read the input from a push-button and control an LED. As shown by the Proteus schematic below, one end of the push-button is connected PB7 on ATmega328P while the other end is connected to the ground. The pull-up resistor, `\( R_1 \)`, ensures the voltage at PB7 is pulled to 5V (i.e. VCC supplied to the MCU) when the push-button is released. The filter capacitor, `\( C_1 \)`, is used for debouncing. When the push-button is pressed it creates 0V at PB7, when released PB7 will be 5V. LED is connected to PB5 through a current limiting resistor, `\( R_2 \)`. Generating 5V at PB5 will create a current to flow turning-on the LED (i.e. `\( I_\text{LED} = \left ( 5 - V_\text{f} \right ) / R_2 \)` where `\( V_\text{f} \approx 2\, \text{V}\)` for a yellow LED). Setting PB5 to 0V will turn-off the LED.
]

.center[
Expand Down
2 changes: 1 addition & 1 deletion presentations/DigitalL2/presentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@

- The UBRR0 value defines the prescaler applied to used to the system clock (f<sub>osc</sub>) to obtain the UART clock (i.e. UART clock = (f<sub>osc</sub> / (UBRR0 + 1))
- Under normal operation the UART clock needs to be 16 times the baud rate and therefore
\\[ \text{Baud Rate} = \frac{f\_{osc}} {16 \times \left( UBRR0 + 1 \right) } \quad \text {or} \quad UBRR0 = \frac {f\_{osc}} {\left( \text {Baud Rate} \right) \times 16} - 1\\]
\\[ \text{Baud Rate} = \frac{f\_\text{osc}} {16 \times \left( \mathtt{UBRR0} + 1 \right) } \quad \text {or} \quad \mathtt{UBRR0} = \frac {f\_\text{osc}} {\left( \text {Baud Rate} \right) \times 16} - 1\\]

---
name: S29
Expand Down
Loading

0 comments on commit 5035367

Please sign in to comment.