Robert Llewellyn is not a typical eco-activist. “Oh, I’m absolutely un-green,” says the actor and TV presenter. “I’m as un-green as a corporate exec. I fly a lot. Though I have hugged a tree. Actually, I’ve lent against one while I was having a wee in the woods, I’m not sure if that counts?”

You don’t need to wear an environmental hairshirt, however, to believe it’s possible to live in a different, more sustainable way. For the actor, who presented Scrapheap Challenge on Channel 4 and is best known for playing Kryten on BBC2’s Red Dwarf, that belief stemmed from a longstanding passion for new technologies, particularly renewable energy.

Why, he wondered, were we all powering our cars, cities and homes with carbon-based energy, shipped hundreds of miles or more from big, polluting power plants? Surely technological advances meant we could be generating our power in different ways, and much closer to home? Even, perhaps, if you lived in a tiny clutch of houses in the Cotswolds countryside? So Llewellyn set out to test his thesis in his home village in Gloucestershire.

The result is The Great Village Green Crusade, to be screened on Thursday on BBC4, which captures Llewellyn’s quest to persuade Temple Guiting, a community that has been around since the Domesday Book, that it could generate its own electricity and find itself at the cutting edge of the green energy revolution.

That, at least, was the plan. The year-long quest was in fact filmed over two and a half, owing to the daunting and occasionally insurmountable hurdles that Llewellyn and a small band of heroically enthusiastic neighbours encountered almost every step of the way. “We didn’t have to fake any jeopardy, that’s for sure,” he says.

The biggest problem, to Llewellyn’s surprise, was not convincing residents of the village where he has lived for 25 years (“another 25 and you’ll almost be local,” according to a local farmer). His pitch to the community was not moral but economic, highlighting the fact that the village could make money from the scheme. “But what was interesting was a lot of people saying: ‘We can’t treat the planet the way we have been, we have to change.’ Particularly the older members of the village, who you would think might be the most dismissive of it, were really keen.”

Temple Guiting sits on a small tributary of the Thames, near pleasingly blustery low hills and under as much sun as any other spot in the south-west of England. But Llewellyn’s hopes that hydroelectric, wind or solar power would prove an easy solution to the village’s energy needs and allow them to feed a surplus to the national grid, generating income for the village, were rapidly dashed.

The stream in Temple Guiting did not have enough force to make hydroelectric power feasible. The options for solar energy were also limited – not, as one might think, because of the British weather, but thanks to tree cover (“the village is built in a wood, basically”) and, inevitably, listing restrictions.

But the biggest problem emerged when Llewellyn started looking into wind energy and was told he could generate all the power he liked, but because of the ageing infrastructure of their local branch of the national grid there was no practical way to upload it to the network. “That was genuinely really depressing, because it just felt like – there’s no way round this.”

A solution – or a start, at least – was eventually found. Within a few months, the villagers hope, they will install their first solar panels on the roof of a farmer’s barn; he will pay them for the energy, generating a small income (“more than a jumble sale but it’s not a vast amount of money”) for the village.

It is, insists Llewellyn, only the beginning. The National Grid may not be able to take their power, but huge leaps forward in battery technology mean Temple Guiting should be able to generate more energy – from a range of sources that could include small-scale domestic solar or wind generators – and store it in the village. “That’s the next phase, and that’s what I would love to do here – that we all buy electricity off each other.” Within five years, he hopes, Temple Guiting could be in a position to run its own small power company.

Which might be fine in a tiny community where a local enthusiast knows everyone, but is this replicable in bigger towns and cities? “Oh it’s certainly replicable, simply because a lot of other communities have already done it,” he says. The actor cites schemes in Oxford, Brixton and even on Orkney, and the film shows Llewellyn travelling to Las Vegas, which meets all of its municipal power needs through renewable energy, leading Llewellyn to jokingly attempt to twin Temple Guiting with Sin City.

“If we were genuinely the first people to try this then you could say: ‘God, it’s crazy, don’t even try.’ But there are an enormous number of examples of other communities who have done this on a much bigger scale, and it’s very successful. So yes, this is very, very doable.”

After putting so much personal energy into the project, he must be looking forward to seeing the panels finally going up on the farmer’s roof?

“It will be nice when it’s on there,” he says. “Though it’s been such a hard slog that rather than cheering, I might just have a long sleep.”

• This article was amended on 2 June 2017 to use lower case in a reference to the national grid to differentiate the country’s electricity transmission network from National Grid, an international energy company based in the UK and US.

