The generation of coordinated body movements relies on sensory feedback from mechanosensitive proprioceptors. We have found that the proper function of NompC, a putative mechanosensitive TRP channel, is not only required for fly locomotion, but also crucial for larval crawling. Calcium imaging revealed that NompC is required for the activation of two subtypes of sensory neurons during peristaltic muscle contractions. Having isolated a full-length nompC cDNA with a protein coding sequence larger than previously predicted, we demonstrate its function by rescuing locomotion defects in nompC mutants, and further show that antibodies against the extended C terminus recognize NompC in chordotonal ciliary tips. Moreover, we show that the ankyrin repeats in NompC are required for proper localization and function of NompC in vivo and are required for association of NompC with microtubules. Taken together, our findings suggest that NompC mediates proprioception in locomotion and support its role as a mechanosensitive channel.