I wouldn't have any Relays on the PICs 5v Rail if I could possibly avoid it.
Have a 12v Relay on the 12v line if you have one available, use any medium power NPN Transistor (Emitter to 0v, Collector to Relay). The other end of the Relay is connected to +12. Drive the Transistor Base from the PIC's I/O via a suitable current limiting Resistor (value depends on selected Transistor). You will still need a Diode reverse connected across the Relay coil (Kathode to +12, Anode to Transistor Collector).
If you are driving multiple Relays, it's less hassle to put in something like a ULN2004. No Resistors needed, you can connect it directly to your PIC, and the suppression Diodes are built-in.
If you are using ADC or Comparators, and if you are using the 5v rail as VRef, put NOTHING on your PICs 5v line that will unnecessarily load it, spike it, or in any way abuse it - and a Power Relay will.
Bookmarks