The deal for the 28-year-old, who left Kilmarnock at the end of last season, includes an option to extend it until the end of the season and is subject to Scottish Football Association clearance.
Motherwell manager Stephen Robinson told his club's website: "We're delighted to add a player of Stephen's experience.
"He will give us greater options in both full-back areas, especially at a time where we are lighter on numbers due to injuries.
"He's an international-level defender who will bring a lot to our squad."
O'Donnell, who has won 11 caps for Scotland, said he was "delighted" to join.
He added: "It's a deal that suits everyone involved. Obviously there's a few injuries and so the manager was looking for someone.
"When he came to me, I was delighted to sign up.
"I am a local boy, so it's a great fit for me. And obviously, the chance to have another crack at Europe was a big factor.
"I feel I've a lot to prove at that level and to get that chance is important, especially with Scotland games on the horizon too.
"But first, I want to get playing games and help the team."