Image source: Getty Images.

InvenSense (NYSE:INVN) earns the vast majority of its revenue from selling motion-sensing components for mobile devices. The gyroscope sensors allow smartphones to know when they're being tilted, laid flat, or brought up to your head to take a call. 

It's impressive technology, and InvenSense makes some of the best gyroscopes on the market, but that hasn't translated into success for investors. The company's stock price is down nearly 70% over the past two years.

Here are two charts showing how InvenSense got into its current predicament, and one that offers a glimmer (albiet a very small one) of hope:

Betting too much on mobile 

It's no secret that that InvenSense has long relied on two main customers, Apple and Samsung, for much of its business. This seemed like a good thing for a while because it allowed InvenSense to get its tech inside the most coveted smartphones in the world. 

But what actually happened is that Apple and Samsung used their large size to put pricing pressure on InvenSense, which pushed down the company's average selling price (ASP) of its products. 

The problem is that InvenSense still relies on mobile for the vast majority, 63%, of its revenue from its mobile customers in fiscal Q1 2017. 

Take a look:

Image source: InvenSense.

Typically, it wouldn't be such a problem to rely on one segment of the tech sector, but InvenSense receives about 39% of its total revenue from just Apple alone.

Margins are contracting

As a result of InvenSense's falling ASPs, the company's margins have suffered as well. While InvenSense was able to gain lots of market share in the mobile gyroscope business and win a spot in the iPhone and high-end Galaxy S devices over the past few years, it's come at a steep price. 

Take a look at how far the company's gross margins have fallen in just a few years:

Image source: InvenSense.

The company's margins did improve from 45% to 46% in the most recent quarter, but don't start thinking that things are on the mend just yet. 

InvenSense is facing stiff competition from STMicroelectronics, which undercut the company's prices to win a spot in the latest high-end Samsung devices. And as fellow Fool Ashraf Eassa recently noted, Apple may not be far behind in doing the same.

Revenues are slowly moving away from mobile

While it's true that InvenSense still relies too much on some key mobile players for its revenue, the company is trying to diversify its revenue streams. 

InvenSense has expanded both its Internet of Things (IoT) and its optical image stabilization (OIS) revenue over the past few years. 

Image source: InvenSense.

The diversification may not be happening quite as fast as investors would like, but it's a solid step toward an InvenSense turnaround.  

The real test for InvenSense will be if it can continually expand its IoT and OIS revenue fast enough. The company is still far too dependent on Apple. And InvenSense's stock likely isn't a good investment until it has migrated more of its business away from the iPhone maker.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.