Diode / Transistor Confusion

Yes put current through a coil or, as we say inductor, by applying a voltage to it and a magnetic field builds up around the coil. Then when you remove that voltage and so remove the current their is no energy to keep up the magnetic field. So the magnetic field collapses. This collapse makes the magnetic field lines cut through the windings of the coil quite quickly and induces a large voltage ( could be several hundred volts ) in the coil. This voltage is in the opposite direction to the voltage that created the magnetic field in the first place, so the coil becomes a voltage source. The diode is their to short out this voltage and thus protect the other components in the circuit.

In addition, I'm doubly confused by why the diode is connected to the positive power on the breadboard. Isn't the middle pin on the transistor negative? If the solenoid wishes to ground on that center transister pin, why would it "ground" to the positive breadboard?

  1. The middle pin on that transistor is not negitave. When the transistor is off it is in fact at positive rail, that is +18V. This is irrelevant to your problem.

  2. Forget talking about "grounding" it is wrong, irrelevant and just confusing you. Just think of the coil suddenly becoming a 400V battery, with its negitave terminal on your +18V rail and its positive terminal on the middle pin of your transistor. It would destroy the transistor. So the diode now conducts and shorts out the coil / battery. Once the field as collapsed fully no more voltage is generated by the coil and the diode stops conducting.