When you have a mess of wires running from one sensor or board to another, it can become frustrating when the stop working. When they move back and forth the wired connections start to break and the solder doesn't connect the terminals anymore. I have found it very useful to place crimp connectors on the ends of all the wires and the plug them into each board. This keeps all your wire connection neat and organized, and strong and sturdy.
Folding the crimp on the wire can be tricky at times, but after doing it a few times you will get the hand of it. The crimps i usually use have two spots where they fold down onto the wire. The technique I've always followed (and had great success with) is placing the wire in far enough that the first fold goes over just the bare wire and the second fold goes over the rubber coating on the wire. This ensures that the wire will stay firmly in the connector and prevents the metal of the wire from bending and breaking easily.
Once you have all your wires on the crimps you can place them into slots in a plug. If you ever need to change a pin or switch a wire, the crimps can be removed from the slot and placed into another without having to re-do the crimp, so switching your circuit around becomes very easy. (Usually to remove the crimp consists of placing a small screw driver in a slot and pressing down on a pin. You can see in the fourth image the pin coming down from the bottom that would catch the edge of a slot)
I have a few images here showing how the connectors come in tons of different sizes and shapes to match almost any project requirements. They are great and easy to use so I highly recommend trying them out.