* Shuttle launch scheduled for 5:40 a.m. EDT (0940 GMT)

* Fuel leak stymied first launch try

* Shuttle to deliver Japanese porch to space station

CAPE CANAVERAL, Fla., June 16 (Reuters) - Delayed by bad weather, NASA on Tuesday began filling space shuttle Endeavour's fuel tank for launch, hoping to begin a key construction mission at the International Space Station.

Fueling was delayed nearly three hours by thunderstorms and lightning at the Florida launch site. The shuttle is scheduled to lift off at 5:40 a.m. (0940 GMT) on Wednesday.

With good weather forecast for the launch, NASA began filling the space shuttle's fuel tank with 500,000 gallons (1.9 million litres) of liquid oxygen and liquid hydrogen needed to power the ship's three main engines during an 8 1/2-minute climb to orbit.

Endeavour will deliver to the space station a porch that will be attached to the Japanese Kibo laboratory so that experiments can be exposed to the open space environment.

NASA had hoped to launch Endeavour last Saturday, but sensors detected dangerous levels of hydrogen gas escaping from a vent line and canceled the launch. A similar problem stymied sister ship Discovery during a launch attempt in March.

Engineers have not determined the root cause of the problem. The fix for Endeavour is the same procedure NASA implemented to launch Discovery -- replacing suspect seals. NASA will know if the plan worked when the shuttle's tank is full.

The vent line removes hydrogen that has turned from liquid to gas inside the shuttle's fuel tank. The gas is funneled to a flare stack away from the shuttle and safely incinerated.

Since hydrogen is so volatile, NASA has very tight safety restrictions on how much gas can be outside the shuttle.

NASA is expecting to have just one shot at launching Endeavour before the mission would be postponed to July.

The Eastern Test Range, which supports both shuttle and unmanned rocket launches from Kennedy Space Center and the adjacent Cape Canaveral Air Force Station, is planning to launch NASA's Lunar Reconnaissance Orbiter between Thursday and Saturday.

The range can only support one type of rocket at a time and it takes about two days to reconfigure equipment for different launchers.

Launching Endeavour after Saturday is not an option because the angle of the sun would overheat the shuttle while it was docked at the space station. The next launch opportunity is on July 11.

NASA is trying to finish building and outfitting the space station by Sept. 30, 2010, so it can retire the shuttle fleet and move on to developing a new spaceship that can carry astronauts to the moon and other destinations beyond low-Earth orbit.

Eight missions remain to complete the station, a $100 billion project of 16 nations that has been under construction 225 miles (362 km) above the planet for more than a decade.

The seven-member Endeavour crew will install the Japanese porch, replace batteries on one of the station's solar wing panels and perform other maintenance tasks.

The mission, the third of five flights planned for this year, is scheduled to last 16 days. (Editing by Jim Loney and Peter Cooney)