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.

[SOLVED] Unable to drive a motor through relay .

Status
Not open for further replies.

deeplearns

Member level 4
Joined
May 19, 2011
Messages
75
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,939
Hi Friends ,

I have been trying to drive a motor through a Relay using ULN2803 , as current amplifier using micrcontroller AT89C51 for the relay but the ckt does not work when tried to simulate in Proteus .
Can someone please help I am newbie .

I have just setup a simple delay program so that the uln2803 gets i/p for a while which should ideally drive the relay but nothing happens .
I also tried to switch the motor with a lamp (12 v i/p ) and tried several things does not work at all .

Please help .

Following is the C program i am using for the uc ...

#include<reg51.h>
sbit latch = P2^0;
void msdelay()
{

unsigned int x,y;
for(x=0;x<3300;x++);
for(y=0;y<3300;y++);

}

void main()
{
while(1)
{
latch=~latch;
msdelay();
}

}



 

Here's an example using a ULN200XA Series driving a relay:

 
I have given 12 volt to the pin 10 and the pin 9 is grounded and is hidden . and asper the quote by bigdogguru i could not find the example he is referring to .

---------- Post added at 01:00 ---------- Previous post was at 00:32 ----------

Here's an example using a ULN200XA Series driving a relay:




could not find the example
 

did you check the waveform on the pin 2.0 ??
And the delay you have put is too small in realtime. So, try increasing the delay...
 

Do you see the output pin change between high and load at the output pin of the mcu?
use larger delay, it will help you observe the output.
A pull-up has to be used, if you didn't enable the internal pull-up resistor then add an external one.
Disconnect the ULM2003 input from the mcu and connect it to a LOGICSTATE (you can find it in the add components screen, debbuging tools category), change the input to 1 and see if the output works.
Check if your relay is 5v (G2R-14-DC5).
Check if the voltage is set to all voltage sources (default is 0v)

Alex
 
thanks dhaval i will try to check the waveform .. i will have to find the option in the appto do it .. as i am new to proteus .

---------- Post added at 12:57 ---------- Previous post was at 12:51 ----------

Hi Alex
I dont think a pull up is required for 89c51 as I am connecting to port 2 (from mazidi i have learnt that pull-up is required for Port 1 ) ..
Also i have searching for the Logicstate option in Proteus right from morning ...you really made me happy by mentioning the option that will help a lot ..

Also when I run the simulation ...i see that the uln i/p goes red when port2.0 i/p goes sends a high or maybe low ..but the uln o/p does not go high at that point so that the relay works ..
Could it be anything related to the amount of current required to run the relay is not provided by the ULN ...any specific relay i can choose from the category in proteus ..could name it please .
 

practically you have to put pull up for all the port pins... not only for port0... thats a good hardware design practise to use pull up for all port pins for a simple reason , the faulty internal pullups cannot be identified...
 

Can someone tell where I can get a decent tutorial for Proteus .. i cant find what i am looking for in it .
 

Hi Alex
I dont think a pull up is required for 89c51 as I am connecting to port 2 (from mazidi i have learnt that pull-up is required for Port 1 ) ..
Also i have searching for the Logicstate option in Proteus right from morning ...you really made me happy by mentioning the option that will help a lot ..

I don't agree with that, all the outputs of your mcu are open drain/collector, unless you use a pull-up the current of high state is extremely low.
The datasheet says that for ports 1,2,3,4 and Vcc=5v if you source 60uA the output drops to 2.4V.

Your ULN is connected correctly, I don't see a problem there

Alex
 

Hi People ,
I was finally able to drive the motor using the ULN and the relay .The Logictstate option helped me to try various possibilities to solve the problem and it was actually voltage required to drive the motor to be selected correctly .
Thanks for all the help provided .
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top