Real time numerical differentiation of signals
Your original differentiator, which should be $x(n)-x(n-1)$, is called a "first difference" differentiator. That differentiator amplifies high-frequency noise. As a next step I suggest you try what's called the "central difference" differentiator defined by:

$$ \mathit{Diff} = \frac{x(n)-x(n-2)}{2} $$

which does not amplify high-frequency noise.