With a $5.7 billion loss in 2011, Sony is coming off its worst year ever. Blame the Thailand floods or its collapsing TV business, but either way the result is the same: Sony needs more income.

It may have a plan to make that happen. The company is making a $997 million investment in the production of stacked CMOS sensors. That’s a major gamble, as $997 million represents nearly half of Sony’s projected revenue for its fiscal 2012.

With the cash, Sony plans to boost production of sensor wafers to up to 60,000 a month by September of next year. Some of the output will be used in Sony’s own products, but the more important segment will be sold to other smartphone and tablet makers.

A CMOS sensor is a camera sensor equipped with its own integrated circuit. This circuit in turn features an array of pixel sensors, which detect the light used to process photos. Stacked sensors shrink the real estate needed to do the job, allowing for greater performance in less space. Sony announced the new sensors in January, promising faster speeds and lower energy consumption.

The appeal of this should be clear: As the recent nanoSIM ordeal has shown, space is a prime consideration for smartphone manufacturers. With limited space in increasingly small phones, making individual components as small as possible has now become a key mission.

With the investment, Sony is making a big play to have its sensors in just about every mobile device with a camera. Sony’s sensor technology is already in the iPhone 4S, and the company clearly wants that relationship to continue for a long time to come.