rs232 relay control

Discussion in 'The Projects Forum' started by seesoe, Aug 31, 2009.

  1. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    hello, i looked around the net the whole night for some info, but i haven't found anything, everything is out dated or doesn't fit my project.

    basically i need to turn 3 of these relays on from a serial port
    http://www.allelectronics.com/make-a-store/item/RLY-503/5VDC-4PDT-DIP-RELAY/1.html

    i guess i can do a 4th relay that the serial port turns on and that 4th relay will turn the other 3 relays on, but im not sure what would be best, and exactly how to accomplish doing so, those relays are 5v, and the power supply im working with is 5v so that works out.

    maybe i can modify this to work with my 5v?
    http://www.windmeadow.com/node/4

    any help, suggestion, comments is greatly appropriated, thanks in advanced

    cheers
    seesoe
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  3. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    Thank you for the reply and the link, it was pretty interesting to read about.

    Unfortunently I'm not amazing at this stuff, I can build things but I can't design them from scratch, the system has to be connected to a serial port on a computer, it will be used with a special application that needs it
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Ok I see. Well if you need more control lines just expand the numer of serial ports. Also remember that the printerport has at least 8 lines for output
     
  5. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    ya i wish i had access to parallel port, the computer this is all hooking up to is about 100 feet away.

    the system is pretty in depth, basically i have a cash register that has a single serial port that can be used for a barcode scanner, and a null modem cable to download data to a computer.

    im using the 4pdt relays i linked earlier to make the switch from the main serial feed to the register to either scanner or computer. i want to operate this swtich with the serial port, thusly all i need is for the serial port to switch one relay, and then that one can just swtich the other 3 relays, unless the seral port can just easily switch all 3 at the same time, no exta relay.

    this all hooks up to a 4 port serial to ethernet box.

    thanks
    seesoe
     
  6. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    There are Ethernet device controllers that can do it simple and efficient using microcontrollers. Ready to use modules are available with their own software.
     
  7. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
  8. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Personally I think you're focusing too much on the relays, when you should be focusing on App Interface. I mean... any relay can be controlled from your Serial Port if you have the correct hardware interface. What software are you going to use to control these three relays or are you a programmer?

    BTW, the serial port can control up to 3 relays by using DTR, RTS and the TX Data line by putting it in a Mark state.
     
  9. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    I'm focusing to much on the relay because that's what I need help figuring out. But a good point that that I can use the other pins. I am writing my own program, I just need some sort of setup where I can turn three relays on at the same time with the click of a button, which I'll be programing
     
  10. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    If all three relays are going to be toggled simultaneously then just wire all the coils in parallel and use a simple NPN driver. What language are you coding this with?
     
  11. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    yes they will be triggered simultaneously, as i couldn't find a 9pdt relay or something simple, so im using 3 4pdt relays and triggering them together.

    im going to program it in autoit, there is a udf that i can have direct access tot eh serial port

    will the attached drawing work for the relays that i linked earlier, and the 5v input voltage, or do i need a resistor some where?
     
  12. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    How are you going to activate 3 5V relays in series from a 5V source? Each relay needs atlest 3.5V to turn on summing up ~10V

    Connect them in parallel instead. But if your relays draw over 200mA each, you will need to replace that transistor. It is 2N2222.
     
  13. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    As stated previously, you have to parallel these coils if powered by 5V. Radio Shack sells the TIP120 Darlington, 2N3055 (TO220 Case) and the IRF510 Mosfet. Any of these will handle your current requirements. ;)
     
  14. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    thank you both for your responses
    i thought i did something fishy, each relay will take up i think about 400mA, so i switched out the transistor to a TIP120 and made the relays in series.

    everything look ok?

    also do i have to tie the 5v negative to anything?

    thanks again:)
     
  15. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    Did you test the relay individually for current draw? single pole mini relays at 12V draws only 20mA and common double pole big relays about 80mA at 12V. At 5V, a normal relay will draw more current around 200mA but chances are less to go over 300mA. Check your relays once again.

    Also, since you have made them parallel, a single diode across them is enough. You might also need a transistor like the 2N2222 along with this TIP120 to work as your supply voltage is 5V and at 5V Vce, Ic will only be around 0.5A for TIP127 insufficient to drive 3 400mA relays. but if you can raise your supply voltage, everything will work fine without a common transistor. I'm not sure, so first check it the way it is. If not, we'll find solutions. The MOSFET's wont work either as they require 9V minimum to switch on, but there are a few that switch at 5V.

    You will need to tie your 5V supply's -ve to GND at the emitter of the transistor for it to work.
     
  16. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    As jj_alukkas stated, you need only one protection diode because it will be across all the coils. I disagree with jj on the need for a 2N2222 driver though. The TIP120 does not need a driver. It's a high gain, high current, Darlington and should work fine. Just make certain that it's saturated when the DTR pin is high. If it isn't (I doubt it) then lower the base resistor to 1K.

    BTW, I find it hard to believe that each coil pulls 500mA! Are you sure??
     
  17. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    ok i changed it up again, would it be better to use 5v at 2amp or 1amp?

    im not exactly sure my self about the relay coils, didn't think they took 400ma for their size.
    NAIS # DS4E-M-DC5V. 5Vdc, 62 Ohm coil

    i found a pdf here

    EDIT 1
    sorry it was 400 mW not mA, i can't find the mA

    EDIT 2
    i found a different relay that is made by panasonic on mouser, the datasheet is laid out with a bit more info, and i did found that its draws only 80mA
    page 3, table 1, standard m type, 5v
     
    Last edited: Sep 1, 2009
  18. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Your circuit looks fine now. You can also use the base diode differently if the base drive voltage is low, which is not the case from a Serial Port. Connecting the Cathode to the Base and the Anode to Gnd will shunt negative going voltages from exceeding -.7V.
     
  19. seesoe

    Thread Starter Active Member

    Dec 7, 2008
    99
    0
    alrighty then i will build it when the parts get here and post pictures of everything when im done:), thank you all for the great help!

    cheers
    seesoe
     
  20. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    I wasn't quite sure with that, but I thought that the TIP120 wouldn't get saturated at 5V and 1.2A load without a driver. Anyway, now its ok at 1.2W.
     
Loading...