Skip to content
PlayOwl
Money, shops & services · #496

How do hotel key cards open the correct door?

The front desk writes a room and an end time on your card. The lock reads it and asks two questions.

The big idea: A key card holds a room number and an end time. The lock opens only if the room matches and the time has not run out.

Start exploring
0 of 5 parts done
A hand holds a blue key card up to a hotel door lock, and the lock's light turns green, How Things Work poster
1Watch it

From the front desk to your door

  1. At the hotel, the front desk hands you a plain plastic card instead of a metal key. How can a flat card open your door, and nobody else's?
  2. First the desk puts the card on a writer. It saves two things in the card's tiny chip: your room number, and the time your stay ends.
  3. Hold the card near the lock. The lock sends out radio waves that wake up the chip, and the chip answers with its room number and end time.
  4. The lock asks two questions. Is this card for my room? Is there still time left? Both answers are yes, so the light turns green and a tiny motor unlocks the door.
  5. At the door next to yours, the first answer is no. The card says room 12, but this lock is room 13. Red light: the door stays locked.
  6. When your stay ends, the second answer becomes no. The room is right, but the time is up. The card stops working by itself, and the next guest gets a fresh one.
2Look inside

Inside a key card and a door lock

Tap each part of the card and the lock. Watch what it does when you find it.

  • Card chip. A chip smaller than a grain of rice is hidden in the card. It stores the room number and the time the stay ends.
  • Card antenna. A flat coil of very thin wire runs around the inside of the card. It catches radio waves from the lock and uses them to wake up the chip.
  • Reader. The reader is the lock's ear. It sends out radio waves, and when a card comes close it listens to what the chip says back.
  • Lock computer. A tiny computer in the lock knows its own room number. It checks the card: right room? Still in time? It needs both to be yes.
  • Lock clock. The lock has its own clock. It compares the time now with the end time on the card. After the end time, the card is refused.
  • Motor and latch. When the card passes, a tiny motor turns for a moment and frees the latch. Now pressing the handle pulls the latch back and the door opens.
  • Batteries. The lock runs on ordinary batteries hidden inside the door. No wires go to it, so it still works if the hotel's power goes out.
  • Signal light. A small light tells you the answer. Green means the card passed and the door is unlocked. Red means the lock said no.
3Try it

Write a card and test it

Choose the room and the checkout day for the card. Drag the card to a door, or tap a door. Then move the clock forward and try again.

Experiment: The card opens room 12 today. What happens at the same door after the checkout time has passed?

  1. Write the card for room 12 and try it on all three doors.
  2. Slide the clock forward past the checkout day.
  3. Try room 12 again. Watch the two check marks above the lock.

What we found: The lock needs two yes answers. The right room is not enough: once the end time has passed, the time check fails and the door stays locked.

Turn on JavaScript to try it yourself.

4Solve a challenge

Run the front desk

Read each guest's booking. Write a card for the right room that works until checkout, and not after it.

5Go deeper

How a lock decides

A hotel key card looks blank, but it carries a tiny note that you cannot see. When you check in, the front desk puts the card on a small machine called an encoder. The encoder saves your room number and the time your stay ends inside a chip in the card.

The lock on your door has a reader. The reader sends out weak radio waves, a bit like a very quiet radio station that only reaches a few centimeters. When your card comes close, a coil of wire in the card catches those waves and turns them into just enough electricity to wake up the chip. That is why the card never needs a battery.

The chip then tells the lock its note. A little computer in the lock asks two questions: is this card for my room, and is there still time left? Only if both answers are yes does a tiny motor free the latch so the handle works. If either answer is no, the light turns red.

This is clever because nothing has to be collected or switched off. When your stay ends, the card simply stops working. The hotel can wipe it and write a new note on it for the next guest. Our model is simple, though. Real cards also scramble their notes with secret codes so that nobody can make a copy at home.

Key words

Permission
A rule that says what you are allowed to open, and until when.
Encoder
The machine at the front desk that writes the room and time into a card.
Reader
The part of the lock that talks to the card with radio waves.
Induction
Making electricity flow in a coil of wire by putting it in a changing magnetic field.
Expire
To stop working when a set time is reached.

Check your thinking

  1. What two things does the lock check on a card?

    Show the answer

    The room number and the end time. The lock asks: right room? Still in time? Both must be yes.

  2. It is the day after checkout. You try your old card on your old room. What happens?

    Show the answer

    Red light: the time is up, so the lock says no. The room still matches, but the end time has passed. One no is enough to keep the door locked.

  3. The card has no battery. Where does its chip get power from?

    Show the answer

    From the radio waves the lock sends out. A coil in the card catches the lock's radio waves and turns them into a little electricity.

  4. A lock is not connected to the front desk, and its clock runs three hours slow. What happens at checkout time?

    Show the answer

    The card keeps working for about three more hours. The lock trusts its own clock. If that clock is behind, it believes the end time has not yet arrived.

  5. Why does the hotel put an end time on the card instead of collecting every card?

    Show the answer

    So a lost or forgotten card stops working by itself. Cards get lost and taken home. An end time makes an old card harmless.