The lights are going down in Toulouse. Tomorrow early-rising residents of the Allée Camille-Soula in the south-western French city will have set out to work with the morning gloom held at bay by radical new technology which turns on streetlights only when pedestrians pass.

Installed on a 500-metre section of pavement last weekend, the lampposts double the strength of the light they cast when they detect human body heat. Ten seconds later they revert to normal.

"It's a prototype. Nothing like this exists anywhere in the world. We pretty much built the technology ourselves," said Alexandre Marciel, the deputy mayor in charge of works, highways, sanitation and lighting.

The aim is to cut energy consumption by around 50%, first on the busy street which runs between a sports stadium and university halls, then more widely. If it is a success, it will be rolled out across the city of around 450,000 people, France's fourth largest.

The technology has attracted interest across France and overseas. Last month Toulouse received a deputation of town councillors from the Japanese city of Osaka. "Anywhere where there is a significant urban density, this could make a big difference," said Marciel.

There is a growing campaign in France against nocturnal light pollution. Last weekend saw countrywide demonstrations against the contamination of the night sky by urban lighting. "Concern started just among astronomers and other specialists but is now getting much more mainstream attention," said Clara Osadtchy, one of the organisers.

Campaigners say the light produced for each person in France increased by a third between 1990 and 2000, the most recent date for which statistics exist, and has continued to grow since. Astronomers claim that an unpolluted night sky can only be seen from Corsica or, on the mainland, from a small area of Quercy, high on the remote southern flanks of the Massif Central.

Cash-strapped and increasingly environmentally conscious communities are now trying to cut electricity consumption. Many cities have changed streetlight bulbs for less wasteful models. After years where cheap tariffs and plentiful power meant all-night lighting, smaller rural communities are returning to earlier practices and turning off streetlights after midnight.

"The new technology may be a good idea for somewhere like Toulouse but in the countryside the best thing is to just turn the lights off," said Véronique Clérin, of the National Association for the Protection of the Sky and the Nocturnal Environment. "The average commune [an administrative area] can cut its electricity bill by a quarter and protect natural habitats and the migration patterns of birds, insects and mammals."

Earlier this year the German town of Dörentrup started turning off its lights at 11pm, with its 9,000 residents able to illuminate a specific street for 15 minutes by dialling a special mobile phone code. The local utility company estimated the scheme would cut Dörentrup's carbon emissions by 12 tonnes a year. Early trials showed that many streetlights were switched on only two or three times a night.

Marciel, an elected official from the Radical Left party, has grand ambitions. "Imagine if instead of thinking of movements in town as consuming energy we thought of ways they could generate energy instead. The possibilities are without limit," he said.

One project under consideration is to connect dynamos to the thousands of free bicycles available in Toulouse. The energy they generate could then be "harvested" overnight and used for streetlights or the national grid, Marciel said.

There is still some way to go. Paris still promotes itself as "the city of light". Coinciding with the protests about night pollution were celebrations involving spectacular illuminations of the Eiffel tower.