All seats in public areas are typically uniform in height; however, individuals differ in stature. When a seat is elevated, a child may find it challenging to access, whereas a low seat could cause discomfort for a taller individual. The optimal proportion is that the chair’s seat height should be approximately 25% of your total height.

What if there existed a seat that could adapt to the varying heights of people?
To achieve this goal, the first step involves measuring an individual’s height. For this task, an ultrasonic distance sensor has been employed. Subsequently, the seat must be adjusted. This adjustment is facilitated by a servo motor. To ensure that the seat remains stable while a person is seated, a simple button is utilized. When the button is pressed, it secures the position, and upon release, the seat is free to readjust once more.

For the software component, we will configure the ultrasonic sensor to function as an input and observe the distances obtained.
Subsequently, we will incorporate the servo, designate it as an output, and correlate it with the distances measured by the ultrasonic sensor. Lastly, we will add the button, configure it to serve both as an input and an output, and program it so that when pressed, it maintains its position, and when released, it allows readjustment.

A similar reasoning can be utilized for various elements that rely on individuals’ height. Examples of such elements include stairs, shelves, and tables.