PC in control

Y

Thread Starter

ysbargathi

I have a control problem in which i want to control my central heating system and I want to use my PC as a controller, so I want to to know
the Pin assignment of the serial port and which programming language is the best in such cases, also If possible I want to know about the
RS232 protocol.
thanks in advance
best regards
 
There is a lot of develloped applications at Internet. I use one site "http://www.epanorama.net":http://www.epanorama.net this is very good site about a lot of thing related to eletronics and automation.
For example, if you choose Home automation, you will get a lot of thing rellated to automation.
I good choice also is Motor Control, there is a lot of options using serial and parallel ports.

Also, use this link: "http://www.aaroncake.net/circuits/":http://www.aaroncake.net/circuits/
option Computerize Your Room/Home . There is a circuit to use parallel port to do home automation. The author no long support.

Also, if you want learn program computers, I recomend C or C++. Is the strongest. There is a book called Jamsa's C/C++ Programmer's Bible
-- by Kris A. Jamsa I think it costs ~ US$35.
There is some subroutines to access serial and parallel ports.

I hope its help.
 
S
First, RS-232 is not a "protocol", It is an EIA Standard for electrical serial data transmitions. There is a lot of protocols based in RS-232, RS-422, RS-485, and soo on serial data electrical standards. In home applications I suggest you visit X10 organization web site ( "www.x10.org":http://www.x10.org ).
 
C

Curt Jeffreys

RS-232 is not a protocol, it is a definition for a serial electrical connection between 2 communications devices, for example, PC to PC, PC to Modem, etc.. The pin assignements vary depending on whether the connector is 9 pin or twenty-five and whether the connection is what's called a "Null Modem" connection (in its simplest form, transmit and receive pins are
swapped).

The pin outs for a 9-pin connector are:

1 - Received Line Detector (DCD)
2 - Receive Data (RD)
3 - Transmit Data (TD)
4 - DTE Ready (DTR)
5 - Signal Ground (SG)
6 - DCE Ready (DSR)
7 - Request to Send (RTS)
8 - Clear to Send (CTS)
9 - Ring Indicator (RI)

For 25-pin:

1 - Shield
2 - Transmit Data
3 - Receive Data
4 - Request to Send
5 - Clear to Send
6 - DCE Ready
7 - Signal Ground
8 - Received Line Detecor
20 - DTE Ready
22 - Ring Indicator

You need to know whether the hardware you are trying to talk to needs a Null Modem or straight through connection and whether it requires hardware handshaking and if so, what pins are the handshake pins.

Once all that's figured out you still need to know the protocol of the device you are trying to talk to. What's the baud rate, the parity, the number of stop bits? What is the message format, error correction, timing constraints, etc?

There's alot to figure out. Usually the hardest part is determining the message structure - the protocol. If the manufacturer publishes his protocol or if its a "standard" protocol such as Modbus, life is a lot easier. Otherwise you have to figure things out on your own. That's what I do for a living and I can honestly say breaking a protocol is much harder than actually writing the code to implement it.

Assuming you get all of the above, you can pick a language and OS of your choice. DOS supports C, C++, BASIC, Pascal, etc. Windows, the same. Linux/Unix has lots more options.


Curt Jeffreys
 
G

George (Jim) Hebbard

A very excellent book for home automation is
the following:
Home Automation Basics : Practical Applications Using Visual Basic 6
by Tom E. Leonik,


I bought it from Amazon.com: Paperback - 386 pages Bk&Cd-Rom edition
(August 2000)
Delmar Publishers; ISBN: 0790612143 ; Dimensions (in inches): 0.71 x 9.34 x
7.46

=>Jim<=
 
ysbargathi:
> I have a control problem in which i want to control my central heating
> system and I want to use my PC as a controller, so I want to to know the
> Pin assignment of the serial port

Try the serial-howto [1] - it has pinouts and voltage levels.

You can also have a look at the coffee-howto, which talks about interfacing a coffee machine via the parallel port. Watch out for completely different voltages, though.

> and which programming language is the best in such cases,

First preference would be whichever language you're already familiar with.

Other than that, it doesn't make much difference... what else do you want the program to do? How do you want to interact with it?


Consider also whether there are safety aspects - can the heating system overheat and catch fire? If the system gets stuck on full, are there likely to be people in the house who would be at risk of heatstroke? (elderly, very young, ill etc - anyone unable to turn it off or leave).


Jiri

[1] type it into google at http://google.com
It should also be at the linux documentation project.
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
F
As Jim suggested, I also recommend Leonik's book. He does an excellent job of stepping you through the use of the serial port from VB perspective. I also recommend Serial Port Complete by Jan Axelson. Both books are very good. Leonik's book explains how communicate with the AB Micrologix PLC and spends a lot of time making sure you understand the port and programming techniques required to use it. Axelson spends more time on cables, connectors,
terminations, programming computer links and building serial port related circuits.
 
> I have a control problem in which i want to control my central heating
system and I want to use my PC as a controller...<

...I also recommend Serial Port Complete by Jan Axelson. Both books are very good.

> ...Axelson spends more
> time on cables, connectors, terminations, programming computer links and
> building serial port related circuits.

so you have to surf over to Axelson's site: "www.lvr.com"http://www.lvr.com

Rufus
 
J

Johan Bengtsson

Pin assignment is easy:
9pin 25pin signal
1 8 DCD
2 3 RX
3 2 TX
4 20 DTR
5 7 GND
6 6 DSR
7 4 RTS
8 5 CTS
9 22 RI

In many cases it is enough to use GND, Tx and Rx

RS232, describes the above, voltages, how a character is sent, timing and some other issues (like what each signal is used for) It does not describe anything about what characters are transmitted, that is something you have to get to ask the one you got the device at the other end of the wire.

As what language to use - what language do you know? Basic, Pascal, C, C++, Java, ... pick your favorite

The next thing you have to know is how to send and recieve characters on the COM-port, what commands to send and what answers to expect and
so on.

How to access the COM-port does to some degree depend on choice of language, to some degree to choice of operating system, and some other
factors.

But before you do anything at all I suggest you try to get a description of the command strings to send because unless you have those you can just forget all of it. You also need to know at what speed the device communicates, number of bits, parity and number of stop-bits.

If you are lucky you can use a terminal to communicate with it, then you can fire up your favorite terminal program and send commands to it and test those before trying to program anything.



/Johan Bengtsson

Do you need education in the area of automation?
----------------------------------------
P&L, Innovation in training
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------
 
Top