The primary motivation for these things, as we sometimes say tongue in cheek, is noise abatement--midair collisions can make quite a racket. Back in the days when air traffic controllers shoved shrimp boats around on maps in response to position information relayed via telephone, radar wasn't as critical as it is today.
Radar's first use was, as with many technologies, accelerated by conflict--in this case World War II. To better differentiate between Allied and Axis aircraft, a system of challenge and response known as "Identification, Friend or Foe" (IFF) was developed. (In Britain, it was code named "Parrot.") After the war, as civilian skies became more crowded, resolving identities by the timing and direction of reflected radio energy from one airplane at a time proved to be impractical, and by the late 1960s transponders were required to operate in what was then called Positive Control Airspace (our present-day Class A).
The successor to IFF became the transponder, which currently plays a key role in monitoring aircraft movements to ensure separation. During the early days of its deployment throughout the National Airspace System, it was known as the "ATC Radar Beacon System" or ATCRBS. (In fact, you'll sometimes still hear transponders referred to as beacons.) There are two ways ATC radar can "see" you. There's the primary echo of microwave energy bounced back from a "skin paint" that divulges only azimuth and range (though not too well if you're flying a small composite airplane, are far away, or there's intervening precipitation). Then, there is secondary surveillance radar, which works when you're further away (up to about 100 miles), and which was developed to address the shortcomings of primary radar. The secondary surveillance radar, collocated with a primary radar antenna, interrogates your aircraft transponder. This not only increases effective radar range, but also helps to reduce clutter interference from spurious reflected signals. The transponder provides a means for identification (Mode A), altitude reporting (Mode C)--as well as, in some cases and with a special transponder, other selected flight information (Mode S).
Most ATC facilities have both primary and secondary radar. If you looked at one, you'd most likely see three antennas. There's an oblong parabolic antenna (the primary radar) topped by a horizontal bar-shaped antenna (the secondary radar or beacon), both of which rotate together. It's this antenna that actually sends two initial interrogating pulses to your aircraft, at 1030 MHz. (For Mode A they're eight microseconds apart; for Mode C the separation is 21 microseconds.) These two pulses are known as P1 and P3.
The third antenna sends out a pulse known as P2. This pulse serves as an internal check on the interrogations received by ATC's radar. The aircraft's transponder compares the P1, P2, and P3 pulses. If the P2 pulse is weaker than the P1 and P3 pulses, the transponder will not respond. If the aircraft's transponder did respond when the P2 pulse was the strongest, it would result in erroneous displays on ATC radarscope.
Part of the transponder system is the little box in your panel (the name for which is a contraction of "transmitter-responder"). This of course is the unit having those four octal (meaning zero through seven only) numerals that comprise your transponder code and a four-position switch labeled OFF, STBY, ON, and ALT (many with a fifth "TEST" position), as well as an IDENT button and a reply light. This device answers an ATC interrogation with whatever four-digit code you've dialed in (known as Mode A, aka 3/A), as well as your altitude, if you're using Mode C capability (meaning you've switched it to "ALT").
There's nothing mysterious about how transponders reply. Each of the four octal integers that together comprise your assigned transponder code (among the 4,096 possible combinations) is in turn derived from three binary numbers (meaning a zero or a one). The right-most digit is a zero or a one (two to the "zero" power); the middle digit represents a zero or a two (two to the first power, if that digit is a one); and the left-most digit of each octal triad means either a zero or a four (two to the second power). Thus, the maximum value for any octal number is 4+2+1, or seven. Your transponder code is just four sets of these triads, framed by two "ones" at the beginning and end. Note that these same 12 bits are used to transmit your altitude, if Mode C is selected (although there are only 1,280 altitude codes, from minus 1,200 feet to 126,700 feet). Your transponder sends separate replies to these two types of interrogations; it either squawks the chosen Mode A code or the Mode C altitude (depending on how it's being interrogated at any given moment), but never both at the same time.
The altitude encoder tells the transponder what altitude to transmit. They come in two basic forms. The first and cheapest kind is the so-called blind encoder, which is usually a solid-state device. It's a separate box whose sole purpose is to feed the transponder a digitized altitude, via a static pressure transducer. (A transducer just responds to one type of input and outputs energy in another form, for example a microphone converting sounds into electrical signals. In this case, the existing static pressure line is connected to the encoder with a "T" fitting, and the encoder signal is wired to the transponder.)
The second type also involves an altitude encoder, but it's built into the altimeter, which saves a small amount of space. Thus, it's known as an encoding altimeter. However, this one costs significantly more to overhaul. (The cheaper solid-state pressure transducers tend to become inaccurate with age, while the aneroid type encoders are costlier, but they seldom need adjustment.) Both types are calibrated at the pressure altitude datum (reference) of 29.92 inches, and relay altitude (to the nearest 100 feet) correctedto 29.92. ATC's ground equipment has the current local altimeter setting and makes the altitude corrections, allowing the correct altitude to be displayed directly onto the controller's screen.
Here are some additional transponder tidbits:
Jeff Pardo is an aviation writer in Maryland with a commercial pilot certificate for airplanes, and instrument, helicopter, and glider ratings. He has logged about 1,300 hours since 1989. An Angel Flight mission pilot, Pardo has also flown for the Civil Air Patrol.