Maximum length?

This is a question it is impossible to answer, and without any real details of what sensor you are using it is impossible to even guess.