Nanomechanical sensors typically consist of nanoresonators or microcantilevers. These components vibrate at specific frequencies. When a target molecule or particle interacts with the sensor, it causes a change in the vibration frequency or amplitude. This change is then measured and analyzed to determine the properties of the target.