A conman convicted of selling bogus Star Trek-inspired medical devices turned his sentencing Tuesday into one last sales pitch — before a peeved judge sent him on a five-year mission behind bars.

In a bid for leniency, Howard Leventhal spent about 40 minutes presenting to Brooklyn federal court Judge Brian Cogan his bizarre post-conviction plans to open a camp called “Heroes @ The Gate” in Wisconsin.

His plan is to rehabilitate ex-convicts through flying lessons, wood and metal shops and workshops on robotics, 3D printing and web coding.

“No one will go home without being able to say they piloted an airplane,” Leventhal promised, as he scrolled through a PowerPoint presentation that he’d trimmed down from 143 to a dozen slides. “I attach myself to people in need and I never give up.”

Leventhal’s lesson plans also include a martial arts demonstration of an 85-pound girl and a “decrepit” old man breaking boards — to prove to his students that anything is possible — and an awards ceremony featuring a medal in Judge Cogan’s name.

“None of what is described here, your honor, is fantasy or self-delusion,” he vowed.

The 60-year-old Illinois man pleaded guilty in 2013 to trying to steal as much as $26 million by duping people into investing in his “McCoy Home Health Tablet,” inspired by the famed tricorder used by “Star Trek”’s Dr. Leonard McCoy character.

He was out on bail when he was busted — a second time — last year for peddling another sham device to home health aides dubbed the “Uber of Home Nursing.”

But Cogan wasn’t buying what Leventhal was trying to sell him in court, a sales pitch that drew smirks from prosecutor Winston Paes and exasperated sighs from US Marshals.

“It became quite clear after the guilty plea that Mr. Leventhal only sees the world through Mr. Leventhal,” said Cogan, adding that is what makes him a “very dangerous person.”

“I don’t think he’s going to change. I don’t think he can see things clearly,” the judge said.

Defense attorney Steven Zissou agreed that Leventhal was a polarizing character but insisted he was no “fraudster.”

“Love him, hate him. This is a man who’s done caring, considerate things for a lot of people,” Zissou said.

Leventhal was ordered to pay $1.3 million in restitution to his victims and can’t file any lawsuits without Cogan’s approval. That stipulation was made after Leventhal tried suing everyone under the sun, including Paes.