Escolar Documentos
Profissional Documentos
Cultura Documentos
VARUN GUPTA
06/EL/1339
KHUSHBOO GUPTA
06/EL/1351
MAY,2010
DECLARATION
We, hereby declare that we carried out the work reported in this report in the Department of
Electronics and Communication Engineering, Maharishi Dayanand University, under the
supervision of Engr. Sonia Batra.
We solemnly declare that to the best of our knowledge, no part of this report has been
submitted here or elsewhere in a previous application for award of a degree. All sources of
knowledge used have been duly acknowledged.
…………………………………….
VARUN GUPTA
06/EL/1339
……………………………………..
KHUSHBOO GUPTA
06/EL/1351
APPROVAL
This is to certify that the project titled ” PC to PC Communication using Laser” carried out
by Varun Gupta and Khushboo Gupta, has been read and approved for meeting part of the
requirements and regulations governing the award of the Bachelor of Engineering
(Electronics and Communication) degree of Maharishi Dayanand University, Sonepat,
Haryana.
......................................................... ………………..
ENGR, SONIA BATRA DATE
(PROJECT SUPERVISOR)
…………………………………….. …………………
ENGR. NAVEEN MALIK DATE
(HEAD OF DEPARTMENT)
…………………………………….. ………………….
DATE
(EXTERNAL EXAMINER)
ACKNOWLEDGEMENT
THE EXECUTIVE SUMMARY
The project uses MAXIM Corporation’s IC MAX 232, which needs only a single power
supply of 5V (for TTL to RS-232 and vice-versa) level conversion. The comm. over the short
distance of 2-3 m is possible using IR diodes. The range could be increased up to hundred
meters, using the laser diode module in place of IR LEDs.
The laser module used is easily available as laser pointer (having about 5 mW power output).
It is to be used with its three battery cells removed and positive supply terminal soldered to
the casing and 0V point to the contact inside the laser module.
Assemble the two prototypes on PCBs and connect them to COM Ports of each PC. Point the
laser beam of one module to fall on the photodiode of the module connected to the other PC
and vice-versa.
Load serial communication software and set the port parameters to 9600 n 8 1 (here, 9600
represents baud rate, n stands for parity none, 8 represents bits per character and 1 indicates
no. of stop bits) to establish the comm. The software program for the purpose is written in C
language. File transferring and chatting is also possible with this ‘C’ coded software.
TABLE OF CONTENTS
LIST OF FIGURES
INTRODUCTION
Free Space Optics (FSO) is a telecommunication technology that uses light propagating in
free space to transmit data between two points.
• Free Space Optics is used to communicate between space-craft, since outside of the
atmosphere there is little to distort the signal.
• The optical links usually use infrared laser light, although low-data-rate
communication over short distances is possible using LEDs.
• Distances up to the order of 10 km are possible, but the distance and data rate of
connection is highly dependent on atmospheric conditions.
Applications:
Advantages:
A laser as a communications medium has some unique properties compared to other forms of
media. A line-of-sight laser beam is useful where wires cannot be physically connected to a
remote location. A laser beam, unlike wires, also does not require special shielding over
longer distances. Lasers offer at least an order of magnitude longer distances compared to
infrared LEDs. Although RF transmitters may offer longer distances than line-of-sight lasers,
they are subject to interference from other transmitters. Since the laser medium is line-of-
sight and the beam being only several millimeters in diameter it is very difficult for the data
stream to be tapped. This offers secure communication since any attempts to intercept the
laser beam would be detected at the receiver as a loss in data.
CHAPTER-2
COMPONENT STUDY
2.1 LASER
(1) Stimulated emission, a natural effect that was deduced by consideration relating to
thermodynamics equilibrium.
(2) Optical feedback (present in most lasers) that is usually provided by mirrors.
Thus, in its simplest form, a laser consists of gain or amplifying medium (where stimulated
emission occurs) and a set of mirrors to feed the light back into the amplifier for continued
growth of the developing beam.
The stimulated emission of light is the crucial quantum process necessary for the operation
of a laser.
2.1..2.1 Coherent:
Figure 6. Coherence
Different parts of the laser beam are related to each other in phase. These phase
relationships are maintained over long enough time so that interference effects may be
seen or recorded photographically. This coherence property is what makes holograms
possible.
2.1.2.2 Monochromatic:
Figure 7. Monochromatic
Laser light consists of essentially one wavelength, having its origin in stimulated emission
from one set of atomic energy levels. So the laser light has a single spectral color and is
almost the purest monochromatic light available.
Collimated:
Figure 8. Collimation
Because of bouncing back between mirrored ends of a laser cavity, those paths which
sustain amplification must pass between the mirrors many times and be very nearly
perpendicular to the mirrors. As a result, laser beams are very narrow and do not spread
very much.
• SERIAL COMMUNICATION
A parallel port sends and receives data eight bits at a time over 8 separate wires. This allows
data to be transferred very quickly; however, the cable required is more bulky because of the
number of individual wires it must contain. Parallel ports are typically used to connect a PC
to a printer and are rarely used for much else. A serial port sends and receives data one bit at
a time over one wire. While it takes eight times as long to transfer each byte of data this way,
only a few wires are required. In fact, two-way (full duplex) communications is possible with
only three separate wires - one to send, one to receive, and a common signal ground wire.
The serial port on the PC is a full-duplex device meaning that it can send and receive data at
the same time. In order to be able to do this, it uses separate lines for transmitting and
receiving data. Some types of serial devices support only one-way communications and
therefore use only two wires in the cable - the transmit line and the signal ground.
Once the start bit has been sent, the transmitter sends the actual data bits. There may either be
5, 6, 7, or 8 data bits, depending on the number we have selected. Both receiver and the
transmitter must agree on the number of data bits, as well as the baud rate. Almost all devices
transmit data using either 7 or 8 data bits.
After the data has been transmitted, a stop bit is sent. A stop bit has a value of 1 - or a mark
state - and it can be detected correctly even if the previous data bit also had a value of 1. This
is accomplished by the stop bit's duration. Stop bits can be 1, 1.5, or 2 bit periods in length.
Besides the synchronization provided by the use of start and stop bits, an additional bit called
a parity bit may optionally be transmitted along with the data. A parity bit affords a small
amount of error checking, to help detect data corruption that might occur during transmission.
We can choose either even parity, odd parity, mark parity, space parity or none at all. When
even or odd parity is being used, the number of marks (logical 1 bits) in each data byte are
counted, and a single bit is transmitted following the data bits to indicate whether the number
of 1 bits just sent is even or odd.
When even parity is chosen, the parity bit is transmitted with a value of 0 if the number of
preceding marks is an even number. For the binary value of 0110 0011 the parity bit would
be 0. If even parity was in effect and the binary number 1101 0110 was sent, then the parity
bit would be 1. Odd parity is just the opposite, and the parity bit is 0 when the number of
mark bits in the preceding word is an odd number.
Parity error checking is very rudimentary. It tells us if there is a single bit error in the
character, it doesn't show which bit was received in error. Also, if even number of bits are in
error then the parity bit would not reflect any error at all.
Mark parity means that the parity bit is always set to the mark signal condition and likewise
space parity always sends the parity bit in the space signal condition. Since these two parity
options serve no useful purpose whatsoever, they are almost never used.
DTE stands for Data Terminal Equipment, and DCE stands for Data Communications
Equipment. These terms are used to indicate the pin-out for the connectors on a device and
the direction of the signals on the pins. Our computer is a DTE device, while most other
devices are usually DCE devices.
The RS-232 standard states that DTE devices use a 25-pin male connector, and DCE devices
use a 25-pin female connector. We can therefore connect a DTE device to a DCE using a
straight pin-for-pin connection.
However, to connect two like devices, we must instead use a null modem cable. Null modem
cables cross the transmit and receive lines in the cable.
The listing below shows the connections and signal directions for both 25 and 9-pin
connectors.
The TD (transmit data) wire is the one through which data from a DTE device is transmitted
to a DCE device. This name can be deceiving, because this wire is used by a DCE device to
receive its data. The TD line is kept in a mark condition by the DTE device when it is idle.
The RD (receive data) wire is the one on which data is received by a DTE device, and the
DCE device keeps this line in a mark condition when idle.
RTS stands for Request To Send. This line and the CTS(Clear To Send) line are used when
"hardware flow control" is enabled in both the DTE and DCE devices. The DTE device puts
this line in a mark condition to tell the remote device that it is ready and able to receive data.
If the DTE device is not able to receive data (typically because its receive buffer is almost
full), it will put this line in the space condition as a signal to the DCE to stop sending data.
When the DTE device is ready to receive more data (i.e. after data has been removed from its
receive buffer), it will place this line back in the mark condition. The complement of the RTS
wire is CTS, which stands for Clear To Send. The DCE device puts this line in a mark
condition to tell the DTE device that it is ready to receive the data. Likewise, if the DCE
device is unable to receive data, it will place this line in the space condition. Together, these
two lines make up what is called RTS/CTS or "hardware" flow control.
The Software Wedge supports this type of flow control, as well as Xon/XOff or "software"
flow control. Software flow control uses special control characters transmitted from one
device to another to tell the other device to stop or start sending data. With software flow
control the RTS and CTS lines are not used.
DTR stands for Data Terminal Ready. Its intended function is very similar to the RTS line.
DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. Some
serial devices use DTR and DSR as signals to simply confirm that a device is connected and
is turned on. The Software Wedge sets DTR to the mark state when the serial port is opened
and leaves it in that state until the port is closed. The DTR and DSR lines were originally
designed to provide an alternate method of hardware handshaking. It would be pointless to
use both RTS/CTS and DTR/DSR for flow control signals at the same time. Because of this,
DTR and DSR are rarely used for flow control.
CD stands for Carrier Detect. Carrier Detect is used by a modem to signal that it has a made
a connection with another modem, or has detected a carrier tone. The last remaining line is
RI or Ring Indicator. A modem toggles the state of this line when an incoming call rings
your phone.
The Carrier Detect (CD) and the Ring Indicator (RI) lines are only available in connections to
a modem. Because most modems transmit status information to a PC when either a carrier
signal is detected (i.e. when a connection is made to another modem) or when the line is
ringing, these two lines are rarely used.
9 to 25 Pin Adapters
The following table shows the connections inside a standard 9 pin to 25 pin adapter.
The baud unit is named after Jean Maurice Emile Baudot, who was an officer in the French
Telegraph Service. He is credited with devising the first uniform-length 5-bit code for
characters of the alphabet in the late 19th century.
Baud refers to the modulation rate or the number of times per second that a line changes state.
This is not always the same as bits per second (BPS). If we connect two serial devices
together using direct cables then baud and BPS are in fact the same. Thus, if we are running
at 19200 BPS, then the line is also changing states 19200 times per second.
Because modems transfer signals over a telephone line, the baud rate is actually limited to a
maximum of 2400 baud. This is a physical restriction of the lines provided by the phone
company. The increased data throughput achieved with 9600 or higher baud modems is
accomplished by using sophisticated phase modulation, and data compression techniques.
MAX232
Applicability
This module is primary of interest for people building their own electronics with an RS-232
interface. Off-the-shelf computers with RS-232 interfaces already contain the necessary
electronics, and there is no need to add the circuitry as described here.
[edit]Introduction
Serial RS-232 (V.24) communication works with voltages (between -15V ... -3V are used to
transmit a binary '1' and +3V ... +15V to transmit a binary '0') which are not compatible with
today's computer logic voltages. On the other hand, classic TTL computer logic operates
between 0V ... +5V (roughly 0V ... +0.8V referred to as low for binary '0', +2V ... +5V
for high binary '1' ). Modern low-power logic operates in the range of 0V ... +3.3V or even
lower.
So, the maximum RS-232 signal levels are far too high for today's computer logic electronics,
and the negative RS-232 voltage can't be grokked at all by the computer logic. Therefore, to
receive serial data from an RS-232 interface the voltage has to be reduced, and
the 0 and 1 voltage levels inverted. In the other direction (sending data from some logic over
RS-232) the low logic voltage has to be "bumped up", and a negative voltage has to be
generated, too.
The MAX232 from Maxim was the first IC which in one package contains the necessary
drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic.
It became popular, because it just needs one voltage (+5V) and generates the necessary RS-
232 voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of
circuitry. Circuitry designers no longer need to design and build a power supply with three
voltages (e.g. -12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with
the help of a simple 78x05 voltage converter.
The MAX232 has a successor, the MAX232A. The ICs are almost identical, however, the
MAX232A is much more often used (and easier to get) than the original MAX232, and the
MAX232A only needs external capacitors 1/10th the capacity of what the original MAX232
needs.
It should be noted that the MAX232(A) is just a driver/receiver. It does not generate the
necessary RS-232 sequence of marks and spaces with the right timing, it does not decode the
RS-232 signal, it does not provide a serial/parallel conversion. All it does is to convert
signal voltage levels. Generating serial data with the right timing and decoding serial data
has to be done by additional circuitry, e.g. by a 16550 UART or one of these small micro
controllers (e.g. Atmel AVR, Microchip PIC) getting more and more popular.
The MAX232 and MAX232A were once rather expensive ICs, but today they are cheap. It
has also helped that many companies now produce clones (ie. Sipex). These clones
sometimes need different external circuitry, e.g. the capacities of the external capacitors vary.
It is recommended to check the data sheet of the particular manufacturer of an IC instead of
relying on Maxim's original data sheet.
The original manufacturer (and now some clone manufacturers, too) offers a large series of
similar ICs, with different numbers of receivers and drivers, voltages, built-in or external
capacitors, etc. E.g. The MAX232 and MAX232A need external capacitors for the internal
voltage pump, while the MAX233 has these capacitors built-in. The MAX233 is also
between three and ten times more expensive in electronic shops than the MAX232A because
of its internal capacitors. It is also more difficult to get the MAX233 than the garden variety
MAX232A.
+---v---+
C1+ -|1 16|- Vcc
V+ -|2 15|- GND
C1- -|3 14|- T1out
C2+ -|4 13|- R1in
C2- -|5 12|- R1out
V- -|6 11|- T1in
T2out -|7 10|- T2in
R2in -|8 9|- R2out
+-------+
+10V, capacitor
output of voltage
2 V+ should stand at least 1µF to VCC 100nF to VCC
pump
16V
-10V, capacitor
output of voltage
6 V- should stand at least 1µF to GND 100nF to GND
pump / inverter
16V
V+(2) is also connected to VCC via a capacitor (C3). V-(6) is connected to GND via a
capacitor (C4). And GND(16) and VCC(15) are also connected by a capacitor (C5), as close
as possible to the pins.
PHOTODIODE
Photodiodes are similar to regular semiconductor diodes except that they may be either
exposed (to detect vacuum UV or X-rays) or packaged with a window or optical
fiberconnection to allow light to reach the sensitive part of the device. Many diodes designed
for use specifically as a photodiode will also use a PIN junction rather than the typical PN
junction.
Principle of operation
responsivity
The ratio of generated photocurrent to incident light power, typically expressed
in A/Wwhen used in photoconductive mode. The responsivity may also be expressed
as aquantum efficiency, or the ratio of the number of photogenerated carriers to
incident photons and thus a unitless quantity.
dark current
The current through the photodiode in the absence of light, when it is operated in
photoconductive mode. The dark current includes photocurrent generated by
background radiation and the saturation current of the semiconductor junction. Dark
current must be accounted for by calibration if a photodiode is used to make an
accurate optical power measurement, and it is also a source of noise when a
photodiode is used in an optical communication system.
noise-equivalent power
(NEP) The minimum input optical power to generate photocurrent, equal to the rms
noise current in a 1 hertz bandwidth. The related characteristic detectivity (D) is the
inverse of NEP, 1/NEP; and the specific detectivity ( ) is the detectivity normalized
They also enjoy use in applications as diverse as replacements for traditional light sources
inautomotive lighting (particularly indicators) and in traffic signals. Airbus has used LED
lighting in their A320 Enhanced since 2007, and Boeing plans its use in the 787. The
compact size of LEDs has allowed new text and video displays and sensors to be developed,
while their high switching rates are useful in advanced communications technology
Technology
Parts of an LED
Like a normal diode, the LED consists of a chip of semiconducting material doped with
impurities to create a p-n junction. As in other diodes, current flows easily from the p-side,
or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—
electrons and holes—flow into the junction from electrodes with different voltages. When an
electron meets a hole, it falls into a lower energy level, and releasesenergy in the form of
a photon.
The wavelength of the light emitted, and therefore its color, depends on the band gapenergy
of the materials forming the p-n junction. In silicon or germanium diodes, the electrons and
holes recombine by a non-radiative transition which produces no optical emission, because
these are indirect band gap materials. The materials used for the LED have a direct band
gap with energies corresponding to near-infrared, visible or near-ultraviolet light.
LED development began with infrared and red devices made with gallium arsenide.
Advances in materials science have made possible the production of devices with ever-
shorter wavelengths, producing light in a variety of colors.
LEDs are usually built on an n-type substrate, with an electrode attached to the p-type layer
deposited on its surface. P-type substrates, while less common, occur as well. Many
commercial LEDs, especially GaN/InGaN, also use sapphire substrate.
Most materials used for LED production have very high refractive indices. This means that
much light will be reflected back into the material at the material/air surface interface.
Therefore Light extraction in LEDs is an important aspect of LED production, subject to
much research and development.
Capacitor The capacitor plays a crucial role in electronics -- it stores electrons for when
they're needed most. Capacitors consist of two conducting plates placed near each other.
Inside the capacitor, the terminals connect to two metal plates separated by a dielectric. The
dielectric can be air, paper, plastic or anything else that does not conduct electricity and keeps
the plates from touching each other.
The DMM is an instrument that is able to measure voltage, current, and resistance in a circuit,
or across circuit components and displays its measurements on a digital display.
3.5 Battery(9 VOLT): If you look at any battery, you'll notice that it has two terminals.
One terminal is marked (+), or positive, while the other is marked (-), or negative. In an
normal flashlight batteries, the ends of the battery are the terminals. In a large car battery,
there are two heavy lead posts that act as the terminals.
Electrons collect on the negative terminal of the battery. If you connect a wire between the
negative and positive terminals, the electrons will flow from the negative to the positive
terminal as fast as they can (and wear out the battery very quickly -- this also tends to be
dangerous, especially with large batteries, so it is not something you want to be doing).
Normally, you connect some type of load to the battery using the wire.
Fig 3.6 : 9V Battery
Electrons flow from the battery into a wire, and must travel from the negative to the positive
terminal for the chemical reaction to take place. That is why a battery can sit on a shelf for a
year and still have plenty of power unless electrons are flowing from the negative to the
positive terminal, the chemical reaction does not take place. Once you connect a wire, the
reaction starts.
For this project we have removed the laser assembly from a small laser pointer. The power
supply circuit is the green board attached to the brass laser head. We carry similar laser
pointers in our catalog that are easily disassembled for this project. The power supply circuit
came conveniently marked with a plus and a minus next to two holes in the board. We solder
the black negative lead from the battery clip to the hole marked minus. We solder one of the
coil leads to the hole marked plus. We solder the red positive lead of the battery clip to the
other lead from the coil.
TRANSISTOR(SK 100)
CHAPTER-3
PROJECT DESCRIPTION
3.1 HARDWARE
Figure 3. Circuit Diagram of Receiver and Transmitter Section of PC to PC
Communication using LASER
There are two sections in our project. One is the transmitter section and the other being the
receiver section.
• TRANSMITTER SECTION:
Data signals transmitted through Pin 3 of ‘9’ pin ‘D’ connector of RS-232 COM port are sent
to Pin 8 of MAX232 IC and it converts these EIA (Electronics Industry Association) RS-
232C compatible levels of +/- 9V to 0/5V TTL levels. The output pin line of MAX232 IC
drives the PNP transistor SK100 and powers the IR LED. The output Pin 9 also drives an
LED indicator during the positive output at its Pin 9. At logic’0’ output at Pin 9, LED2 goes
‘off’, but drives the PNP transistor through a bias resistor of 1 kilo-ohm, to switch ‘on’
IRLED1 and IRLED2 and also a visible LED3. Since very low drive current is used, use of
high- efficiency visible LEDs, which light up at 1mA, are needed. The electrical pulses sent
by the COM port are now converted into corresponding modulated pulses of IR light.
• RECEIVER SECTION:
The IR signals are detected by a photodiode (D1). The detected TTL level (0/5 V) signals are
coupled to pin 10 of MAX232 IC. These TTL levels are converted to +/- 9V levels internally
and output at Pin 7.
A visible LED1 at Pin 7 of MAX232 IC indicates that the signals are being received. Pin 7 is
also connected to Pin 2 of ‘9’ pin ‘D’ connector used for serial port in the PC, so that the data
may be read. The optical signals received by the photodiodes are converted to electrical
pulses and both PC think that there is a null modem cable connected between them. In some
PCs, the serial port is terminated into ‘9’ Pin ‘D’ connector and in some others into a ‘25’ pin
‘D’ connector.
3.2 SOFTWARE
#include<stdio.h>
#include<dos.h>
#include<conio.h>
#include<graphics.h>
#include<stdlib.h>
#define DEL 25
#define COM 0x03f8
char gra= 'Y';
int flag = 0;
union REGS inregs,outregs;
FILE *fp;
int status;
char temp='\n',t2;
int t1=10;
void main(void)
{
char ch,chr,chs;
clrscr();
if(flag==0)
flag++;
textcolor(4);gotoxy(26,6);
cprintf("INFRARED/LASER COMMUNICATION");
gotoxy(34,9); textcolor(10);
cprintf("R"); textcolor(7); cprintf("receive mode");
textcolor(14); gotoxy(35,12);
cprintf("S"); textcolor(7); cprintf("end mode");
textcolor(6); gotoxy(37,15);
cprintf("E"); textcolor(7); cprintf("exit");
ch= getch();
switch(toupper(ch))
{
case 'R': R:clrscr();
textcolor(4);gotoxy(26,6);
cprintf("INFRARED/LASER COMMUNICATION");
textcolor(138); gotoxy(33,9);
cprintf("RECEIVE MODE");
textcolor(9); gotoxy(33,12);
cprintf("A"); textcolor(7);cprintf("align device");
textcolor(11); gotoxy(33,15);
cprintf("F");textcolor(7); cprintf("file receive");
textcolor(6); gotoxy(36,18);
cprintf("Q"); textcolor(7); cprintf("quit");
chr= getch();
switch(toupper(chr))
{
case'A': ralgn();
break;
case'F': f_rcv();
break;
case'Q': main();
default: clrscr();
printf("wrong key pressed");
goto R;
}
break;
case'S': S:clrscr();
textcolor(4);gotoxy(26,6);
cprintf("INFRARED/LASER COMMUNICATION");
textcolor(142); gotoxy(36,9);
cprintf("SEND MODE");
textcolor(9);gotoxy(34,12);
cprintf("A");textcolor(7);cprintf("align device");
textcolor(11);gotoxy(34,15);
cprintf("T");textcolor(7);cprintf("transfer file");
textcolor(6);gotoxy(38,18);
cprintf("Q");textcolor(7);cprintf("quit");
chs=getch();
switch(toupper(chs))
{
case'A': salgn();
break;
case'T': f_snd();
break;
case'Q': main();
default: clrscr();
printf("wrong key pressed");
goto S;
}
break;
case'E': clrscr();
textcolor(143);gotoxy(35,13);
cprintf("GOOD BYE");
exit(1);
default: clrscr();
printf("wrong key pressed");
main();
return;
}
}
ralgn(void)
{
char st= '';
clrscr();
gotoxy(30,2);
textcolor(10);
cprintf("RECEIVE MODE");
textcolor(9);cprintf("ALIGN DEVICE");
printf("\n");
initial();
loop: if(!kbhit())
{
if(st==0x04)
{
clrscr();
textcolor(140);
gotoxy(30,12);
cprintf("ALIGNED PROPERLY");
gotoxy(48,24;
printf("press any key to quit");
getch();
main();
}
status= inp(0x3fd);
if((status & 0x01)==0x00)
goto loop;
else if(!kbhit())
{
st= inp(COM);
printf("%c",st);
goto loop;
}
else
main();
}
return;
}
f_rcv()
{
int flag=0,bytecount=0,count;
float ot=0.00, nt=0.00;
char ch,st[55000],fnm[30];
clrscr();
initial();
ot=clock()/18.2;
gotoxy(2,2);
printf("FILE NAME? :");
fp=fopen(gets(fnm),"wb");
gotoxy(26,10);
printf("(ready for)RECEIVING DATA");
gotoxy(50,24);
textcolor(138);
cprintf("don't key in may loss data");
loop: nt=clock()/18.2;
status=inp(0x3fd);
if((status & 0x01)==0x00)
{
if((bytecount>0)&&(nt-ot)>5.0)
{
clrscr();
for(count=0;count<flag;count++)
{
gotoxy(26,10);
textcolor(11);
cprintf("saving data in");
gotoxy(43,10);
textcolor(12);
cprintf("%s",fnm);
}
fclose(fp);
gotoxy(26,13);
textcolor(11);
cprintf("file %s of %d bytes created",fnm,count);
gotoxy(50,24);
textcolor(7);
cprintf("press any key to quit");
getch();
main();
}
goto loop;
}
else if(!kbhit())
{
st[flag]=inp(COM);
flag++;
bytecount++;
ot= clock()/18.2;
goto loop;
}
else
{
clrscr();
for(count=0;count<flag;count++)
{
gotoxy(26,3);
textcolor(140);
cprintf("TERMINATED ABNORMALLY");
gotoxy(26,10);
textcolor(11);
cprintf("SAVING DATA IN");
textcolor(12);
cprintf("%s",fnm);
fprintf(fp,"%c",st[count]);
}
fclose(fp);
gtoxy(26,13);
textcolor(11);
cprintf("File %s of %d bytes created",fnm,count);
sleep(5);
main();
}
return;
}
salgn(void)
{
int flag=0;
char st[127];
clrscr();
initial();
textcolor(14);
cprintf("type the sentence(<127 chars)");
puts("\n");
gets(st);
loop: status=inp(0x3fd);
if((status & 0x20)==0x00)
goto loop;
else
do
{
if(!kbhit())
{
outport(COM,0x0d);
outport(COM,0x0a);
if(flag==strlen(st))
{
printf("\n");
flag=0;
outport(COM,0X0d);
outport(COM,0x0a);
delay(5);
}
else
{
outport(COM,st[flag]);
printf("%c",st[flag]);
flag++;
delay(DEL);
}
}
if(kbhit())
{
delay(1);
outport(COM,0x04);
main();
}
}
while(!kbhit());
}
f_snd()
{
int flag=0, count=0, fl;
char ch,st[55000],fnm[20];
clrscr();
initial();
gotoxy(2,2);
printf("FILE NAME?:");
fp=fopen(gets(fnm),"rb");
if(fp==NULL)
{
clrscr();
gotoxy(35,13);
printf("FILE NOT FOUND");
delay(1000);
main();
}
else
{
fl=filelength(5);
gotoxy(23,20);
printf("File being transferred has %u bytes",fl);
do
{
ch=fgetc(fp);
st[count]=ch;
count++;
}
while(count<=fl);
}
fclose(fp);
loop: status=inp(0x3fd);
if((status & 0x20)==0x00)
goto loop;
else
do
{
if(flag==fl)
{
gotoxy(50,24);
pintf("press any key to quit");
getch();
main();
}
else
{
outport(COM,st[flag]);
printf("\t %004x",st[flag]);
flag++;
delay(DEL);
}
}
while(!kbhit());
}
initial()
{
inregs.h.ah=0;
inregs.h.al=0x63;
inregs.x.dx=0;
int86(0x14,&inregs,&outregs);
}
A printed circuit board, or PCB, is used to mechanically support and electrically connect
electronic components using conductive pathways, or traces, etched from copper sheets
laminated onto a non-conductive substrate. It is also referred to as printed wiring board
(PWB) or etched wiring board. A PCB populated with electronic components is a printed
circuit assembly (PCA), also known as a printed circuit board assembly (PCBA).
PCBs are rugged, inexpensive, and can be highly reliable. They require much more layout
effort and higher initial cost than either wire-wrapped or point-to-point constructed circuits,
but are much cheaper and faster for high-volume production.
Method Used
Under the print and etching technique two methods are used:
Due to certain difficulties the screen-printing method is not used and the printing is done
manually.
1. Printing
2. Painting
3. Scrapping
4. Etching
5. Washing
6. Drilling
7. Masking
Printing:
First of all the circuit is traced out on the blank PCB plate using a carbon
paper carefully avoiding crossing of lines.
Painting:
Paint is now applied carefully on the various numbers in the circuit and plate
kept aside for drying.
Scrapping:
After allowing the plate to dry, the lines are checked for continuity. In the case
of intersection, if any, the unwanted paint is removed with the help of a
scrapper.
Etching:
Now the plate is immersed into the solution of ferric chloride for about two
hours. During this time period the copper from the unwanted is etched away by
the ferric chloride solution leaving behind the copper under the painted area.
Washing:
The plate is taken out and washes thoroughly and cleans the plate of ferric
solution. It is now allowed to dry for some time. After drying the reaming paint
is removed using a thinner.
Drilling:
The position of all the holes required in the PCB is marked carefully .A proper
drill bit is selected and holed drilled in the PCB.The PCB now is ready for
masking.
:
Masking
Now coasting of protective chemicals are masking the PCB moisture proof and
electrically insulated. The PCB is now ready for component mounting.
SOLDERING
Soldering is a process in which two or more metal items are joined together by melting and
flowing a filler metal into the joint, the filler metal having a relatively low melting point. Soft
soldering is characterized by the melting point of the filler metal, which is below 400 °C
(752 °F). The filler metal used in the process is called solder.
CHAPTER-5TESTING
Breadboard is used to make up temporary circuits for testing. No soldering is required hence
it is easy to change connections and for replacement of components. Here, parts will not be
damaged and thus can be used afterwards.
Begin by carefully insertion of IC MAX232 in the centre with its notch to the left. Then deal
with each pin of IC.
Breadboard output:
The output voltage at pin 2 and pin 6 of MAX232 IC was checked first which came out to be
+/- 9V.
• Assemble two transceiver modules and connect each of them. Using 3-core cables, to
Com-1 ports of the two PC’s. Place them 15 to 20 cm apart so that the IR LEDs of
each module face the photodiode detector of the other.
• Power ‘on’ both the circuits to operate at stabilized 5V DC. You may alternatively use
a 7805 regulator IC with a 9V DC source to obtain regulated %v supply.
• Check if the MAX232 IC is working properly by testing pin 2 for 9 to 10V positive
supply and pin 6 for -9V supply. MAX232 uses 1µF, 25V capacitors C1 – C5 as a
charge pump to internally generate +/-9V from 5V supply. Generally, defective
MAX232 ICs will not show a voltage generation of +9V and -9V at pins 2 & 6
respectively. Replace ICs, if required. Although1uF, 25V capacitors are
recommended in the datasheet, the circuit works well even with 10uF, 25V capacitors,
which are easily available.
• With both the PCs and supply to the transceiver modules ‘on’, throw some light with
the torch on photodiode. LED1 should flicker at the burst frequency rate of the
transmitter. This proves that the IR signals are being detected by photodiodes and
converted into RS232-compatible levels by MAX232 and output at pin 7 of MAX232
ICs is available for the PC to read the pulses.
• To test the transmitter side, disconnect the module from COM-1 (or COM-2) port of
the PC, and with the device powered ‘on’, use a short jumper wire from +5V and
touch it at pin 8 of MAX232 IC to simulate a positive pulse. LED2 should turn ‘off’
and IRLEDs and LED3 should turn ‘on’ if the wiring is correct. IRLEDs would also
be glowing. Remove the link wire from +5V to pin 8 of MAX232 IC and connect
back the “D” connector to PC’s COM-1 (or COM-2) port.
• Run simple communication software like PROCOM or TELIX. Set the baud rate,
parity, bits per character, and stop bits to 9600, n, 8, 1 respectively, and send a few
characters from the keyboard through COM-1 port. You should be able to see LED3
flickering for a few seconds indicating data transmission.
• Connect both PCs to the circuits and set the software to chat more. You should be
able to transfer the data between the PCs as if a cable was connected.
CHAPTER-6 PRECAUTIONS
CHAPTER-8 CONCLUSION
REFERENCES
APPENDIX-A
SK100
OP505a
Max232cpe