Controlling 2 Switches with RS232

Thread Starter

nicmon

Joined Mar 18, 2011
30
I'm googling since 1 week and could not find an answer, so I ask it here.

I want to control 2 switches via RS232, but just as a pulse. i.e. once a switch receives a command to be On, it changes its status to On and goes Off again after 1 second or so.

I can of course control some items programatically, for example that only one of 2 switches receives a command or send On command, delay 1000ms and send Off command again to keep the schematic simple.
 

Thread Starter

nicmon

Joined Mar 18, 2011
30
Do you mean that I need no MAX232 or a PIC for it?
I have still no language interface as I'm still looking for a schema and solution and can program in many languages including C, C++, C#, Delphi, Java, VB and so on.
 

CDRIVE

Joined Jul 1, 2008
2,219
Well you can do a lot more things if you use a uC (I prefer Picaxe) but for your requirements you won't need one or a MAX232. When you say "VB", are we talking VB6 or NET? Microsoft should never have named anything above VB6 VB, as it causes much confusion and have little in common.
 

Thread Starter

nicmon

Joined Mar 18, 2011
30
I said VB to keep the list of my abilities shortly :D, it doesn't a matter to write a VB6, NET or GWBasic for me.
 

mcgyvr

Joined Oct 15, 2009
5,394
There are tons of serial port relay kits out there.. You could do the timing with software instead of hardware and be done. Enable specific com port pin for 1 second or whatever
 

CDRIVE

Joined Jul 1, 2008
2,219
Here's the VB code for my circuit. You will need 2 CommandButtons, 2 TimerControls and 1 MSCommControl.

Note that I didn't use the default names for the controls except for the Form. That said, I used accepted naming conventions, so it should be easy to follow.

Rich (BB code):
' Written by CDRIVE 07 April 2011
' CmdDTR will enable the DTR line. TmrDTR will disable the DTR line after 1 second.
' CmdRTS will enable the RTS line. TmrRTS will disable the RTS line after 1 second.
 
Option Explicit
 
Private Sub Form_Load()
   Form1.Caption = "DTR - RTS Switcher"
   TmrDTR.Enabled = False
   TmrDTR.Interval = 1000
   TmrRTS.Enabled = False
   TmrRTS.Interval = 1000
   CmdDTR.Caption = "Enable DTR"
   CmdRTS.Caption = "Enable RTS"
   COM.CommPort = 1               ' change to whatever port you use
   COM.DTREnable = False
   COM.RTSEnable = False
   COM.PortOpen = True
End Sub
 
Private Sub CmdDTR_Click()
   COM.DTREnable = True
   CmdDTR.Caption = "DTR Enabled"
   TmrDTR.Enabled = True
End Sub
 
Private Sub CmdRTS_Click()
   COM.RTSEnable = True
   CmdRTS.Caption = "RTS Enabled"
   TmrRTS.Enabled = True
End Sub
 
Private Sub TmrDTR_Timer()
   COM.DTREnable = False
   CmdDTR.Caption = "Enable DTR"
   TmrDTR.Enabled = False
End Sub
 
Private Sub TmrRTS_Timer()
   COM.RTSEnable = False
   CmdRTS.Caption = "Enable RTS"
   TmrRTS.Enabled = False
End Sub
 
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
   COM.PortOpen = False
End Sub
 
Last edited:

Thread Starter

nicmon

Joined Mar 18, 2011
30
thank you, really appreciate for this.

I have 2 questions,
- do I need exactly 12V or I can also use a 9V battery (or ideally the power from COM)
- are K1 and K2 the 2 points that I want to be connected and disconnected each time that I send a command?
 

CDRIVE

Joined Jul 1, 2008
2,219
I've redrawn the attached schematic to make the inputs and outputs clearer for you. I've also amended my code (see last post) to provide a visual display of the DTR and RTS status. You can change the captions to ON and OFF if you like.

I don't recommend using your PC as a power supply. 12VDC wall warts are cheap and can be purchased anywhere, including Radio Shack. Radio Shack also has 12VDC/10Amp relays (Catalog #: 275-248) and 2N3904 transistors. Just about any small signal/switch (PNP) transistor can replace the 2N2904s.
 

Attachments

CDRIVE

Joined Jul 1, 2008
2,219
This post, including code and attached schematic was removed because I found myself posting information that violated tenants that I believe should be adhered to when dealing the serial port.
 
Last edited:

Thread Starter

nicmon

Joined Mar 18, 2011
30
This was my initial Problem which triggered to ask this question. I have a AOYUE 968 Reflow Station which I want to use to lift up BGA Chips.
Doing it, needs to keep a Profile from various Temperature and with an exact time length e.g.
183 oC -> 2 min.
231 oC -> 2 min.
271 oC -> 10 sec.
and so on.

as you see on picture, there are 2 buttons for increasing or decreasing the temperature and 2 Displays, the above one shows the set temp and the below one shows the current temp.

if I connect 2 points on PCB behind the display with a screwdriver, the temperature will be increased or decreased (depend on which button I connect)

so my Idea was to build a very simple circuit with relays to control the pressing the buttons by a PC.

do you think that it is possible to read the current temp. value from display wire as well?
 

Attachments

CDRIVE

Joined Jul 1, 2008
2,219
as you see on picture, there are 2 buttons for increasing or decreasing the temperature and 2 Displays, the above one shows the set temp and the below one shows the current temp.

if I connect 2 points on PCB behind the display with a screwdriver, the temperature will be increased or decreased (depend on which button I connect)

so my Idea was to build a very simple circuit with relays to control the pressing the buttons by a PC.
Chances are you don't need relays at all. Is one of the two points on the PCB ground or a supply rail?
do you think that it is possible to read the current temp. value from display wire as well?
Just about anything is possible. Practical, feasable, cost effective... don't know yet. Do you have a schematic for this device?
 

Thread Starter

nicmon

Joined Mar 18, 2011
30
unfortunately not, I wrote an email to aoyue, but they didn't answer. I will use a multimeter today and try to find it out.
 

CDRIVE

Joined Jul 1, 2008
2,219
Must of us don't answer PMs or emails regarding help with topics. This is because doing so defeats the purpose of the forum.

Edit: See post 20. I misunderstood.
 
Last edited:

CDRIVE

Joined Jul 1, 2008
2,219
Please post the following information to determine if this is high side switching...

(1) The voltage from circuit common to the most positive point of the two points that you're jumping.

(2) The voltage from circuit common to the jumper when the jumper is in.

(3) Use an ammeter as a jumper and measure the current when the two points are jumped. Use care when doing this! Anytime a VOM is in current mode you risk damage to the meter, device, or both by an inadvertent slip off a solder pad or by touching the wrong points.
 
Top