Calculating base resistor - PN2222
Let's say the model for your LED is \$V_{fwd}=1.56\:\textrm{V}+20\:\Omega\cdot I\$ and the schematic is as follows:







simulate this circuit &ndash; Schematic created using CircuitLab

Then I compute:

$$I_B=\frac{5\:\textrm{V}-V_{LED}-V_{BE}}{R_2+\left(\beta+1\right)\cdot R_1}\approx 150\:\mu\textrm{A}$$

From that (and \$\beta\approx 200\$) I would get that \$V_B\approx 4.5\:\textrm{V}\$ and \$V_E\$ about \$800\:\textrm{mV}\$ less, or about \$V_E\approx 3.7\:\textrm{V}\$. The LED drop isn't yet certain but let's say it's another \$2.4\:\textrm{V}\$ for now. This means \$1.3\:\textrm{V}\$ across \$R_1=47\:\Omega\$. Or about \$28\:\textrm{mA}\$.

Which isn't far from what you got. Given that lower current and the assumed model I laid out at the top, I'd refine my estimate of \$V_{LED}\approx 2.1\:\textrm{V}\$. This would add another \$300\:\textrm{mV}\$ across \$R_1\$ and add another \$6\:\textrm{mA}\$ to make it \$34\:\textrm{mA}\$. Putting that back in, I'd then get \$V_{LED}=2.2\:\textrm{V}\$, losing \$100\:\textrm{mV}\$ across \$R_1\$, dropping the current to \$32\:\textrm{mA}\$ as a still further refinement. (I could do that several times more to nail it down.) But my model was just made up from your single set of values for it in your question and I've no idea if it is very accurate. The main point here is that you should NOT be surprised.

But the above circuit isn't the way most people try and do this. And it's not how you'll see web sites laying it out, either.