Gate sensor