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.
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 :)