A flexible circuit of a surgical instrument includes a rigid section and a flexible section. The rigid section is configured to mechanically interlock with a component of the surgical instrument and has at least one of the following mounted thereon: (1) a processing device and (2) a logic element. The flexible section is aligned with one of the following: (1) an active bending portion of a shaft assembly of the surgical instrument and (2) an articulation joint of the shaft assembly.