by synx508 · 13y ago · 0 comments
Relay connected to 5v with the diode across the coil. The base of the transistor goes to pin 18 via a resistor. The transistor is on the other side of the relay between it and ground.
That makes more sense to me because the diode is now actually protecting the Raspberry Pi 5V line.
The diode goes across the relay coil because when the relay coil is turned off, there will be an inductive spike generated. The diode protects the transistor.