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

Thread Starter

earlt

Joined Nov 2, 2009
4
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
 

BMorse

Joined Sep 26, 2009
2,675
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.....
 

CDRIVE

Joined Jul 1, 2008
2,219
Just curious.. Can you please describe how you plan to interface your internet connection with your CommPort?
 

Thread Starter

earlt

Joined Nov 2, 2009
4
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.
 

CDRIVE

Joined Jul 1, 2008
2,219
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.
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.

Rich (BB code):
Option Explicit
Dim strMsg1 As String
Dim strMsg2 As String
 
Private Sub Form_Load()
   Me.Show
   strMsg1 = "This App Will Close In  "
   strMsg2 = "  Seconds!"
   Me.Caption = "DTR Toggler"
   Label1.Caption = vbNullString
   Timer1.Interval = 1000                      ' Set Timer to 1,000mS (1Sec)
   Timer1.Enabled = True
   MSComm1.CommPort = 1                 ' Change to your preference
   MSComm1.PortOpen = True              ' Open the port. DTR line defaults to Enabled  (+) when opened.
End Sub
 
Private Sub Timer1_Timer()
   Static i As Integer
      i = i + 1
      Label1.Caption = strMsg1 & 11 - i & strMsg2
         If i = 12 Then
            MSComm1.PortOpen = False
            Unload Me            ' Close the port and app after ~12 seconds. DTR will go low (-).
         End If
End Sub
 
Last edited:

Thread Starter

earlt

Joined Nov 2, 2009
4
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:
Top