Transistor and relay circuits