Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

controling 2 relay with microcontroller

Status
Not open for further replies.

Smart

Member level 4
Joined
Jan 28, 2006
Messages
72
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,841
I need complete schematic and code for a microcontroller which has a link with a pc via RS-232, and pc send a command for microcontroller to control 2 pcs of 24 volt relay.
 

it is better to specify which microcontroller you are planning to use, to send a corresponding code.
 

Please indicate what microcontroller do you intend to use and the code language.
 

avr microcontroller connection with RS-232
**broken link removed**

for relay use this circuit
**broken link removed**

Bibin John
www.bibinjohn.tk
 

I dont think anyone would do the entire thing for you, however here is some help connect PIC (i presume) to PC via DS232.
Connect 2 pins of mcu to OCTAL high side driver like 2803,
deifne logic in program to await for input 1, 2
if input is 1 make pinx(connected) to relay 1 Via 2803 as high other should be low and vice a versa.
Its very simple if you have logical thinking and concentrate a bit on what you want to achieve.
I have quoted the example for PIC mcu but logic and circuitary would remain the same for all mcus.
here is some additional help:
http://www.scienceprog.com/drive-relay-with-avr-microcontroller/#article
 

what are you trying to do Nomad?
paraphrasing Pouchito's sentence to get points?
 

dear,
this is a code interfacing 8952 to serial port of pc
Code:
#INCLUDE "8051EQU.INC"
; RESET                         ;reset routine
   .ORG   0H                    ;locate routine at 00H
    AJMP   START                ;jump to START 
;
;**************************************************************************
;
; INTERRUPTS  (not used)        ;place interrupt routines at appropriate
                                ;memory locations
   .ORG   03H                   ;external interrupt 0
    RETI
   .ORG   0BH                   ;timer 0 interrupt
    RETI
   .ORG   13H                   ;external interrupt 1
    RETI
   .ORG   1BH                   ;timer 1 interrupt
    RETI
   .ORG   23H                   ;serial port interrupt
    RETI
   .ORG   25H                   ;locate beginning of rest of program
;
;**************************************************************************
;
INITIALIZE:                     ;set up control registers
;
    MOV   TCON,#00H
    MOV   TMOD,#00H
    MOV   PSW,#00H             
    MOV   IE,#00H               ;disable interrupts
    MOV   P1,#0FCH
    
    RET
;**************************************************************************
;
START:                          ;main program (on power up, program starts at this point)
   ACALL INITIALIZE             ;set up control registers 
	MOV TMOD,#20H
	MOV TCON,#41H
	MOV TH1,#0FDH
	MOV SCON,#50H
	ACALL DELAY1S

   CLR TI
   MOV SBUF,#'1'
   JNB TI,$
   CLR TI
   MOV SBUF,#'2'
   JNB TI,$

   CLR TI
   MOV SBUF,#'3'
   JNB TI,$
   CLR TI
end.

use uln 2003 to interface relays with mc
don't foget to add diode (inverse polarity) paraller with relay coil
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top