At the end of July, India experienced the worst blackout in modern history. At least 20 states lost power in three huge grid failures covering an area home to more than 700 million people.

In one tiny village in very rural Rajasthan, the lights stayed on. Buttermilk machines churned, televisions blared and fans whirred, providing respite from the drenching humidity of the post-monsoon heat.

"We were sitting in the dark in our head office in Jaipur waiting for the power to come back on and yet in Khareda, where very recently they had no power at all, there was an unbroken supply of electricity," said Yashraj Khaitan, one of two 22-year-olds who made it happen.

Khaitan, who is Indian, with Jacob Dickinson, who was born in San Diego, has a big plan: to bring cheap, sustainable electricity to at least one million Indians within five years through their start-up, Gram Power.

Three months ago the engineering graduates from the University of California, Berkeley, chose the hamlet of Khareda Lakshmipura to test a simple solar-power microgrid which has the potential to change the lives of many of the 400 million or so Indians who are not connected to the national grid – not to mention the hundreds of millions of others in the world's biggest democracy whose electricity supply is erratic at best.

Gram Power has already turned some influential heads. The two young men are mentored by Eric Brewer, vice-president of infrastructure at Google and a professor at Berkeley. Last year Nasa selected Gram Power's technology among the top 10 cleantech innovations from around the world.

Reaching Khareda during the rainy season is something of a mission.

From the princely city of Jaipur in western India it is normally a bumpy three-hour drive south dodging cows and potholes before dipping down to cross a barren riverbed.

Yet when the Guardian visited earlier this month, the river was anything but barren. Getting to the other side involved very wet trousers and a ride in a somewhat rudimentary boat pulled by a man in a loin cloth. He swam at the front with a rope while cheerful passengers recreated the scene from Titanic at the back. However entertaining, it was a stark reminder of the very real challenges faced in providing essential services to rural communities.

When we finally reached the village, locals were happy to show off the TV sets they had bought since Gram Power arrived. But the novelty of having electricity had already worn off. "Now, they want more power," said Dickinson, who normally runs Gram Power's US operation. "At the start, most of them wanted the cheapest connection, which provides enough to power a couple of light bulbs and charge cell phones. Now, almost all of them have upgraded so that they can run their coolers, fans, their buttermilk machines and, in some cases, their new TVs and DVD players."

The microgrid requires a source of power generation (in this case a bank of solar panels), which is connected to a makeshift brick substation containing a bank of inverters (batteries which store power during the night or on overcast days) and a computer which transmits data back to the Jaipur HQ. Wires on wooden poles carry the electricity from the substation to each house in the grid, each of which is fitted with its own smart meter, which tells the user how much power they are using and what it is costing.

Gram Power sells electricity in units of rupees (Rs) an hour. Prices compare favourably with the government supply, said Kaitan. "A household with a two light and cell phone connection will spend roughly Rs75-100 a month as compared to Rs80-100 a month with the government connection that comes without a guarantee of the number of hours of supply."

The pre-paid smart meters have caught the Delhi government's eye, particularly for their potential to curb power theft. About a third of the 174 gigawatts of electricity generated in India annually is either stolen or dissipates in the conductors and transmission equipment that form the country's distribution grid.

Losses hamper work to bring grid electricity to those without it and contribute to what the Central Electricity Authority says is a 10% shortfall in meeting peak power demand.

Gram Power's business plan is to make money selling electricity and by becoming a technology provider to the state. At the end of August the firm was hammering out a one-year deal with the Indian government to reach 120 villages, bringing power to at least 100,000 households, said Khaitan.

The company is heavily reliant on government subsidies: next year a new law should give companies Rs150 for each watt of power they generate. There is competition for the grants: Gram Power is not the only company in India investing in micro grids.

Its unique selling point is giving customers a standard 240VAC connection, rather than just a few LED lights. "Our consumers can operate any and every household appliance depending on the connection type they choose. None of the competing alternatives, to my knowledge, are providing such a holistic solution on the electricity distribution side," said Kaitan, adding that his firm's "core innovation" is in grid monitoring, theft detection and a prepayment model that ensures payment recovery.

Administering the scheme relies on recruitment and training of a local entrepreneur whom Gram Power entrusts with a dongle to top up the credit on each household's smart meter. He or she buys power direct from Gram Power and sells the units on for a small profit.

In Khareda it's a 16-year-old called Banty, who lives with his parents and brother in a two room-house newly furnished with a TV and DVD player.

Banty's mother, Lali Devimeena, said having power has changed the family's life. "Now the children can study at night," she said. "Before, living here was like being in the jungle. Now we feel as though we are actually part of society."

Despite the challenges, Khaitan and Dickinson are thinking big. "By the end of this year, I think we can very easily reach 500 households with our pilot grids. After that, the sky is the limit," said Khaitan, stressing that his technology was not just tied to solar power but could just as easily apply to biomass, geothermal, or any other generation source. "Considering the strong response we have received so far and the magnitude of need in India and abroad, we expect to be catering to the order of one million homes in five years."

• This article was amended on 12 September 2012 to remove incorrect details about equity funding raised by Gram Power.