Maker Pro
Maker Pro

Digital Signal to PC via Serial Cable

R

Richard

Jan 1, 1970
0
I am working on a small project, and want to design a circuit that
will interface with a PC via a serial cable.

The circuit needs to pick up the state of a micro switch (on or off),
and then send the signal to a PC via Serial Cable, where a Visual
Basic program will pick up the COM state and react to the change in
state.

Can anyone suggest where to start.

Cheers,


Richard
 
S

scada

Jan 1, 1970
0
Richard said:
I am working on a small project, and want to design a circuit that
will interface with a PC via a serial cable.

The circuit needs to pick up the state of a micro switch (on or off),
and then send the signal to a PC via Serial Cable, where a Visual
Basic program will pick up the COM state and react to the change in
state.

Can anyone suggest where to start.

Cheers,


Richard

Is it only one switch to monitor? If so, use the mscomm control to monitor
one of the handshaking lines with the "OnComm" feature. Example: comEvCD
(change in carrier detect line). Run your contact through an opto-isolator
IC to fire up the LED (use isolated supply, not from the PC). Use the IC
output to pulse the CD line of the RS232. Loop a program in VB to poll the
port, then do what you need to do!
 
R

Richard

Jan 1, 1970
0
Is it only one switch to monitor? If so, use the mscomm control to monitor
one of the handshaking lines with the "OnComm" feature. Example: comEvCD
(change in carrier detect line). Run your contact through an opto-isolator
IC to fire up the LED (use isolated supply, not from the PC). Use the IC
output to pulse the CD line of the RS232. Loop a program in VB to poll the
port, then do what you need to do!


Yes it will be an optoswitch.

I theory, I want to design a "makeshift" swipe card reader, so when a
card breaks the optoswitch light, I want an LED1 (always on) to turn
off, and LED2 (always off) to turn to indicate a successful login.

I will use a VB program on teh PC to monitor the COM port for any
activity.

A design I was looking at/reseached, was a PIC 16F84 to control teh
input (optoswitch) and the outputs (LED1 & LED2) and the output to a
MAX232 to interface with the serial port which runs off to the PC with
the VB program.
 
S

scada

Jan 1, 1970
0
Richard said:
Yes it will be an optoswitch.

I theory, I want to design a "makeshift" swipe card reader, so when a
card breaks the optoswitch light, I want an LED1 (always on) to turn
off, and LED2 (always off) to turn to indicate a successful login.

I will use a VB program on teh PC to monitor the COM port for any
activity.

A design I was looking at/reseached, was a PIC 16F84 to control teh
input (optoswitch) and the outputs (LED1 & LED2) and the output to a
MAX232 to interface with the serial port which runs off to the PC with
the VB program.

OK, that's good! You can have the PIC chip toggle the CD line (or whichever
Handshake line you choose) or you could send a word back to the RS232 port!
IE: Send an ASCII "A" (or whatever character you choose) would indicate an
"on" condition. With the one ASCII word you can have 128 conditions (7 bit
resolution)! But if your using the PIC 16F84, you will have to "Bit Bang"
the code. Better off choosing a PIC chip with a USART built in!
 
Top