Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 23rd March 2004, 11:59 PM   (permalink)
Default need a circuit for control a relay on/off from a PC RS232

I want to connect a relay to a PC RS232 (serial) port, than use programming control this on or off. I test the serial port pin 3 voltage allway in high level when I set it low in program. I found some information from internet that the serail port need a interface for its external devices.

Please if you know how is this interface circuit, show me the circuit. simple is the best. for control a LED or a relay.

Thank you all.
kingsz1 is offline  
Old 28th March 2004, 07:23 AM   (permalink)
Default any friend can help me

any advice or link can help me? please.
kingsz1 is offline  
Old 28th March 2004, 11:26 AM   (permalink)
Default

I would do it with a PIC, but there are many different ways. You could use an old UART, I seem to remember the 6402 was one?, or you could use the handshake lines to feed a relay via a simple driver.

Personally I would advise a PIC solution, where you could easily (and more reliably) control the switching on and off of the relay - either by simple characters, or even text strings.

My RS232 PIC tutorials show how to do this with LED's, you would just need to replace the LED's with transistor drivers feeding relays.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 29th March 2004, 10:59 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
My RS232 PIC tutorials show how to do this with LED's, you would just need to replace the LED's with transistor drivers feeding relays.
Thank you Nigel. Are you means this link:
http://www.winpicprog.co.uk/pic_tuto...s232_board.htm

or other link? can you post it, please.

I really want to know seperate a bit state, e.g. bit0 is on or off, from the serial bits(start bit, bit0-bit7, stop bits, etc.)
kingsz1 is offline  
Old 29th March 2004, 11:49 AM   (permalink)
Default

Quote:
Originally Posted by kingsz1
Thank you Nigel. Are you means this link:
http://www.winpicprog.co.uk/pic_tuto...s232_board.htm
Yes, you would need that circuit, plus a processor board, then a relay driver board (I haven't done one yet, but it's very trivial) - obviously for a complete project you would build it on a single board.

Quote:
I really want to know seperate a bit state, e.g. bit0 is on or off, from the serial bits(start bit, bit0-bit7, stop bits, etc.)
One of the tutorials does just that, using the LED board - it lights 8 LED's, one for each bit of the byte received. All you need to do is replace the LED with a driver transistor and relay.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 31st March 2004, 01:06 AM   (permalink)
Default

Thank you. Nigel.
I found a link http://www.rentron.com/pc-relay.htm "Building a Basic Stamp I & PC Relay Controller". But I cannot find a Basic Stamp I from local shop. I has the 2051, 16F84 on hand. how can I use these microcontroller to control the relay? also how is the programming code for the microcontroller?

I need your help. Have a nice day.
kingsz1 is offline  
Old 31st March 2004, 09:25 AM   (permalink)
Default

Quote:
Originally Posted by kingsz1
I has the 2051, 16F84 on hand. how can I use these microcontroller to control the relay? also how is the programming code for the microcontroller?
The 16F84 is the older version of the 16F628, and (to some extent) is compatible - the 16F628 code in my tutorials can be used with only very slight modifications.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 12th August 2004, 09:44 PM   (permalink)
Default

nigel code on your tut how can i get it to turn led on form pc would like to send serial data to pic and have it turn led on /led off . have pc program that can send data to port how do i get pic to take data (eg . somthing like b30 have it turn led off or b31 turn led on
eugene2021 is offline  
Old 12th August 2004, 10:13 PM   (permalink)
Default

Quote:
Originally Posted by eugene2021
nigel code on your tut how can i get it to turn led on form pc would like to send serial data to pic and have it turn led on /led off . have pc program that can send data to port how do i get pic to take data (eg . somthing like b30 have it turn led off or b31 turn led on
Tutorial 7.5 will do pretty well what you need, just select two ASCII characters which have the required bit as a '1' and a '0', the first character will turn the LED ON, and the second will turn it OFF.

If you want to use multicharacter strings (as in your example) you would need to buffer the strings and then check what they were.

If you want to do something like that you might try looking at Dontronics PICEX software, which although very old now is free and very versatile, have a look at http://www.dontronics.com/picex.html.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 13th August 2004, 11:52 AM   (permalink)
Default

If you only need 1 or 2 relays you can use the handshaking lines of the rs232 port. You can simply set them or clear them in software, no pic needed, just a transistor and a diode to drive the relay.
Exo is offline  
Old 16th August 2004, 03:35 PM   (permalink)
Default

want to use 8ch for relays do not need to recieve anything just want to turn relays on and off
eugene2021 is offline  
Old 16th August 2004, 11:23 PM   (permalink)
Default

If you want 8 channels from the serial port then you'll have to receive a byte from the uart. Simplest way is with a pic, if you don't have any pic expierience and don't want to get involved in it then i suggest you use the parallel port.
Exo is offline  
Old 17th August 2004, 04:19 AM   (permalink)
Default

A Solid State Relay may also also be adviseable as you can trigger them easly with low voltage and low amperage with theres no click noises every time like standard relays.
Captain Zap is offline  
Old 25th August 2004, 10:51 PM   (permalink)
Default

IN Tutorial 7.5 what character do i send to pic from pc to turn on led 1
eugene2021 is offline  
Old 26th August 2004, 12:12 AM   (permalink)
Default

Quote:
Originally Posted by eugene2021
IN Tutorial 7.5 what character do i send to pic from pc to turn on led 1
You need to send Chr$(1) (in BASIC) the character that has the ASCII value of 1.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 10:06 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker