Course: Instrumentation Engineering (Spring 2026 / 1405)
Instructor: Dr. Nayeri
Student: Amirali Dehghani (ID: 810102443)
Tools: MATLAB & Simulink R2026a, Proteus 8 Professional, LaTeX
Files Included: Simulink Model (.slx), Proteus Projects (.pdsprj), Circuit Diagrams & Simulation Plots (img/), and Solved Report (
Homework 2 focuses on essential analog signal conditioning circuits, dynamic system filtering, digital-to-analog conversion, and precision instrumentation amplifiers:
- Industrial Signal Filtering (Simulink): Design and frequency response analysis of Passive RC High-Pass, Low-Pass, cascaded Band-Pass, and LC Notch (Band-Stop) filters for 50 Hz power-line noise elimination.
- Temperature Sensing & Threshold ADC (Proteus): Hardware implementation of an NTC Thermistor signal conditioning circuit connected to an Op-Amp multi-threshold comparator network (LM324) driving LED indicators.
- 4-Bit R-2R Digital-to-Analog Converter (Proteus): Inverting R-2R DAC design, theoretical voltage calculations, binary counter integration for Sawtooth and Full Triangular wave synthesis, and Low-Pass RC filter smoothing.
-
Bio-Potential & Industrial Instrumentation Amplifiers:
- Design of a 4-stage ECG Signal Conditioning Circuit (
$\pm 500,\mu\text{V}$ input to$0-5\text{ V}$ ADC range with active bandpass filtering). - Mathematical derivation and simulation of a 3 Op-Amp Instrumentation Amplifier proving Common-Mode Rejection Ratio (CMRR) under 50 Hz noise.
- Strain Gauge Wheatstone Bridge integration with AD620 instrumentation amplifier and 8-bit ADC digital output calculation.
- Design of a 4-stage ECG Signal Conditioning Circuit (
HW2/
├── Codes/
│ ├── q1.slx # Simulink model for Band-Pass & Notch filter simulation
│ └── Q1.mat # Workspace data & filter coefficients
├── Proteus/
│ ├── q2.pdsprj # NTC Thermistor & multi-threshold ADC comparator circuit
│ ├── q3.pdsprj # 4-Bit R-2R DAC theoretical validation circuit
│ ├── q3-1.pdsprj # DAC step voltage test circuit
│ ├── q3-2.pdsprj # Sawtooth wave generator (74HC161 Counter + R-2R DAC)
│ ├── q3-3.pdsprj # Smooth continuous sawtooth wave (RC Low-Pass Filtered)
│ ├── q4-1.pdsprj # 4-Stage ECG Bio-Probe conditioning circuit
│ ├── q4-2.pdsprj # 3 Op-Amp Instrumentation Amplifier simulation
│ └── q4-3.pdsprj # Common-mode noise rejection (CMRR) test circuit
├── img/
│ ├── q1-1.png # Simulink BPF Bode plot & frequency response
│ ├── q1-2.png # Simulink -3dB cut-off points verification
│ ├── q2-1.png - q2-4.png # Proteus NTC temperature threshold LED outputs (15°C to 80°C)
│ ├── q3-1.png - q3-5.png # Proteus 4-bit R-2R DAC, Sawtooth & Triangular wave plots
│ └── q4-1.png - q4-5.png # Proteus Instrumentation Amp, CMRR test & AD620 pressure system
├── Inst_HW2.pdf # Original Assignment Question Paper
└── Instr-HW2-810102443.pdf # Complete Solved Lab Report (PDF)
A vibration sensor on industrial machinery produces useful information between
-
High-Pass RC Filter (
$f_{cL} = 20\text{ Hz}$ ,$C_1 = 10,\mu\text{F}$ ):$$f_c = \frac{1}{2\pi R_1 C_1} \implies R_1 = \frac{1}{2\pi (20)(10 \times 10^{-6})} = \frac{10^6}{400\pi} \approx \mathbf{795.77,\Omega}$$ -
Low-Pass RC Filter (
$f_{cH} = 200\text{ Hz}$ ,$C_2 = 470\text{ nF}$ ):$$f_c = \frac{1}{2\pi R_2 C_2} \implies R_2 = \frac{1}{2\pi (200)(470 \times 10^{-9})} = \frac{10^6}{188\pi} \approx \mathbf{1693.14,\Omega}$$ -
Cascaded Band-Pass Filter (BPF) Parameters:
- Filter Type: Passive Band-Pass Filter
-
Approximate Center Frequency:
$$f_{\text{center}} = \sqrt{f_L \cdot f_H} = \sqrt{20 \times 200} = \sqrt{4000} \approx \mathbf{63.25\text{ Hz}}$$ -
Bandwidth:
$$\text{BW} = f_H - f_L = 200 - 20 = \mathbf{180\text{ Hz}}$$ -
Quality Factor (
$Q$ ):$$Q = \frac{f_{\text{center}}}{\text{BW}} = \frac{63.25}{180} \approx \mathbf{0.351}$$
-
Simulink Frequency Response (Bode Plot):
- The
$-3\text{ dB}$ cut-off frequencies occur precisely at$f_L = 20\text{ Hz}$ and$f_H = 200\text{ Hz}$ , confirming the design specifications.
- The
| Figure 1.1: Simulink BPF Bode Plot & Phase Response | Figure 1.2: -3dB Cut-off Points Verification |
|---|---|
![]() |
![]() |
-
LC Notch Filter Design for 50 Hz Noise Elimination (
$L = 100\text{ mH}$ ):$$f_0 = \frac{1}{2\pi \sqrt{L C}} \implies C = \frac{1}{4\pi^2 f_0^2 L} = \frac{1}{4\pi^2 (50)^2 (0.1)} = \frac{1}{1000\pi^2} \approx \mathbf{101.32,\mu\text{F}}$$ -
Performance Improvements:
-
Active Twin-T Notch Filters: Replaces passive LC elements with Op-Amps to eliminate inductor internal resistance losses and drastically increase the
$Q$ -factor (sharper attenuation at$50\text{ Hz}$ without distorting adjacent frequencies like$48\text{ Hz}$ or$52\text{ Hz}$ ). -
Low-Tolerance Components: Using
$1%$ precision resistors/capacitors to prevent notch frequency shift due to thermal drift.
-
Active Twin-T Notch Filters: Replaces passive LC elements with Op-Amps to eliminate inductor internal resistance losses and drastically increase the
-
Performance Improvements:
An NTC thermistor is connected in a voltage divider powered by a
Given
-
Digital Input
1011($D = 11$ ):$$V_{\text{out}} = -0.6 \times 11 = \mathbf{-6.60\text{ V}}$$ -
Digital Input
1110($D = 14$ ):$$V_{\text{out}} = -0.6 \times 14 = \mathbf{-8.40\text{ V}}$$ - Both theoretical calculations match Proteus DC voltmeter measurements with 100% accuracy.
Figure 3.1: Digital Input 1011 ( |
Figure 3.2: Digital Input 1110 ( |
|---|---|
![]() |
![]() |
- A 4-bit synchronous binary counter (74HC161) increments sequentially from
0000($0$ ) to1111($15$ ). - Connected to the inverting R-2R DAC, it outputs a discrete negative-sloped staircase waveform dropping from
$0\text{ V}$ to$-9.0\text{ V}$ before resetting on counter overflow.
| Figure 3.3: Discrete Stepped Sawtooth Waveform (74HC161 Counter + R-2R DAC) |
|---|
![]() |
- Discrete DAC steps contain high-frequency harmonics due to sharp voltage jumps between states.
- Passing the Op-Amp output through a passive Low-Pass RC filter (
$R = 1\text{ k}\Omega$ ,$C = 1,\mu\text{F}$ ) removes high-frequency step harmonics, producing a smooth, continuous linear sawtooth wave.
| Figure 3.4: Smooth Continuous Analog Sawtooth Waveform (Filtered via Low-Pass RC) |
|---|
![]() |
- Architecture: Replaces the single-direction counter with a 74HC191 4-bit Up/Down Counter coupled to a JK Flip-Flop.
-
Working Principle:
- Counter counts UP from
0000to1111(generating negative slope to$-9.0\text{ V}$ ). - Upon reaching Terminal Count (
TC),TCtriggers the JK Flip-Flop to toggle the Count Direction pin (D/U). - Counter counts DOWN from
1111to0000(generating positive slope back to$0\text{ V}$ ).
- Counter counts UP from
- Result: After RC low-pass filtering, the circuit produces a full, symmetric, smooth continuous triangular wave.
| Figure 3.5: Full Continuous Triangular Wave Generator (74HC191 U/D Counter + JKFF + Filter) |
|---|
![]() |
-
Input:
$V_{\text{in}} = \pm 500,\mu\text{V} \implies \Delta V_{\text{in}} = 1\text{ mV}_{p-p}$ . -
Target ADC:
$0 - 5\text{ V} \implies \Delta V_{\text{out}} = 5\text{ V}_{p-p}$ . -
Total Required Gain:
$$A_v = \frac{\Delta V_{\text{out}}}{\Delta V_{\text{in}}} = \frac{5\text{ V}}{1\text{ mV}} = \mathbf{5000}$$ -
DC Offset Shift:
$V_r = 2.5\text{ V}$ to center symmetrical inputs within$0-5\text{ V}$ range ($V_{\text{out}} = 5000 \cdot V_{\text{in}} + 2.5\text{ V}$ ).
[Input Probe] ---> [Stage 1: Direct Gain (A1=100)] ---> [Stage 2: Diff Gain (A2=50)]
---> [Stage 3: Active Bandpass (10-100Hz)] ---> [Stage 4: Summing Amp (Vr=2.5V)] ---> [ADC (0-5V)]
-
Resistor Sizing:
-
Stage 1 (Direct Stage):
$A_1 = 1 + \frac{2 R_1}{R_g} = 100 \implies R_g = 1\text{ k}\Omega, R_1 = 49.5\text{ k}\Omega$ . -
Stage 2 (Differential Stage):
$A_2 = \frac{R_3}{R_2} = 50 \implies R_2 = 1\text{ k}\Omega, R_3 = 50\text{ k}\Omega$ . -
Stage 3 (Active BPF
$10-100\text{ Hz}$ ):- High-pass (
$10\text{ Hz}$ ):$C_L = 1,\mu\text{F} \implies R_L \approx 15.9\text{ k}\Omega$ . - Low-pass (
$100\text{ Hz}$ ):$C_H = 100\text{ nF} \implies R_H \approx 15.9\text{ k}\Omega$ .
- High-pass (
-
Stage 4 (Summer): Equal resistors
$R = 1\text{ k}\Omega$ .
-
Stage 1 (Direct Stage):
| Figure 4.1: Complete 4-Stage ECG Signal Conditioning Schematic |
|---|
![]() |
For a symmetrical 3 Op-Amp topology (
Setting differential gain
- Select
$R_1 = R_2 = R_3 = R_4 = 10\text{ k}\Omega$ (Stage 2 Gain$= 1$ ). - Stage 1 condition:
$1 + \frac{2 R_b}{R_a} = 3 \implies \mathbf{R_a = R_b = R_c = 10\text{ k}\Omega}$ .
-
Clean Signal Test: Input differential voltage
$\Delta V = 50\text{ mV} - 100\text{ mV} = -50\text{ mV}$ . Output voltage$V_{\text{out}} = 3 \times (-50\text{ mV}) = \mathbf{-150\text{ mV}}$ (180° phase shifted 1 kHz sine wave). -
50 Hz Common-Mode Noise Injection: Injecting a large
$50\text{ Hz}, 200\text{ mV}$ noise source in series with both inputs distorts inputs up to$300\text{ mV}$ . -
Simulation Result: The output
$V_{\text{out}}$ remains a completely clean$150\text{ mV}$ 1 kHz sine wave with zero 50 Hz hum, demonstrating superior CMRR.
| Figure 4.2: Instrumentation Amp Clean Signal Test | Figure 4.3: 50Hz Common-Mode Noise Rejection (CMRR) |
|---|---|
![]() |
![]() |
-
Role of Wheatstone Bridge: Converts minute strain gauge resistance variations (
$\Delta R$ ) into measurable differential voltage while cancelling power supply drift and ambient temperature noise. -
AD620 Gain Resistor Calculation (
$G = 100$ ):$$R_g = \frac{49.9\text{ k}\Omega}{G - 1} = \frac{49.9\text{ k}\Omega}{100 - 1} = \frac{49.9}{99} \approx \mathbf{504,\Omega}$$ -
Balanced State (
$R_1 = 3.0\text{ k}\Omega$ ): Bridge in balance$\implies V_{\text{out}} = V_{\text{ref}} = \mathbf{2.00\text{ V}}$ . -
Pressure Applied State (
$R_1 = 3.3\text{ k}\Omega$ ): Unbalanced bridge saturates single-supply AD620 to positive rail limit$\implies V_{\text{out}} = \mathbf{3.84\text{ V}}$ . -
8-Bit Digital ADC Output (
$V_{\text{ref,ADC}} = 5\text{ V}$ ):$$D_{\text{out}} = \text{round}\left( \frac{3.84}{5} \times (2^8 - 1) \right) = \text{round}(0.768 \times 255) = \text{round}(195.84) = \mathbf{196}$$ $$\text{Binary Representation} = \mathbf{11000100_2}$$
| Figure 4.4: AD620 Pressure System (Equilibrium |
Figure 4.5: AD620 Pressure Applied ( |
|---|---|
![]() |
![]() |
cd HW2/Codes
open_system('q1.slx');
sim('q1.slx');- Open Proteus 8 Professional.
- Load any target
.pdsprjfile fromHW2/Proteus/:q2.pdsprj: NTC Thermistor ADC Comparatorsq3-2.pdsprj/q3-5.pdsprj: Sawtooth & Triangular Wave Generatorsq4-1.pdsprj/q4-3.pdsprj: ECG Conditioning & Instrumentation Amp CMRR
- Press Play (Execute Simulation) to observe virtual oscilloscopes and voltmeters.















