How to detect an item on ground?

You miscapitalized OnGround as onGround.

Correct:

{OnGround:1b}