LAS VEGAS — The smartphone is often called the real-world version of the handheld communicators from the original Star Trek, a nod to how prescient the TV series was about personal technology.

Well, another Star Trek gadget is on the verge of becoming common. The tricorder — the device that Spock and Dr. McCoy would use to analyze all kinds of objects and materials on the show — is becoming a real thing. And it's coming to smartphones.

At CES 2017, Consumer Physics showed off the world's first smartphone with a built-in molecular scanner. The scanner itself is actually an even smaller version of the stand-alone handheld scanner, the SCiO, which the company revealed at last year's show (and went on to win a Mashable CES award).

The Changhong H2 next to the original stand-alone SCiO sensor. Image: Pete Pachal/Mashable

The phone is a Chinese model, the Changhong H2 — not exactly your average Samsung. But it's a real phone that's really going to be sold in China, not just a prototype or proof of concept. It's scheduled to go on sale in June with a price tag of roughly $435 US dollars.

Looking at the back of the phone, you'd be forgiven for thinking the sensor is just the phone's camera. But that odd-looking dual lens is the scanner, basically the embedded version of the SCiO. It uses spectrometry to shine near-infrared light on objects — fruit, liquids, medicine, even your body — to analyze them.

The Changhong H2 analyzing the freshness of an Apple. Image: Pete Pachal/Mashable

Say you're at at the supermarket and you want to check how fresh the tomatoes are. Instead of squeezing them, you'd just launch the SCiO app, hold the scanner up to the skin of the tomato, and it will tell you how fresh it is on a visual scale. Do the same thing to your body and you can check your body mass index (BMI). You need to specify the thing you're scanning at the outset, and the actually analysis is performed in the cloud, but the whole process is a matter of seconds, not minutes.

Another application is verifying the authenticity of drugs. At a demo at CES, I saw the phone scan what I was told was a real Viagra pill and a knock-off. To the naked eye the pills looked identical, both light-blue diamond-shaped pills. But the H2's SCiO scanner recognized the impostor in seconds, calling it out with a bright orange screen.

This pill looks suspect. Image: Pete Pachal/Mashable

It's easy to see the great potential of putting this kind of tech into the hands of everyone with a smartphone. Consumers everywhere would be empowered to test food and medicine before they commit to buying or ingesting them. Hagai Heshes, head of product marketing for Consumer Physics, says adding the sensor to a phone doesn't increase cost much, and judging from the price of the Changhong H2, it appears he's right. The company also claims the phone is 20% more energy efficient than comparable smartphones.

Will Consumer Physics' molecular sensor catch on with the major smartphone manufacturers? That would take some convincing (though Heshes says the company is talking to them), but it's easy to see a brand like Samsung, which has historically debuted phones with all kinds of unusual tech, taking a chance on the sensor or one of its models.

And if that model catches on, who knows? Maybe we'll all be scanning our groceries and bodies with our phones five years from now with the same ease with which Dr. McCoy would diagnose a case of Romulan measles.