Connect with us

Need help on creating interface circuit for RS232

Discussion in 'General Electronics Discussion' started by ECCMOT, Mar 3, 2012.

Scroll to continue with content
  1. ECCMOT

    ECCMOT

    4
    0
    Mar 3, 2012
    Dear Friends
    I hope someone can help me on this problem. I am working on a project in my workplace to create a interface circuit for RS232. My problem is, I need to detect a LED and a relay turned on. Once these 2 device has been turned on, I need to detect the signals from both and send it thru RS232 to trigger my software. I am attaching the part of the circuit which shows the LED and Relay. Hope someone can show how to tap the voltage or current from these device and feedback to RS232 by creating a interface circuit which software able to detect it.
     

    Attached Files:

  2. Harald Kapp

    Harald Kapp Moderator Moderator

    10,223
    2,202
    Nov 17, 2011
    If you want to signal via RS232, you can't transmit single static signals. You will have to generate an RS232 comaptible bitstream (UART signal). This will require a small microcontroller like PIC or Attiny.

    One thing you could do is: use a simple level shifter from teh LED and relay control signals to RS232 level (see here: http://elinux.org/RS232_Level_Shifter). Instead of tapping the data lines (RxD, TxD), use RTS and DTR (http://en.wikipedia.org/wiki/RS-232). These are control lines, there is no data telegram over these lines. You can detect the signal level of these lines via port pins on the receiver side.

    The software is up to you.

    Harald
     
  3. ECCMOT

    ECCMOT

    4
    0
    Mar 3, 2012


    Thanks Harald. Appreciate for your input. I will use MAX232 as a level shifter circuit to get input from LED and Relay and then MAX232 will provide the data to the RS232 port. I use your link to create a MAX232 level shifter circuit attached here. Now I need your help to show me how to connect the MAX232 pin 9,11 and 12 to relay and the LED. I need to detect once the LED and relay turned on. thanks
     

    Attached Files:

  4. Harald Kapp

    Harald Kapp Moderator Moderator

    10,223
    2,202
    Nov 17, 2011
    You should be able to directly connect to INT_LED and Relay_on.

    Harald
     
  5. ECCMOT

    ECCMOT

    4
    0
    Mar 3, 2012
    Harald.
    Thanks. I need just need a clarification. I noticed that the relay has a 5V on other terminal and I will connect other end of the terminal from the relay (Relay_ON) to the R1OUT of the MAX232 IC. This means I will have direct 5V to be input to pin R1OUT of the MAX232 IC which indicate the relay has been turned on. Can this damage the Serial Port since we are inputting 5V direct to the port?
    The same goes to LED. I will tap the circuit from the TP31 and route to R2OUT of the MAX232 IC. There will be some voltage drop at R12 and D2 (LED) and some to the pin of R2OUT of the MAX232 IC. Can this damage the Serial Port?
    thanks.
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    10,223
    2,202
    Nov 17, 2011
    Why,
    you're not supposed to connect the relay (or LED) signals to the OU-pins of the MAX.
    These signals should go to the ION-pins so the MAX can make RS232 signals which are then transmitted to the receiving end.

    Unless I have understood the task completely wrong, that is.

    Harald
     
  7. ECCMOT

    ECCMOT

    4
    0
    Mar 3, 2012
    Harald
    Thanks. I will try it out. Thanks for your guidance. Appreciate.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-