Hacker News new | ask | show | jobs
by synx508 4875 days ago
The schematic may be incorrect, as it seems unlikely that the relay would energise in an emitter follower configuration, where it'd have approximately 2.6 volts across its coil in the "on" state. Perhaps the relay should be between 5v and the collector of the transistor. Some relays are sensitive enough, though, so I'm not sure.
2 comments

I agree. If you look at the close up photograph of the final board (http://blog.davidsingleton.org/static/proto.png) it looks like he's got the following:

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 schematic is wrong, the relay and diode should be moved to be 'on top' of the transistor. But the circuit on the perfboard looks correct.

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.

Thanks for pointing this out, folks - I made a mistake in the original circuit diagram. It's now fixed.