5. Two vectors $O A$ and $O B$ on a plane satisfy $|O A|=a, |O B|=b$, and $a^{2}+b^{2}=4, O A \cdot O B$ $=0$. If the vector $O C=\lambda O A+\mu O B(\lambda, \mu \in \mathbf{R})$, and $\left(\lambda-\frac{1}{2}\right)^{2} a^{2}+\left(\mu-\frac{1}{2}\right)^{2} b^{2}=1$, then the maximum value of $\mid O C$ is ( ).
(A) $\frac{1}{2}$
(B) 1
(C) 2
(D) 4
5.C.

Since $|O A|=a,|O B|=b$, and $a^{2}+b^{2}=4, O A \perp O B$, therefore, points $O, A, B$ lie on a circle with the midpoint $M$ of $A B$ as the center and 1 as the radius.
Also, $O M=\frac{1}{2}(O A+O B), O C=\lambda O A+\mu O B$, then $M C=O C-O M=\left(\lambda-\frac{1}{2}\right) O A+\left(\mu-\frac{1}{2}\right) O B$. Hence, $|M C|^{2}=\left(\lambda-\frac{1}{2}\right)^{2} O A^{2}+2\left(\lambda-\frac{1}{2}\right)\left(\mu-\frac{1}{2}\right) \cdot O A \cdot O B +\left(\mu-\frac{1}{2}\right)^{2} O B^{2}$ $=\left(\lambda-\frac{1}{2}\right)^{2} a^{2}+\left(\mu-\frac{1}{2}\right)^{2} b^{2}=1$.
Thus, point $C$ also lies on the circle with $M$ as the center and 1 as the radius. Therefore, points $O, A, B, C$ are concyclic, with $M$ as the center.
When $O, M, C$ are collinear, i.e., $O C$ is a diameter of $\odot M$, $|O C|_{\max }=2$.