← All articles

7 November 2026

The Automatic Door: How a PIR Sensor and a Servo Open It When You Arrive

Illustration of an automatic door: the PIR sensor spots a person and the servo opens the door

Has your child ever walked up to a supermarket door and watched it open all by itself? Nobody is standing there pressing a button, there is no handle to pull — the door just seems to know they are coming. Many kids think the door is magic, or that someone is hiding somewhere controlling it. The truth is more interesting: an automatic door is a small robot, and it works with two parts your child could build with in a single afternoon — a PIR sensor to "see" people, and a servo motor to swing the door open.

To understand an automatic door, split it into two questions. How does the door know someone is coming? And how does it open? The first answer is the PIR sensor. The second answer is the servo. The two parts talk to each other through a small brain called an Arduino — and together the three make a complete system: sense, decide, then act.

The PIR sensor "sees" people by their heat

PIR stands for Passive Infrared. Every warm object gives off infrared light that human eyes cannot see, and your child's body is one of them. Inside a PIR sensor is a small window divided into sections. When a warm object moves across it, the amount of infrared in each section changes again and again, and the sensor understands: something warm is moving. At that moment it switches on a signal to the Arduino.

The word "passive" matters: a PIR sensor sends out nothing at all. It just sits still and listens to the heat around it. It does not know who your child is, it takes no photo, it records no sound — it only knows that a warm object just moved through its view. That view is usually about 110 degrees wide and a few metres deep, enough to cover a whole walkway in front of a door.

But PIR has one weakness kids love discovering: it only notices change. If your child stands perfectly still in front of the sensor long enough, it will "forget" they are there. That is why a hallway light switches off while your child sits reading without moving, and why a supermarket door sometimes fails to open if someone stands motionless for too long. Engineers work around this by placing the sensor where people are always moving, or by pairing it with a second kind of sensor to cover the weakness.

The servo: a motor that turns to exactly the right angle

Once the door knows someone is there, how does it open? With a servo motor. A servo is a special kind of motor: instead of spinning round and round like an ordinary motor, it turns to exactly the angle you command — usually somewhere between 0 and 180 degrees — then stops and holds that position.

Inside a servo are three things: a small motor, a gearbox that trades speed for strength, and a position sensor that checks its own angle. Command it to turn 90 degrees and the shaft turns exactly 90 degrees. Command it back to 0 and it returns to exactly 0. Precise to the degree, with nobody standing watch.

In an automatic door, the servo connects to the door panel through a lever arm. The servo turns 90 degrees, the arm pushes the door open. Want the door wider? Command a bigger angle. Want it closed? Command it back to its starting angle. The whole movement of a heavy door panel is really just one small turn of a servo — and that is why engineers love servos for doors: driving a door becomes as simple as commanding a number.

How the three parts work together

Follow the signal from start to finish. The PIR sensor spots a person walking up and sends a signal to the Arduino. The Arduino receives it and tells the servo to turn 90 degrees, and the door opens. The Arduino counts about three seconds, then checks whether anyone is still at the door. If nobody is there, it tells the servo to turn back to 0 degrees, and the door closes. This loop repeats hundreds of times a day, without getting tired, forgetting, or needing a reminder.

An Arduino can also make the door smarter than just open and close. It can open slowly at first and then faster, giving older people and pushchairs extra time. It can hold the door open longer at busy hours and close it faster when it is quiet. And most importantly: if the PIR still sees someone standing right in the doorway, the Arduino will never command it to close — that safety rule is written straight into the code, so the door cannot trap anyone.

This is the pattern behind every robot: a sensor gathers information, a brain decides, and a motor acts. The automatic door, the obstacle-avoiding robot, the hallway light that switches itself on — all the same recipe, just different parts.

The automatic door and its relatives around your home

Supermarkets and hospitals are the easiest places to spot an automatic door, but its relatives are everywhere. The tap that runs by itself in a public restroom uses an infrared sensor like a PIR. The hallway light that switches on as your child walks past uses exactly this kind of sensor. A bin that opens its own lid is an automatic door in miniature: the PIR spots a hand, the servo lifts the lid.

Even a lift uses the same idea: a row of infrared beams crosses the doorway, and if a person or an object is in the way, the doors will not close. Next time you go shopping together, ask your child to look closely: where is the sensor above the door? Which way does it point? And how long does the door stay open before closing? Just by watching carefully, your child can read a whole working robot system.

Three games that teach how an automatic door works

  1. The "stand still and disappear" game: stand together in front of a motion-sensing light — a hallway or garden light will do. Switch it on by walking up, then stand perfectly still. Count how long it takes for the light to switch off. Your child will prove it with their own body: PIR only detects change, not presence.
  2. The "cardboard door" game: cut a small door from cardboard and attach it to a box with a pin as a hinge. One person plays the servo: they may only turn the door to exactly the angle the other person calls out — "turn 90 degrees", "back to 0 degrees". Another person plays the PIR sensor: they may only shout "person!" when they see someone walk up. Three roles — sensor, brain, motor — make a whole automatic door out of real people.
  3. The "door programmer" game: your child writes the door's steps in words, using exactly the structure an Arduino uses: IF you see a person THEN open the door. WAIT three seconds. IF you see nobody THEN close the door. IF you still see a person THEN keep the door open. Once written, try "running" that program out loud for a day: every time someone walks through a door at home, your child reads out the next step. That is exactly how a programmer thinks before writing a single line of code.

How your child learns this on ManuStem

On stem.manusignal.com, your child connects a PIR sensor and a servo into a circuit right in the browser — no kit to buy, no delivery to wait for. The 3D view shows the sensor spotting a person, the servo turning to exactly the right angle, and the door opening before their eyes. If the wiring is wrong or the code doesn't run, the AI coach points out the mistake and suggests a fix in Vietnamese or English, like a teacher sitting beside them.

The course has 28 lessons — 8 in the Component Lab and 20 in the Competition Robot track — for kids aged 8 and up, taught in Vietnamese and English, with 4 free trial lessons. The PIR sensor and the servo are just two of the components your child will get their hands on: after that come the ultrasonic sensor, the rain sensor, the stepper motor, and even programming a competition robot in C++ on the ESP32 kit for ages 13 and up.

An automatic door has no magic in it — just a sensor that knows how to listen, a motor that knows how to obey, and a small brain connecting the two. Let your child build a door that opens when someone arrives.


Let your child build an automatic door today — no kit needed, 4 free trial lessons at stem.manusignal.com.

Read the Vietnamese version:

Cửa tự động: cảm biến PIR và servo mở cửa như thế nào khi có người đến