Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
21Activity
0 of .
Results for:
No results containing your search query
P. 1
PC Based Oscilloscope

PC Based Oscilloscope

Ratings: (0)|Views: 1,988|Likes:
Published by Rev. Matthew

More info:

Published by: Rev. Matthew on Dec 01, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/03/2012

pdf

text

original

 
M.M. VIJAI ANAND
T
his circuit conditions different sig-nals of frequency below 1 kHz anddisplays their waveforms on the PC’sscreen. The hardware is used to conditionthe input waveform and convert it to thedigital format for interfacing to the PC. Thesoftware for acquiring the data into the PCand displaying the same on its screen iswritten in Turbo C.The input waveform (limited to 5Vpeak-to-peak) is first applied to a full-waverectifier comprising op-amps A1 and A2of quad op-amp LM324 (IC4) and a zero-crossing detector built around LM3914 dot/bar display driver (IC8) simultaneously.The full-wave rectifier rectifies the in-put signal such that the negative half cycleof the input signal is available in the posi-tive side itself, so both the half cycles areread as positive when it is given as input tothe ADC. During positive half cycle, diodeD3 is on and diode D4 is off, and op-ampsA1 and A2 act as inverters. Thus the outputis a replica of the input. During the nega-tive half cycle, diode D3 is off and diode D4is on. With R2=R3=R4=R5=R6=R=330ohms, the voltage (V) at output pin 1 of op-amp A1 is related to the input voltage (Vi)as follows:Vi/R +V/(2R)+V/R=0V= -(2/3)ViThe final output voltage (Vo) at pin 7of op-amp A2 is given by the followingrelationship:Vo=(1+R/2R)(-2Vi/3)= -ViAs Vi is negative, the output voltage ispositive.The zero-crossing detector detects
PC-BASED OSCILLOSCOPE
whether the cycle is positive or negative.It is the most critical part of the circuitand if it operates improperly, the symme-try of the analogue signal displayed in thePC monitor gets affected. At the zero-cross-ing instant when the input signal transitsto negative side, the zero-crossing detec-tor informs the PC by taking pin 15 of 25-pin ‘D’ connector of the parallel port high.The input at pin 15 of ‘D’ connector goeslow when the input signal transits to posi-tive side. The zero-crossing detector com-municates with the PC through bit D3 of the status port 379Hex
.
The zero-crossing detector has beenrealised using LM3914 IC. You may adjustVR1 such that the last LED (LED10) goesoff when the input signal transits negativeside of the input waveform. The LM3914itself rectifies the input signal and allows
EFY December 2002
 
only positive half of the cycle.The output from the full-wave rectifieris applied to the input of a sample-and-holdcircuit comprising op-amps A3 and A4 of the LM324 (IC5), capacitor C3, transistorT1 (SL100), and analogue switch IC6(CD4016). This circuit samples the inputsignal, i.e. it divides the waveform into anumber of voltages or points and inputseach voltage level (with a delay) to theADC for conversion into the digital format.Op-amps A3 and A4, along with a switchfrom IC CD4016 and a 1500pF capacitorwith sampling time of 20 µs, are used asvoltage followers/buffers.When the base of transistor T1 is madelow via strobe pin 1 (bit Do of I/O port37A) of 25-pin D connector of the parallelport, the transistor stops conducting andthe voltage at its collector goes high. Thehigh voltage at the collector of transistorT1 closes the switch inside CD4016. As aconsequence, the analogue input signal isapplied to the capacitor, which chargestowards the signal voltage.When the switch is subsequentlyopened by applying a logic-high voltagefrom pin 1 of ‘D’ connector to the base of transistor T1, the capacitor retains the volt-age with a loss of about 20 mV/sec andthis voltage is given to input pin 6 of theADC0804 (IC3) via buffer A4 for conver-sion to the digital format. When the num-ber of sampling points in the input signalwaveform is increased, the reconstructedwaveform becomes more accurate.The ADC0804 is compatible with mi-croprocessors. It is a 20-pin IC that workswith 5V supply. It converts the analogueinput voltage to 8-bit digital output. Thedata bus is tristate buffered. With eightbits, the resolution is 5V/255 = 19.6 mV.The inbuilt clock generatorcircuit produces a frequency of about 640 kHz with R1=10 kilo-ohms and C4=150 pF, which arethe externally connected timingcomponents. The conversiontime obtained is approximately 100 µs. Thefunctions of other pins are given below:Pin 1 (CS): This is active-low chip-select pin.Pin 2 (RD): This active-low pin en-ables the digital output buffers. When high,the 8-bit bus will be in Hi-Z state.Pin 3 (WR): This active-low pin is usedto start the conversion.Pin 9 (Vref/2): This is optional inputpin. It is used only when the input signalrange is small. When pin 9 is at 2V, therange is 0-4V, i.e. twice the voltage at pin 9.Pin 6 (V+), Pin 7(V-): The actual in-put is the difference in voltages applied tothese pins. The analogue input can rangefrom 0 to 5V.In this circuit, pins 1 and 2 are alwaysmade low, so the IC and the buses arealways enabled. Pin 9 is made open, aswe use analogue input with 0-5V range.Pin 7 is grounded.Pin 5 (INTR): This active-low pin indi-cates the end of conversion. It is connectedto pin 17 (bit D3 of I/O port 37A) of ‘D’connector. (Note that this bit is inverted.)The start-of-conversion command viapin 16 of ‘D’ connector is applied to pin 3of the ADC0804. Since we cannot read 8-bit digital data output from ADC throughthe 4-bit status port at a time, we divide itin two 4-bit parts and read. Hence theADC data output is multiplexed throughtwo 4-bit sections of octal buffers of IC1(74244) with the help of output-enable sig-nals from pins 2 and 9 of ‘D’ connector topins 1 and 19 (OE1 and OE2, respectively)of IC1. The digital data output from IC1is interfaced to the PC via pins 13 (S4), 12(S5), 10 (S6), and 11 (S7) of status inputport 379H of ‘D’ connector.The circuit uses 9V and 5V regulatedDC supply voltages as shown in the cir-cuit diagram.A PC printer port is an inexpensiveplatform for implementing low-frequencydata acquisition projects. Each printer portconsists of data, status, and control portaddresses. These addresses are in sequen-tial order; for example, if the data portaddress is 0x0378, the corresponding sta-tus port address is 0x0379 and thecontrol port address is 0x037a. The portaddresses for parallel ports are summarisedbelow:(
 EFY Lab note 
.
For details of the par-allel port pins, refer ‘PC-based Dial Clockwith Timer’ project published in June 2002issue of EFY.)The software, written in C program-ming language, is user-friendly and easy-to-understand. It gets data from the devel-oped hardware circuit and displays it inthe graphical screen with some changes.The C program includes two user-de-fined functions with the main function:graphics( ) and settings( ). The settings( )function is used to adjust the voltage andtime scale. The graphics( ) function is usedto display the waveform on the screen. Thesample control signal is used to close theswitch in the sample-and-hold circuit, sothe capacitor charges towards the analogueinput voltage. After the sampling is over,the switch is opened using the same signal.Then the start-of-conversion control signalis given to start the conversion. The sam-pling time is approximately 20 µs and theconversion time is approximately 100 µs.After the conversion is over, the 8-bitbinary data for the specific voltage sampleis available in the data bus of the ADC.Since the PC accepts only 4-bit data throughthe status port (379H), the 8-bit data mustbe split into two 4-bit data, which areaccepted one after another. This is done byIC 74244, which is controlled by D0 and D7bits of the data port. Then the two 4-bitdata are packed to get the final 8-bit data.The default BGI directory path is set as‘c:\tc\bgi’. The sampling time is decidedby the ‘for’ loop that uses the samp value.The maximum delay produced should begreater than 20 µs, which is the maximumacquisition time of the capacitor. When thesample value is increased, the number of points on the input signal decreases andtherefore the accuracy decreases. The timescale may be calibrated with 50Hz sinewave as reference.
 Note.
Mount a 25-pin D-type femaleconnector on the PCB. Use 25-pin ‘D’ male-to-male connector for connecting PCB tocomputer’s female 25-pin LPT port ‘D’ con-nector. It is a demo PC based oscilloscopeonly and may not be suitable for real timeapplication.
PrinterData portStatus portControl port
LPT10x03780x03790x037aLPT20x02780x02790x027aLPT30x03bc0x03bd0x03be
PARTS LIST
Semiconductors:
IC1-74244IC2-7805IC3-ADC 0804IC4, IC5-LM324IC7-CD4016IC8-LM3914T1-Transistor SL100D1-D4-1N4001 switching diodeL1-L10-Red LED
 Resistors (all ¼-watt, ±5% carbon,unless stated otherwise):
R1-10kilo-ohmR2-R6-330-ohmR7-1Mega-ohmR8-R17-470-ohmR18-1kilo-ohmR19-10kilo-ohm/1wattVR1, VR2-10kilo-ohm Preset
Capacitors:
C1-1000µF, 25V electrolyticC2-0.1µF, ceramicC3-1500PF, ceramicC4-150PF, ceramic
 Miscellaneous:
25 PIN D-Connector Female2 PIN SIP CONNECTORPCB

Activity (21)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Venkat Krishnan liked this
Manish Murkar liked this
Enica Livia liked this
Raj Rao liked this
Arun Sharma liked this
Asuk James Amba liked this
puremind1970 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->