Maker Pro
Maker Pro

Need help on creating interface circuit for RS232

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.
 

Attachments

  • LED.JPG
    LED.JPG
    19.1 KB · Views: 583
  • Relay.JPG
    Relay.JPG
    17.6 KB · Views: 421

Harald Kapp

Moderator
Moderator
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
 
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



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
 

Attachments

  • RS232 level shifter.JPG
    RS232 level shifter.JPG
    6.3 KB · Views: 357
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.
 

Harald Kapp

Moderator
Moderator
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
 
Top