Why do something manually, which can happen automatically?When entering the kitchen, for example, we want the light to turn on automatically, and as long as we are in the kitchen, it is on. When we leave the kitchen, the light should turn off after a while.This can be solved by…