0% found this document useful (0 votes)
49 views5 pages

PC-based Scrolling Message Display

The document describes a PC-based scrolling message display using a parallel port to control a 5x7 LED dot-matrix display. It details the components required, circuit design, and software implementation in C for displaying messages, including how to modify the displayed text and control the speed of scrolling. The system allows for a flexible number of characters to be displayed and can be easily expanded with additional components.

Uploaded by

FoFi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views5 pages

PC-based Scrolling Message Display

The document describes a PC-based scrolling message display using a parallel port to control a 5x7 LED dot-matrix display. It details the components required, circuit design, and software implementation in C for displaying messages, including how to modify the displayed text and control the speed of scrolling. The system allows for a flexible number of characters to be displayed and can be easily expanded with additional components.

Uploaded by

FoFi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PC-based Scrolling

Message Display
 SURESH KUMAR Parts List lel port are connected to the input pins
of the first flip-flop (IC2). The output

C
Semiconductors:
ontrolling electronic devices IC1 - 7805C 5V regulator of IC2 is fed to the next flip-flop IC in-
from a PC is fun. Here is a IC2-IC8 - 74174 hex D-type flip-flop put as well as LED. Data line D6 is fed
D1-D4 - 1N4007 rectifier diode
scrolling message display that to IC8, while data line D7 is connected
LED1-LED42 - Red LED
makes use of the PC’s parallel port. to the clock inputs of IC2 through IC8.
Resistors (all ¼-watt, ±5% carbon):
The message typed from the key- Clock pins of all the flip-flop ICs are
R1- R42 - 150-ohm
board of the PC is displayed on the connected together. Master reset pin 1
Capacitors:
light-emitting diodes arranged as 5×7 of all the flip-flops is connected to Vcc.
C1 - 470µF, 16V electrolytic
dot-matrix display in moving message Miscellaneous: Pins 18 through 25 of the parallel port
format. X1 - 230V AC primary to 7.5V, are grounded. As data present on lines
LED-based scrolling message 1A secondary transformer D0 through D6 shifts from the first
displays are increasingly being used stage to the next stage, and so on, the
at railway stations, public places, three ports, namely, data port, status message appears as scrolling on the
colleges, universities, hospitals, port and control port. Here, only data dot-matrix LED display.
general stores, etc for disseminating port is used for this scrolling message The present circuit supports a
information. However, most displays display. display made of 42 LEDs comprising
lack in storage capacity and cannot Pins 2 through 9 form the 8-bit seven rows and six columns. Up to 30
display a large number of characters data output port. This is purely a such units can be added with no change
at a time. write-only port, which means it can in the circuit. However, to add these
This PC-based LED scrolling only output data. The base address of units, you need to amplify the clock
message display has the following the first parallel port (LPT1) is ‘378H’ pulse output. Note that each character
features: or ‘888’ (decimal). is displayed in a matrix of 5 columns
1. The message to be displayed is Parallel-input parallel-output and 7 rows (explained later), hence the
stored in a file and the message length (PIPO) registers are used to shift the sixth-column LEDs form part of the next
to be displayed is limited only by free signal from right to left. The clock character (column 1).
memory space on the hard disk of the pulse and code signal are generated Fig. 2 shows the power sup-
computer. by the computer program and output ply circuit. The AC mains is
2. The number of characters dis- from the parallel port (base address stepped down by transformer X1
played at a time can be as high as 30. 0×378). Theoretically, we can add infi- to deliver a secondary output of
3. The message stored in the file nite number of PIPO registers but the 7.5V AC at 1A. The transformer
can be changed using any text editor maximum number of registers is actu- output is rectified by a full-wave
including Notepad. ally limited to the current triggering bridge rectifier comprising diodes
4. The running speed of the mes- value of the clock pulse. To add a large D1 through D4, filtered by capacitor
sage displayed can be increased or number of PIPO registers, amplify the C1, then regulated by IC 7805C (IC1) to
decreased by pressing a few keys. clock pulse prior to connecting it to the provide regulated 5V DC to the circuit.
Here, the circuit is designed for PIPO ICs. An actual-size, single-side PCB for
displaying English characters on a 35 the circuits in Figs 1 and 2 is shown
(5×7) LED dot-matrix display. Circuit description in Fig. 5 and its component layout in
The PC’s parallel port (LPT port) Fig. 1 shows the circuit for the scroll- Fig. 6.
is used to output the display code and ing message display. IC 74174 has been EFY note. Commercially 7×5 dot-
the clock signal for the scrolling mes- used as PIPO register, which compris- matrix displays with discrete LEDs
sage display. es high-speed, hex D-type flip-flops. It may not be easily available in the mar-
The parallel port is terminated into is used as a 6-bit edge-triggered stor- ket, therefore a perforated board with
a 25-pin D-type female connector at age register. The data on the inputs of holes for the LED leads may be used.
the back of the PC. IBM PCs usually the flip-flop is transferred for storage The layout of such a board is shown in
come with one or two LPT ports. Each during high-to-low transition of clock. Fig. 7. The holes are used for passing
parallel port is actually made up of Data lines D0 through D5 of the paral- the LED leads.

52 Electronics projects Vol. 26


The software
The software for the scrolling
message display has been de-
veloped in ‘C’ language and
compiled in ‘Turbo C.’ When
you run the [Link] file,
the program tries to open the
[Link] file. If this file is
not present in the same direc-
tory, it creates one with text
“Welcome! You are watching
running led display...” and
starts sending this message to
the circuit via the parallel port
for display on 5×7 dot-matrix
pattern.
To increase the running
speed of the message, press
‘I’ key, and to decrease the
speed, press ‘D’ key. Press ‘R’
key for displaying the message
from the beginning. When the
program reaches the end of
the message, it starts from the
beginning again. To change the
text being displayed, exit the
program by pressing ‘Esc’ and
edit the [Link] file using
Notepad. After making changes
to the [Link] file, save it
and execute the [Link] file.
The program makes use of
the outportb() function, which
works perfectly only on Win-
dows 95/98. However, the pro-
gram may not work with the
latest Window versions such as
Windows 2000/XP .
When you try to save
changes in the [Link] file,
Fig. 1: Circuit of LED-based scrolling message display

the window shows an error


saying “Can’t save [Link].
It is being used by some other
application.” This is because
the [Link] file is running.
So exit the program by press-
ing ‘Esc’ key, then save your
changes made to the message.
txt file and run the [Link]
file. Now you can view your
changes in the message being
displayed.
The program does not show
special characters like ‘/,’ ‘\,’

Electronics Projects vol. 26 53


‘~,’ ‘@,’ ‘#,’ ‘$,’ ‘%,’ ‘+’ and ‘_.’
‘^,’ ‘(,’ ‘),’ ‘{,’ ‘},’ and Other special characters can be
‘;.’ It has been de- added as follows: Suppose you want
veloped for display- to display character ‘A.’ Draw ‘A’
ing alphabets (‘A’ on the 5×7 LED display as shown in
through ‘Z’), digits Fig. 3. First, ‘7CH’ data is available at
(‘0’ through ‘9’) and the input of IC2 and the first flip-flop of
some special charac- IC8. When a clock pulse is received, this
Fig. 2: Power supply
ters like ‘.,’ ‘,,’‘!,’ ‘–,’ data (7CH) is
output by IC2
and the first
flip-flop of IC8
and new data
‘12H’ arrives
at the input
pin of IC2 and
the first flip-
flop of IC8.
The output
Fig. 7: Perforated board for
data of IC2
Fig. 3: Design of character ‘A’ Fig. 4: Design of character ‘<’ 5×7 LEDs and the first

Fig. 5: Actual-size, single-side PCB for the LED-based scrolling message display including power supply

Fig. 6: Component layout for the PCB

54 Electronics projects Vol. 26


flip-flop of IC8 becomes the input for Now let’s assume that you want to ;str1[3]=0x14;str1[4]=0x8;
IC3 and the second flip-flop of IC8. display ‘<.’ For this, first draw this symbol break;
When the next clock pulse is received, on the 5×7 matrix as shown in Fig. 4. As- Save the file and compile the pro-
‘7CH’ data becomes available at the suming glowing LED as ‘1,’ convert the gram again. On executing the program,
output of IC3 and output of second binary column sequence into hexadeci- you can watch ‘<’ being displayed on
flip-flop of IC8, ‘12H’ is available at the mal for all the five columns as shown in the message display.
output of IC2 and the first flip-flop of the figure. Finally, add the following lines Other special characters can be
IC8 and new data ‘11H’ is available at in the software program where the com- added in the same way.
the input of IC2 and the first flip-flop ment “Add your codes here” appears: Download source code: http://
of IC8. This process continues until the Case ‘<’ : [Link]/admin/issuepdf/
message completes. str1[0]=0x00;str1[1]=0x41;str1[2]=0x22 PC%20Scroll%[Link]

SCroll.c
/************************************ DELAY-=1; case ‘g’:
SCROLLING MESSAGE DISPLAY } case ‘G’:
DEVELOPED BY : SURESH KUMAR if(DELAY<0) str1[0]=0x3A;str1[1]=0x49;s
FINAL YEAR, IITT COLLEGE OF ENGINEER- { tr1[2]=0x41; str1[3]=0x41;str1[4]=0x3E;
ING, PUNJAB DELAY=0; break;
THANX TO ALL TEACHERS AND MY PAR- } case ‘h’:
ENTS printf(“\nSCROLLING case ‘H’:
**********************************/ MESSAGE DISPLAY : Speed Increased”); str1[0]=0x7F;str1[1]=0x08;st
#include<stdio.h> break; r1[2]=0x08; str1[3]=0x08;str1[4]=0x7F;
#include<dos.h> case ‘d’: break;
#include<conio.h> case ‘D’: case ‘i’:
#include<process.h> DELAY+=10; case ‘I’:
unsigned char str1[5],str2[13],str[5]; printf(“\nSCROLLING str1[0]=0x41;str1[1]=0x41;st
int DELAY=100; MESSAGE DISPLAY : Speed Decreased”); r1[2]=0x7F; str1[3]=0x41;str1[4]=0x41;
void setcode(); break; break;
void sendcode(); case ‘r’: case ‘j’:
void getcode(char); case ‘R’: case ‘J’:
void main() rewind(fp); str1[0]=0x7F;str1[1]=0x41;st
{ printf(“\nSCROLLING r1[2]=0x41; str1[3]=0x41;str1[4]=0x21;
FILE *fp; MESSAGE DISPLAY : Started from Begining”); break;
char line[150],ch; break; case ‘k’:
clrscr(); case 27: case ‘K’:
fp=fopen(“[Link]”,”r”); clrscr(); str1[0]=0x41;str1[1]=0x22;st
if(fp==NULL) printf(“\nSCROLLING r1[2]=0x14; str1[3]=0x08;str1[4]=0x7F;
{ MESSAGE DISPLAY : Exiting “); break;
fp=fopen(“message. fclose(fp); case ‘l’:
txt”,”w”); delay(1000); case ‘L’:
if(fp==NULL) printf(“. “); str1[0]=0x40;str1[1]=0x40;st
{ delay(200); r1[2]=0x40; str1[3]=0x40;str1[4]=0x7F;
printf(“\n\ printf(“. “); break;
nCAN’T CREATE [Link] CREATE A FILE delay(200); case ‘m’:
UNDER NAME [Link] YOURSELF”); printf(“. “); case ‘M’:
exit(0); delay(200); str1[0]=0x7F;str1[1]=0x02;st
} printf(“. “); r1[2]=0x04; str1[3]=0x02;str1[4]=0x7F;
fputs(“ Welcome! You are delay(200); break;
watching running led display... “,fp); exit(0); case ‘n’:
fclose(fp); } case ‘N’:
fp=fopen(“message. goto startagain; str1[0]=0x7F;str1[1]=0x08;st
txt”,”r”); } r1[2]=0x04; str1[3]=0x02;str1[4]=0x7F;
if(fp==NULL) void getcode(char ch) break;
{ { case ‘o’:
printf(“\ switch(ch) case ‘O’:
nCAN’T FIND OR OPEN \”[Link]\””); { str1[0]=0x3E;str1[1]=0x41;st
exit(0); case ‘a’: r1[2]=0x41; str1[3]=0x41;str1[4]=0x3E;
} case ‘A’: break;
} str1[0]=0x7c;str1[1]=0x12; st case ‘p’:
clrscr(); r1[2]=0x11;str1[3]=0x12;str1[4]=0x7c; case ‘P’:
startagain: break; str1[0]=0x06;str1[1]=0x09; st
while(!kbhit()) case ‘b’: r1[2]=0x09;str1[3]=0x09;str1[4]=0x7F;
{ case ‘B’: break;
ch=fgetc(fp); str1[0]=0x36;str1[1]=0x49; st case ‘q’:
if(ch==EOF) r1[2]=0x49;str1[3]=0x49;str1[4]=0x7F; case ‘Q’:
{ break; str1[0]=0x3E;str1[1]=0x61; st
rewind(fp); case ‘c’: r1[2]=0x51;str1[3]=0x41;str1[4]=0x3E;
continue; case ‘C’: break;
} str1[0]=0x22;str1[1]=0x41; st case ‘r’:
printf(“\nSCROLLING r1[2]=0x41;str1[3]=0x41;str1[4]=0x3C; case ‘R’:
MESSAGE DISPLAY : Sending \’%c\’”,ch); break; str1[0]=0x46;str1[1]=0x29; st
getcode(ch); case ‘d’: r1[2]=0x19;str1[3]=0x09;str1[4]=0x7F;
setcode(); case ‘D’: break;
sendcode(); str1[0]=0x1C;str1[1]=0x22;s case ‘s’:
} tr1[2]=0x41; str1[3]=0x41;str1[4]=0x7F; case ‘S’:
ch=getch(); break; str1[0]=0x32;str1[1]=0x49; st
switch(ch) case ‘e’: r1[2]=0x49;str1[3]=0x49;str1[4]=0x26;
{ case ‘E’: break;
case ‘i’: str1[0]=0x41;str1[1]=0x41;st case ‘t’:
case ‘I’: r1[2]=0x49; str1[3]=0x49;str1[4]=0x7F; case ‘T’:
if(DELAY>10) break; str1[0]=0x01;str1[1]=0x01; st
{ case ‘f’: r1[2]=0x7F;str1[3]=0x01;str1[4]=0x01;
DELAY-=5; case ‘F’: break;
} str1[0]=0x01;str1[1]=0x01;st case ‘u’:
else r1[2]=0x09; str1[3]=0x09;str1[4]=0x7F; case ‘U’:
{ break; str1[0]=0x3F;str1[1]=0x40; st

Electronics Projects vol. 26 55


r1[2]=0x40;str1[3]=0x40;str1[4]=0x3F; str1[0]=0x31;str1[1]=0x4B; st str1[0]=0x08;str1[1]=0x08; st
break; r1[2]=0x45;str1[3]=0x49;str1[4]=0x21; r1[2]=0x08;str1[3]=0x08;str1[4]=0x08;
case ‘v’: break; break;
case ‘V’: case ‘4’: case ‘+’:
str1[0]=0x1F;str1[1]=0x20; str1[0]=0x10;str1[1]=0x7F; st str1[0]=0x08;str1[1]=0x08; st
str1[2]=0x40;str1[3]=0x20;str1[4]=0x1F; r1[2]=0x12;str1[3]=0x14;str1[4]=0x18; r1[2]=0x3E;str1[3]=0x08;str1[4]=0x08;
break; break; break;
case ‘w’: case ‘5’: case ‘_’:
case ‘W’: str1[0]=0x31;str1[1]=0x49; st str1[0]=0x40;str1[1]=0x40;st
str1[0]=0x7F;str1[1]=0x20; r1[2]=0x49;str1[3]=0x49;str1[4]=0x27; r1[2]=0x40; str1[3]=0x40;str1[4]=0x40;
str1[2]=0x10;str1[3]=0x20;str1[4]=0x7F; break; break;
break; case ‘6’: ////// ADD YOUR CODES HERE////////
case ‘x’: str1[0]=0x32;str1[1]=0x49; st default:
case ‘X’: r1[2]=0x49;str1[3]=0x51;str1[4]=0x3A; str1[0]=0x0;str1[1]=0x0;str1
str1[0]=0x63;str1[1]=0x14; break; [2]=0x0; str1[3]=0x0;str1[4]=0x0;
str1[2]=0x08;str1[3]=0x14;str1[4]=0x63; case ‘7’: break;
break; str1[0]=0x07;str1[1]=0x79; st }
case ‘y’: r1[2]=0x01;str1[3]=0x01;str1[4]=0x01; }
case ‘Y’: break; void setcode()
str1[0]=0x03;str1[1]=0x04; case ‘8’: {
str1[2]=0x78;str1[3]=0x04;str1[4]=0x03; str1[0]=0x36;str1[1]=0x49; st int i,k;
break; r1[2]=0x49;str1[3]=0x49;str1[4]=0x36; for(i=0,k=0;i<10;i+=2,k++)
case ‘z’: break; {
case ‘Z’: case ‘9’: str2[i]=str1[k];
str1[0]=0x03;str1[1]=0x04; str1[0]=0x3E;str1[1]=0x49; st str2[i+1]=str1[k]+128;
str1[2]=0x08;str1[3]=0x11;str1[4]=0x61; r1[2]=0x49;str1[3]=0x49;str1[4]=0x26; }
break; break; str2[i]=0;
case ‘0’: case ‘.’: str2[i+1]=128;
str1[0]=0x1C;str1[1]=0x22 str1[0]=0x60;str1[1]=0x60; st }
;str1[2]=0x41; str1[3]=0x22;str1[4]=0x1C; r1[2]=0x00;str1[3]=0x00;str1[4]=0x00; void sendcode()
break; break; {
case ‘1’: case ‘ ‘: int i;
str1[0]=0x40;str1[1]=0x40; str1[0]=0x00;str1[1]=0x00; st for(i=0;i<12;i++)
str1[2]=0x7F;str1[3]=0x42;str1[4]=0x44; r1[2]=0x00;str1[3]=0x00;str1[4]=0x00; {
break; break; outportb(0x0378,str2[i]);
case ‘2’: case ‘!’: delay(DELAY);
str1[0]=0x46;str1[1]=0x49; str1[0]=0x67;str1[1]=0x7F; st }
str1[2]=0x51;str1[3]=0x61;str1[4]=0x42; r1[2]=0x00;str1[3]=0x00;str1[4]=0x00; }
break; break; 
case ‘3’: case ‘-’:

56 Electronics projects Vol. 26

You might also like