Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Interfacing with serial ports

Hello all.
I'm computer science student. I need some idea regarding my project rest of work i'll do myself. The simple question is "say I've a small motor (which normally used in VCRs/Tape recorders) and I want to control it from computer (on/off) program. I've connected it to computer serial RS232 port. Please tell me the complete circuit of it and if possible the program (in c++)" Else tell me some good links if possible.
Thanx in advance.
mobb..

Comments

  • melissa_may1melissa_may1 Posts: 937Member
    : Hello all.
    : I'm computer science student. I need some idea regarding my project rest of work i'll do myself. The simple question is "say I've a small motor (which normally used in VCRs/Tape recorders) and I want to control it from computer (on/off) program. I've connected it to computer serial RS232 port. Please tell me the complete circuit of it and if possible the program (in c++)" Else tell me some good links if possible.
    : Thanx in advance.
    : mobb..
    :

    Hi there!

    The easiest way to use the serial port to control things like this is to use the control pins of the RS232. Take a look at DSR, DTR, RI, etc.

    These pins can either be read (i.e. check the state of the RI), or changed (turn DTR on or off) from software.

    You probably need a relay or some electronic buffer circuit to handle the current needed to drive the motor. The RS232 pins are very low current.




    [purple]Melissa[/purple]

  • My_AusweisMy_Ausweis Posts: 6Member
    Also don't forget to use ic max232 /st232 to convert rs232 signal from/to ttl voltage

    : : Hello all.
    : : I'm computer science student. I need some idea regarding my project rest of work i'll do myself. The simple question is "say I've a small motor (which normally used in VCRs/Tape recorders) and I want to control it from computer (on/off) program. I've connected it to computer serial RS232 port. Please tell me the complete circuit of it and if possible the program (in c++)" Else tell me some good links if possible.
    : : Thanx in advance.
    : : mobb..
    : :
    :
    : Hi there!
    :
    : The easiest way to use the serial port to control things like this is to use the control pins of the RS232. Take a look at DSR, DTR, RI, etc.
    :
    : These pins can either be read (i.e. check the state of the RI), or changed (turn DTR on or off) from software.
    :
    : You probably need a relay or some electronic buffer circuit to handle the current needed to drive the motor. The RS232 pins are very low current.
    :
    :
    :
    :
    : [purple]Melissa[/purple]
    :
    :

  • xkgdiamxkgdiam Posts: 111Member
    also, don't connect anything directly to your port,you can burn the internals diodes of your com very easily.MAX232 is a good choise for
    that too, or use opto-isolators ics
    : Also don't forget to use ic max232 /st232 to convert rs232 signal from/to ttl voltage
    :
    : : : Hello all.
    : : : I'm computer science student. I need some idea regarding my project rest of work i'll do myself. The simple question is "say I've a small motor (which normally used in VCRs/Tape recorders) and I want to control it from computer (on/off) program. I've connected it to computer serial RS232 port. Please tell me the complete circuit of it and if possible the program (in c++)" Else tell me some good links if possible.
    : : : Thanx in advance.
    : : : mobb..
    : : :
    : :
    : : Hi there!
    : :
    : : The easiest way to use the serial port to control things like this is to use the control pins of the RS232. Take a look at DSR, DTR, RI, etc.
    : :
    : : These pins can either be read (i.e. check the state of the RI), or changed (turn DTR on or off) from software.
    : :
    : : You probably need a relay or some electronic buffer circuit to handle the current needed to drive the motor. The RS232 pins are very low current.
    : :
    : :
    : :
    : :
    : : [purple]Melissa[/purple]
    : :
    : :
    :
    :

  • melissa_may1melissa_may1 Posts: 937Member
    : : Also don't forget to use ic max232 /st232 to convert rs232 signal from/to ttl voltage

    Just to clarify, the MAX232 converst from serial-port-level voltages to TTL-level voltages. You only need this device if you are connecting the serial port directly to TTL devices.

    In fact, it's overkill if you're just picking one or two pins to work with. You could do the same with discreet devices. That said, if you are interfacing with TTL devices, the MAX232 device is the most practical way to do it.

    : also, don't connect anything directly to your port,you can burn the internals diodes of your com very easily.MAX232 is a good choise for
    : that too, or use opto-isolators ics

    Well, that's going a bit too far. Don't connect anything? I'd better run up and disconnect my printer and Wyse terminal from my UNIX system... :)

    Many devices can obviously be connected to a serial port without a MAX232 or opto-isolators.

    I've done tons of control circuits by wiring dierctly to the control pins of the serial port, and controlling the pins with software.

    The first thing to do, of course, is to check out the RS232 specs, and see what voltages are present, when current expectations are, etc.




    [purple]Melissa[/purple]

  • xkgdiamxkgdiam Posts: 111Member
    : : also, don't connect anything directly to your port,you can burn the internals diodes of your com very easily.MAX232 is a good choise for
    : : that too, or use opto-isolators ics
    :
    : Well, that's going a bit too far. Don't connect anything? I'd better run up and disconnect my printer and Wyse terminal from my UNIX system... :)
    :
    : Many devices can obviously be connected to a serial port without a MAX232 or opto-isolators.

    i'm talking about printers or so, they take care of ports in safe,
    but if you connect a experimental circuit directly, then a short circuit
    or a reverse current (as from a mottor) can do the damage easily.

  • panic modepanic mode Posts: 10Member
    RS232 specification says that any RS232 port must be
    designed to survive short circuit conditions. Due nature
    of my work, I deal with serial ports all the time,
    have two dozen of different cables in my laptop bag,
    have shorted two or more RS232 pins on numerous occasions
    while testing connections or forcing RS232 port to "talk RS422"
    and never had problem like "com port blowing up".
    If you are really paranoid, get yourself USB<>RS232
    converter, they are really cheap nowdays and you can get
    them everywhere.
Sign In or Register to comment.