Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
PC Based Oscilloscope

PC Based Oscilloscope

Ratings: (0)|Views: 1,988|Likes:

Availability:

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

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