Ajan:
My friend Tom suggested this about using voltage dividers:
"I thought about that, but when you're not driving the pin, it'll be at 9V, so you might blow up the ATmega chip."
Your friend is correct perhaps he can explain.
As asked post a diagram of your idea and we can say why its wrong.