Automatic gates work with the help of sensors. A sensor is a device, module, or subsystem whose purpose is to detect things or changes in its environment and send the information to the gate. There are several types of sensors that can sense a variety of things like sound, light, weight, heat, and motion.
For example, some automatic gates operate when they are irritated by weight sensors. These weight sensors are mounted on a rubber mat. When you go to the mattress, the sensors send a message to the automatic gate that they are told to open or close.
Other automatic gates operate on an optical or motion sensor. These sensors may be mounted on top, bottom or both ways of a series of automatic gates.
When these optical, reflective, loop or motion sensors feel the sense of movement in that certain area, they give the command of being opened or closed automatically to the gate. That is why when you get to a set of automatic security gates, you have to get close enough to activate the sensors and make the gate go into an opening or closing position!