Houston — Two astronauts had to cut short the first spacewalk of Space Shuttle Endeavour’s final mission May 20 when a spacesuit sensor that detects carbon dioxide levels failed.

Astronauts Andrew Feustel and Greg Chamitoff spent more than five hours working outside the international space station to replace science experiments, install new equipment and perform maintenance on the orbiting laboratory. They planned to spend about 6.5 hours on the spacewalk, but NASA ordered them to end the spacewalk slightly early because of the broken sensor on Chamitoff’s spacesuit.

The glitch occurred about five hours into the spacewalk, when a sensor that monitors the level of carbon dioxide inside Chamitoff’s suit failed. Without this sensor, mission controllers had no way of knowing for sure how much oxygen he had left.

After doing a conservative estimate, NASA managers determined that there would not be enough time for Chamitoff and Feustel to connect a series of cables, so Mission Control instructed the spacewalkers to clean up and end work early. One unfinished task can be completed on a future spacewalk, officials said.

The May 20 spacewalk began when the astronauts opened the hatch of the station’s airlock and floated outside at 3:10 a.m EDT. It was the first of four spacewalks planned for Endeavour’s STS-134 mission, the orbiter’s last spaceflight before it is retired to a museum.

While the spacewalkers were working, NASA continued investigating two small areas of damage on Endeavour’s heat shield tiling. The damage will likely not pose any risk to the orbiter, but more analysis is needed to know for sure.

The May 20 excursion was the first spacewalk for Chamitoff who spent about six months living on the space station in 2008, but never got a chance to float outside a spacecraft. Feustel has performed three previous spacewalks.

The spacewalkers’ main goal for the day was to remove samples from an external science payload, called the Materials International Space Station Experiment, which tests the reaction of different materials, such as paints, plastics, circuits and even seeds, in the environment of space.

Feustel and Chamitoff retrieved a set of samples that had been exposed to space for about a year, and stowed them in the shuttle’s cargo bay to be returned to Earth for analysis. They replaced the samples with a fresh batch that will be left out for at least six months.

The astronauts also installed a protective cover on a joint that controls the movement of one of the space station’s solar arrays, and did some prep work for the mission’s second spacewalk, which will focus on topping off ammonia coolant in a leaking system. That spacewalk was scheduled for May 22 at press time.

One of their final tasks was to install a set of new communications antennas on the space station’s Destiny laboratory.

The spacewalkers were able to attach these successfully, but they were unable to install a set of connection cords because time ran out.

NASA, meanwhile, was weighing whether to schedule a focused inspection of the damaged areas on Endeavour’s heat shield tiles so astronauts can gather more pictures for analysis.

Endeavour is due to return from its 16-day mission on June 1.

Meanwhile, preparations are in full swing for NASA’s final shuttle mission, the Atlantis orbiter’s STS-135 space station resupply flight. On May 17, NASA rolled Atlantis over to the Vehicle Assembly Building from the Orbiter Processing Facility in preparation for a mid-July launch.