need help with remote access power (off/on) circuit

Discussion in 'The Projects Forum' started by earlt, Nov 2, 2009.

  1. earlt

    Thread Starter New Member

    Nov 2, 2009
    4
    0
    Hi, I need some advice on part of a remote power re-cycle (off/on) circuit. [I have some remote network equipment that gets 'hung up" and needs to be reset via power off/on.] I have a PC there with the equipment that I can access via the internet. I was thinking that I could put a micro controller circuit there and access it via the PC serial port. I have simple circuits for connecting either a PIC or Atmel micro controller to an RS232 converter (using a MAX232 or just transitors and resistors). My problem is that I am not sure what to use (electronic parts) in the circuit to turn the power off then back on again. (I can program OK but my electronics knowledge is lacking) Perhaps some transistor that can take 120v in/out and accept the low current from the micro? I would keep power to the transitor base till it received a command via the UART to drop power. Then it would drop power for a few seconds and put it back, thus re-setting whatever equipment was connected. Is that too simple? or do i need something more? any help appreciated
     
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Try a simple 120VAC relay (with high enough current ratings to handle the devices load) with a 5 or 12 volt coil..... have the relay setup up to where it defaults to power on for the device (connect to one of the normally closed contacts for the relay) and whenever you need to cycle the power, just activate the relay for atleast 1 minute. this way it always defaults to power on for the device and you will only be using power on the relay when you need to reset the other device.....

    You can still use the RS232 port to do this just make an interface to the port and use the DTR line to turn on a transistor that could switch the relay on/off..... and you can also power the whole circuit off of your PC's power supply if you have an extra 4 pin molex connector available.... using a microcontroller may be a bit overkill for this.....
     
  3. earlt

    Thread Starter New Member

    Nov 2, 2009
    4
    0
    Good idea. Thanks!
     
  4. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    Just curious.. Can you please describe how you plan to interface your internet connection with your CommPort?
     
  5. earlt

    Thread Starter New Member

    Nov 2, 2009
    4
    0
    The PC is a Linux server with secure shell and web server access. I plan on using either a secure shell command or a web page to run the custom RS232 application which will turn on DTR for a little while and then turn it off.
     
  6. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    I'm not familiar with Linux or it's secure shell but if this means that you can Shell any .exe on the PC then this simple VB6 app will do what you want easily.

    Code ( (Unknown Language)):
    1.  
    2. Option Explicit
    3. Dim strMsg1 As String
    4. Dim strMsg2 As String
    5.  
    6. Private Sub Form_Load()
    7.    Me.Show
    8.    strMsg1 = "This App Will Close In  "
    9.    strMsg2 = "  Seconds!"
    10.    Me.Caption = "DTR Toggler"
    11.    Label1.Caption = vbNullString
    12.    Timer1.Interval = 1000                      ' Set Timer to 1,000mS (1Sec)
    13.    Timer1.Enabled = True
    14.    MSComm1.CommPort = 1                 ' Change to your preference
    15.    MSComm1.PortOpen = True              ' Open the port. DTR line defaults to Enabled  (+) when opened.
    16. End Sub
    17.  
    18. Private Sub Timer1_Timer()
    19.    Static i As Integer
    20.       i = i + 1
    21.       Label1.Caption = strMsg1 & 11 - i & strMsg2
    22.          If i = 12 Then
    23.             MSComm1.PortOpen = False
    24.             Unload Me            ' Close the port and app after ~12 seconds. DTR will go low (-).
    25.          End If
    26. End Sub
    27.  
    28.  
     
    Last edited: Nov 4, 2009
  7. earlt

    Thread Starter New Member

    Nov 2, 2009
    4
    0
    A Linux distro can run "certain" windows programs with an emulator such as Wine, however i'd also need to find a basic interpreter to run your sample code.

    Basic is around for Linux but I am not sure how wide spread it is used there.

    Anyway, it is very simple in Python for example:

    #!/bin/env python
    import serial,time
    ser = serial.Serial(0, 9600, timeout=0)
    ser.rtscts = 1
    ser.dsrdtr = 1
    time.sleep(5)
    ser.close()
     
    Last edited: Nov 3, 2009
  8. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    If those options don't work out for you let me know. I'll convert it to an exe for you.
     
Loading...