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.

Atmel 89c51 Changes its programe counter while switching on and of 12v relay

Status
Not open for further replies.

digitall

Newbie level 4
Joined
May 8, 2009
Messages
7
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
Karachi, Pakistan
Activity points
1,330
Hello My dear Friends..

i am working on atmel 89c51 and i have connected couple of 12v relay throught Pc817 optocoupler to 89c51 i/o Pin but when the 89c51 starts or stops the relay its programe counter goes somewhere else on the code of the programe ...its seems like 89c51 goes mad while turning on and off the relay ..
i have tried couple of things to resolve this issue like connecting reverse diode on the coil of relay and capacitor but nothing works and all things seems perfect like voltage accross the 89c51 ect ect

Plz My friends Help me to resolve this issue

Thanks in advance....
 

Hi dear friend,

can you post your circuit. A lot of possibilities spring from your description but I would like to see your circuit first.

Is your relay switching a high voltage load such as a the AC. mains?
 

Did you try to post code and circuit, so that people can help you?


Thanks for the reply tomym

Yes actually relay is switching 220v supply for battery charger unit driving a small 1amp charging transformer...!

- - - Updated - - -

I am posting my complete project of a Electric Generator automatic system (ATS) including complete asm file and proteus simulator design

consider leds as the PC817 optical side ...

- - - Updated - - -

Main control board

Control circuit board.jpg

- - - Updated - - -

Charging circuit

Charging circuit.jpg

- - - Updated - - -

System overview

System overview.jpg
 

Attachments

  • ATS.rar
    35.4 KB · Views: 98
You can try to use a transistor drive relay
 

back emf was produced during relay energize
use a diode to cancel back emf
 

Thanks for the reply Guys ....!

Dear kvtal i have used reverse diode between the coil of relay to kill back emf and also used a capacitor but this thing not working and 89c51 still goes to hang position while turning on or off relay...! plz tell me some thing different
 

did u tried with only diode without capacitor?
 

use MAX6469 chip for regulated power ,it has in built reset(POR) also.
i think it will rectify ur problem
 

Attachments

  • MAX6469-MAX6484.pdf
    522.8 KB · Views: 73

Helloo my all friends ....thanks for the relies guys

Yahooooo my problem is solved now....
 

how u get the solution
what was the problem
 

Acutally i have used 7805 regulator For 5v regulation & i didnt add a Capacitor on the output to gnd of regulator so thats why 89c51 was changing prog counter coz the regulator gives spikes while relay switches .....

Thanks a lot all my friends for replies....! Now the problem is solved
 
Glad you've got results. Make sure you fit a bulk capacitor (10's of uF) as well as at least one high frequency capacitor (100 nF) across the regulator's output.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top