Electronic – Choosing a relay, suppression diode and transistor for switching car power from a PIC pin

diodespicrelay

Here is my circuit that's hopefully going to be a custom timer circuit.
It has two inputs (ignition wire and headlamp wire), it has one output that will be used to switch a relay.

simple PIC timer with two inputs and one output to relay
nb. "D31A*" is a Frizting part for a relay that's the closest I could find.

D1 is a suppression diode to protect the transistor from transient voltage
when the coil switches.
I'm somewhat confident it's wired the correct way, with the diode cathode
connecting to the positive side of the coil.

The PIC pin is wired in series to a 10K ohm 1/4 watt resistor to the base of
a transistor.

I have chosen BC547 for the transistor, because I have some spares,
and the circuit works on my breadboad. I had tried with 2n4401's but the
Collector/Emitter continues to conduct after the Base is pulled low,
which I found a bit strange and could find no mention of in the datasheet.
Perhaps something else is causing it?

The relay I like at the moment is this one:
http://www.rapidonline.com/pdf/60-1910.pdf
This has spade/blade terminals on the bottom and suits my environment.

Relay Partnum: IMO SRZ-1AT DL 12VDC
Relay Datasheet: http://www.rapidonline.com/pdf/60-1910.pdf

The datasheet indicates the relay is avaialble with a diode built in, but
I've been unable to find one and think it may be special-order only.

The load the relay needs to switch is 12V @ 1.5A continuous, 3A peaks. I'm using unregulated vehicle power into the positive side of the coil, is this okay? I had considered solid state relays but they're really expensive! Might one be suitable for this or is a 1.5A continuous with 3A peak too much?

*The device I'm switching on and off with the relay can handle unregulated vehicle power already.

  • What suppression/rectifier diode should I use? How do I know?
  • Is a BC547 okay to go between PIC pin and relay coil -ve side?
  • Is 10k the right resistor value for the transistor? How do I know?
  • Is the relay I'm favouring a good choice for my simple switching example?

Update – New schematic following a telling-off from Olin 🙂

eagle schematic for simple PIC timer

Best Answer

Comments on your schematic and circuit:

  1. A 7805 is not designed to handle the full range of car power, including short high voltage bursts. This has been mentioned to you before. See previous answers for details.

  2. You have D1 the right way around, but I would make it a Schottky. Those react faster and will be fine for these relatively low voltages.

  3. Fix the schematic to be less of a ratsnest. Traces worming their way all over the place makes it hard to read. See https://electronics.stackexchange.com/a/28255/4512 for details.

  4. Fix the schematic to add part values! You seem to have mentioned some of them in the text, but I'm not going to remember everything you said when looking over the schematic. Do it right, especially since you are asking others to look at it.

Without part values, it is difficult to critique anything but the overall topology. That seems OK, within the detail provided by the schematic.

Added after schematic cleaned up:

That's a lot better. It looks basically OK.

I didn't look up the maximum input voltage of the LM2576. Check that it can handle car power glitches.

The 12 V sense lines driving the PIC inputs look fine.

Check that the BC547 can support the relay coil current with a 10 kΩ base resistor driven to 5V. That should provide about 430 µA base current. If the minimum guaranteed gain of the transistor is 50, for example, then this can support up to 21 mA collector current. That's cutting it close if the relay needs 20 mA, and of course is insufficient if it needs more.