Grounds, released by the Latics at the end of last season, has put pen to paper on a two-year deal and becomes Blues boss Lee Clark's first summer acquisition.
The 26-year-old plays predominantly as a left-back but can also stand-in at centre-half if required.
Clark said: "I am delighted to welcome Jonathan to the club and he is somebody who both myself and (chief scout) Malcolm Crosby know a lot about from his time at Middlesbrough.
"Jonathan's versatility will be important for us. We conceded far too many goals last season so it was key that we strengthened our defence and Jonathan will help us to do that.
"He has a lot of experience and I can see in his eyes that he has that hunger as he was always determined to get back playing in the Championship."
Grounds, who was born in North Yorkshire, began his career at Middlesbrough and came through their academy system.
During his five-year professional spell with Boro he undertook loan spells at Norwich, Hibernian, Chesterfield and Yeovil.
In 2012 he joined Oldham and made 106 appearances for the club, scoring three goals.