CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Not enough power to trigger all relays

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Einly



Joined: 10 Sep 2003
Posts: 60

View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger ICQ Number

Not enough power to trigger all relays
PostPosted: Tue Jul 06, 2004 1:52 am     Reply with quote

Dear all,

I would like to trigger 10 relays from my Port B & Port C. I am using PIC16f876. However, the program resets everytime I tried to run it. I think that it is most probably due to the amount of current/ power that is not enough to drive all the relays. May I know how should I solve this problem?


Thanks
_________________
Einly
Gerrit



Joined: 15 Sep 2003
Posts: 58

View user's profile Send private message

PostPosted: Tue Jul 06, 2004 2:04 am     Reply with quote

Einly,

Never drive a relay direct from micro de curent is to high,
and possible return voltage can go back to the micro.

Use a driver like ULN2803 for sink driving


regards,

Gerrit
Paolino



Joined: 19 Jan 2004
Posts: 42

View user's profile Send private message

PostPosted: Tue Jul 06, 2004 2:30 am     Reply with quote

In general PIC micros can source and/or sink 25 mA per each pin. This is the reason of your trouble. Read carefully the data sheet of PIC16F876 to find out the maximum total current you can source from PIC: if your application needs to drive other external peripherals, remember to mantain the current under the top limit.

Rather than ULN2803 (which is a good solution, I agree with Gerrit) you can also consider to use bipolar transistor in saturation to drive relays. Better if they are in Darlinghton configuration. The use of transistor is good if your application needs to drive relays with different coil voltage: i.e. 5, 12 and 24 volts.

Paolo.
dyeatman



Joined: 06 Sep 2003
Posts: 1912
Location: Norman, OK

View user's profile Send private message

Driving relays
PostPosted: Tue Jul 06, 2004 5:58 am     Reply with quote

Make SURE that you have back EMF diodes across the relay coils regardless of what method you choose to drive the relays. The reverse EMF alone can and will reset the PIC.

One advantage of the ULN2803 is that it has the diodes incorporated and all you have to do is connect the common.

BTW, the ULN2803 can drive a relay at up to 50VDC.

Dave
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group