View previous topic :: View next topic |
Author |
Message |
Einly
Joined: 10 Sep 2003 Posts: 60
|
Not enough power to trigger all relays |
Posted: Tue Jul 06, 2004 1:52 am |
|
|
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
|
|
Posted: Tue Jul 06, 2004 2:04 am |
|
|
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
|
|
Posted: Tue Jul 06, 2004 2:30 am |
|
|
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: 1935 Location: Norman, OK
|
Driving relays |
Posted: Tue Jul 06, 2004 5:58 am |
|
|
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 |
|
|
|