CAT5 cable

Status
Not open for further replies.

GatorGuy

New Member
We need to control relays over a long distance. Our controller boards will have several PIC's controlling the relays. The main controller would be connected to a PC via the serial port. We can either put the pics on the expansion cards near the relay and send the serial data through the CAT5 cable to the PIC or have the PIC on the main board and send the 5+ volts from the I/O pin to a transistor over the CAT5. My question is which would be better? If we put the PIC on the expansion card and sent the data over the CAT5 would it degrade over a long distance?

Another way would be to send the pin high to a transistor and have a higher voltage sent over the cable and step it back down at the receiving board.

Any thoughts would be great.
 
I would connect CAT5 cable dirrectly to COM port, RS232s voltage levels are ideal for long distance applications. So you would have your mainboard close to relays.
 
Jay.slovak said:
I would connect CAT5 cable dirrectly to COM port, RS232s voltage levels are ideal for long distance applications. So you would have your mainboard close to relays.

That would be okay to do. Only problem with doing it that way is that we may have 20+ expansion boards all over the building. I would have to connect the RS232 to each board in parallel. Each board's PIC would be programmed to only respond to data that is meant for it. Would we have any problems with that many boards running off of the RS232?
 
Hmm, that might be a problem, running RS232 is paralel is not a good idea. I thought only single board will be controlled from PC.

So in this case try:

Code:
PC->RS-232->Mainboard-> MAX232->CAT5-> MAX232-> DEVICE_1
                     -> MAX232->CAT5->MAX232-> DEVICE_N
 
Here is what I had in mind. Of course I have left out resistors, power, and the rest of the circuit. The RS232 would have resistors in line with the PICs. Like I said earlier each PIC would have different programs to deal with the incoming data.
 

Attachments

  • main.jpg
    7.4 KB · Views: 808
GatorGuy said:
Here is what I had in mind. Of course I have left out resistors, power, and the rest of the circuit. The RS232 would have resistors in line with the PICs. Like I said earlier each PIC would have different programs to deal with the incoming data.
This is fine if your PICs only receive data, there would be a problem if you want to transmit data from PICs to PC.
 
You don't mention if you're using MAX232's or not?, if you were, you could use those to chain the different units together.

So, RS232 into a MAX232, 5V output to PIC (as usual), but connect the 5V output to the 5V INPUT of one of the MAX232 outputs, giving another RS232 output to feed along to the next device (complete with it's own MAX232).

This has the added advantage of increasing the range of the RS232, as it's buffered and amplified through every MAX232.
 
Nigel, that's exactly what I posted! Maybe it was unclear?
 
Thank you to both of you. That sounds like a good option. For now, while I am waiting for my shipment of supplies I am working on a test board without a MAX232. I have a schematic that connects the RS232 to the pic with a single 22k resistor. Has anyone done anything like this before? The schematic shows:

PIN 3 --> 22k --> Input pin on PIC
PIN 5 --> GND

Could I use that for some testing?
 
I have never used that resistor between PIC and MAX232, I think it's safe to leave-it-out. MAX232 has 4 buffers, you will only need 2 (for TX and RX). This should explain it:
 

Attachments

  • max232_310.gif
    20.1 KB · Views: 1,038
GatorGuy said:
Yes, the pic would only be receiving data from the PC.

Yes, that's fine, but it means you can't use the hardware USART, you have to use a software one. Also, it means you can't run as long a wires, the MAX232 buffer suggestion I made earlier (and Jay did), uses it as a buffer on each board, allowing you to have much longer connections.
 
I will end up using the max232 on the final design. Right now I would like to just test out some ideas. The mainboard will be near the controlling PC at all times.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…