Why do we connect a resistor before a Zener diode?
Rather than going to 'no resistor' consider what happens if we just use resistors of different (lower) values and look at the pattern. As we reduce the resistor value the current through the zener will rise. Even if the voltage source is not perfect the power dissipated by the zener will cause it to fail due to overheating.
The current through the resistor is, by KVL and Ohm's law:
\$\dfrac{V_{IN} - V_Z}{R_S}\$
This is the maximum current through the zener diode and so, \$R_S\$ is chosen to limit the current through the diode to some value such that the maximum power dissipated by the diode is below the maximum power rating.
For example, if the Zener is 12V, 1W device, we would want the maximum zener current to be less than \$\dfrac{1}{12}A \$.
From a comment to another answer:
can we select any zener at a voltage, without looking at the maximum current?
The point of Jim's answer, and mine, is to emphasize the power dissipation associated with the zener diode.
Since our answers are evidently not sufficient in this regard, consider the following excerpt from a zener diode data sheet:
Note the first entry is the absolute maximum power dissipation. In this case, \$P_D = 500mW\$.
So, if you pick a zener diode from this family with a zener voltage of \$V_Z \$, you must pick a resistor to limit the maximum current to be (perhaps considerably) less than:
\$I_{Z_{max}} < \dfrac{P_D}{V_Z}\$
For example, if you pick the 1N5231B with a nominal \$V_Z = 5.1V\$, you must choose a resistor such that
\$I_{Z_{max}} < \dfrac{0.5W}{5.1V} = 98 mA \$
Neither a power supply nor a Zener diode is ideal. A power supply has a very low output impedance and a Zener diode has a non-zero impedance. Without a series resistor this means:
- The Zener diode current will be very high
- The voltage across the Zener diode will be higher than specified due to its internal resistance
- Due to the large current that may flow the power dissipation, (\$P_{dissipated}=V_{zener}×I_{zener}\$), will be huge. Your average Zener diode will have a 400 mW or 500 mW power rating.