Following the stipulated time of 5 seconds. The raspberry pico would deliver the signal once again to your servo motor to shut the lid. By doing this the motor will immediately open up and shut the lid from the dustbin. On the list of alternatives for this issue is by https://lorenzonxpdt.blogrelation.com/17147166/smart-dustbin-secrets