Docsity

Digital Signal Processing: ADC Sound Card Analysis of Voltage and Current Waveforms, Study Guides, Projects, Research of Digital Signal Processing

Partial preview of the text

Download Digital Signal Processing: ADC Sound Card Analysis of Voltage and Current Waveforms and more Study Guides, Projects, Research Digital Signal Processing in PDF only on Docsity!

NED University of Engineering and Technology

Department of Electrical Engineering

Digital Signal Processing EE- 395

Submission of Open-Ended Lab 1 & 2

REPORT

GROUP MEMBERS:

โ— UMAIR BIN INAYAT EE- 22321

โ— DANISH FAKHR-E-MOOSA EE- 22125

โ— MUHAMMAD MOHID SOHAIL EE- 22218

โ— EHTISHAM AHMED EE- 22123

โ— ABDUL WAASAY ALVI EE- 22101

SUBMITTED TO:

MUHAMMAD OMAR

Ned University of Engineering & Technology Department of Electrical Engineering ADC SOUND CARD CURRENT AND VOLTAGE WAVEFORMS Course Name Digital Signal Processing Course Code EE- 395 Section C Batch 2022 Year Third Year Report Covers: This report details the process of converting an analog voltage and current signal into a digital format using an audio cardโ€™s ADC and displaying it in MATLAB. It covers the selection and setup of essential components, including a potential transformer, current transformer, voltage divider resistor (VDR) circuit, audio card, and interfacing equipment. The report describes the transformation of 220V AC mains voltage to a compatible level for the audio card, followed by the design of a VDR circuit using a 20k potentiometer and an additional resistor to achieve the required output voltage safely. It includes calculations to determine the appropriate power ratings, ensuring the circuit operates within a safe range. The report further explains the choice of sampling frequency for accurate signal representation in MATLAB, along with safe operating conditions for all equipment, providing a complete guide from signal transformation to digital visualization.

AC SUPPLY LOAD (LED 13W) VDR Circuit (^) ADC (^) MATLAB

For Current Observation with an 11W (LED):

โžข An 13W inductive light bulb is connected as the load. Using the formula, P = VIcos๐œ‘ the

current through this load is calculated as I = 11/240 = 0.0516 A โžข The output from the current transformer (CT) is connected via an audio jack to the microphone input of a sound card, which is then routed through ADC to the computer. โžข This current value is digitally plotted in MATLAB/Simulink, fulfilling the lab's objective. BLOCK DIAGRAM FOR CURRENT

CALCULATION:

Supply Voltage = ๐‘‰๐‘Ÿ๐‘š๐‘  = 240 ๐‘‰ Input Voltage into ADC = 1 ๐‘‰ ๐‘Ÿ๐‘š๐‘  ADC drops = 0.02 ๐‘‰ ๐‘Ÿ๐‘š๐‘  1) VDR: I have connected potentiometer and a resistor of 56-ohm resistor in series and the output is taken at the resistor. To get the voltage of one volt at the output of the resistor, I have started increasing the potentiometer value. Hence: VR=1 Vrms For Current of CT:(Inductive Load): Bulb of 100 watts was used ๐‘ƒ = ๐ผ ๐‘‰ 100 = ๐ผ โˆ— (240) I=0.4166 A For Current of CT:(Resistive Load): Bulb of 13 watts was used ๐‘ƒ = ๐ผ ๐‘‰Cosโˆ… AC SUPPLY LOAD (100W) Current Transformer ADC (^) MATLAB

I= 0. 0637 A

2) Resolution: Resolution = 16 bits 3) Sampling Frequency: Sampling Frequency= 48000 Hz 4) Gain Factor: For Voltage: As the ADC drops 0.02 V, so the input voltage in rms appeared in MATLAB was 1 ๐‘‰rms ๐บ๐‘Ž๐‘–๐‘› ๐‘“๐‘Ž๐‘๐‘ก๐‘œ๐‘Ÿ = ๐‘‰๐‘œ๐‘ข๐‘ก / ๐‘‰๐‘–๐‘› ๐บ๐‘Ž๐‘–๐‘› ๐น๐‘Ž๐‘๐‘ก๐‘œ๐‘Ÿ = 240/ 0. ๐บ๐‘Ž๐‘–๐‘› ๐น๐‘Ž๐‘๐‘ก๐‘œ๐‘Ÿ = 244. For Current:(For Resistive Load): The current drawn by our load as seen above was 0.4 ๐ด. Since CT transformer read the corresponding current value 10 times scaled down and in terms of voltage. So, the input to our ADC is as appeared on MATLAB was: I rms = 0.04166 As our ADC drops some voltage so the current appeared on MATLAB 0.04 ๐ด in terms of voltage as 0.04A. Hence Gain Factor for current will be: Gain Factor =10 (i.e., CT reads 10A/1V) For Current:(For Inductive Load): The current drawn by our load as seen above was 0.75 ๐ด. Since CT transformer read the corresponding current value 10 times scaled down and in terms of voltage. So, the input to our ADC is as appeared on MATLAB was: Irms= 0. 00637 A As our ADC drops some voltage so the current appeared on MATLAB 0.04 ๐ด in terms of voltage as 0.04A.

if ishandle(h) % Check if plot still exists % Dynamically adjust y-axis range based on signal values y_min = min(x_actual_voltage); % Minimum value of the signal y_max = max(x_actual_voltage); % Maximum value of the signal margin = 0.1 * (y_max - y_min); % Add 10% margin for better visualization ylim([y_min - margin, y_max + margin]); % Adjust y-axis limits % Update plot data set(h, 'XData', time, 'YData', x_actual_voltage); else % If the plot object is deleted, create a new one h = plot(time, x_actual_voltage); xlabel('Time (s)'); ylabel('Voltage (V)'); title('Real-Time Voltage Waveform'); xlim([0, duration]); grid on; end drawnow; % Update the plot immediately end Waveform Picture of Voltage:

PICTURE OF VOLTAGE WAVEFORM SETUP

Code For Current: % Real-Time Current Waveform Display clc; clear; close all; %% Sampling Parameters Fs = 48000; % Sampling frequency (Hz) nBits = 16; % Number of bits per sample (bit depth) scaling_factor = sqrt(2); % Scaling factor for converting RMS to peak nChannels = 1; % Mono recording ts = 1 / Fs; % Time interval between samples sec = 0.2; % Recording duration for each chunk (seconds) % Time vector for plotting (covers one recording duration) t = 0:ts:sec-ts; % Time values from 0 to (sec - ts) %% Continuous Waveform Capture and Plotting disp('Starting real-time current waveform display... Press Ctrl+C to stop.'); while true % Step 1: Create an audiorecorder object recObj = audiorecorder(Fs, nBits, nChannels); % Step 2: Record audio for the specified duration recordblocking(recObj, sec);

Experimental Setup for Current Waveform Setup Current Waveform for Inductive load LED Conclusion: This project successfully showed how AC voltage and current waveforms can be measured and digitized using a step- down transformer and a current transformer. A sound card was used as the ADC (analog-to-digital converter). Voltage and current signals from both linear and non-linear loads were plotted in MATLAB to display their time- domain behavior. Spectral analysis highlighted the main frequency and the harmonic components caused by non- linear loads. The approach demonstrated how digital signal processing techniques can be used for real-time waveform analysis.