Updated

Brazilian inmate Ronaldo da Silva was making an escape of a sort as he hopped on a bicycle and pedaled furiously, clocking up several miles (kilometers) before jumping off.

Silva didn't get very far, in fact not an inch. He's still inside the medium-security prison where he's serving a 5.5-year sentence for holding up a bakery.

But he did move a bit closer to freedom on his stationary bike. Silva is part of an innovative program that allows inmates to reduce their sentences in exchange for generating power to help illuminate the town of Santa Rita do Sapucai at night.

By pedaling, the inmates charge a battery that powers 10 street lamps along a riverside promenade. For every three eight-hour days they spend on the bikes, Silva and the program's other volunteers get one day shaved off their sentences.

The project in the southeastern state of Minas Gerais is one of several across Brazil meant to cut recidivism by helping restore an inmate's sense of self-worth. Prisoners elsewhere can trim their sentences by reading sentences — in books — or taking classes.

Officials say they've heard a few complaints the initiatives are soft on criminals, but there's been little criticism in the country's press or in other public forums.

"We used to spend all day locked up in our cells, only seeing the sun for two hours a day," said the 38-year-old Silva, whose missing front teeth speak to a life of hardship. "Now we're out in the fresh air, generating electricity for the town and at the same time we're winning our freedom."

Silva has already pedaled off 4 kilograms (9 pounds) and 20 days from his sentence.

Clad in red, prison-issue sweat pants and matching T-shirts, he and his fellow cyclists hit the bikes at around nine in the morning and ride until about 5 p.m., with breaks for lunch and an afternoon snack.

Generating power makes pedaling hard, and the inmates soon work up a sweat, though the crisp mountain air of Santa Rita do Sapucai — a city of about 35,000 nestled in a mountain range about two hours north of Sao Paulo — keeps them cooler than they'd be in most other parts of tropical Brazil. With just four bikes so far, the project has just eight participants.

The two month-old program is the brainchild of the town's judge, Jose Henrique Mallmann, who said he got the idea from a story he read on the Internet about gyms in the United States where electricity is generated by the exercise bikes.

The municipal police contributed bicycles from the lost and found department. Neighborhood engineers helped transform them into stationary bikes and hooked them up to car batteries donated by local businesses. Local businesses pitched in with the converter that transforms the battery's charge into the 110 volts needed to power cast iron street lamps along the river.

Every night, just before sunset, a guard drives the charged battery from the prison to the downtown promenade. He hooks it up to the converter and a few minutes later the 10 street lamps begin to glow a soft white, like full moons suspended over the rushing waters of the river.

Long abandoned after dark, the newly illuminated promenade now attracts dog walkers, joggers, kids on bikes and couples walking arm-in-arm.

Another guard comes in the morning to pick up the battery and ferry it back to the prison, where 133 inmates are serving sentences ranging from a few months for burglary or drug charges to as much as 34 years for murder.

The goal is to eventually kit out enough bikes to power all 34 riverside street lamps, said the prison's director, Gilson Rafael Silva.

"It's a win-win situation," he said. "People who normally are on the margins of society are contributing to the community and not only do they get out sooner in return, they also get their self-esteem back."

Silva said his is the only prison he knows of with such a power-generating scheme, but he said he has received inquiries from his counterparts in lockups across the country.

The country's four federal penitentiaries, where the most dangerous offenders are kept, are also looking for ways to improve literacy. Some 400 inmates, roughly half the total, are reducing their sentences by taking classes and by reading books behind bars.

The "Redemption through Reading" program shaves as much as a month and a half off inmates' sentences each year if they read a dozen books. Under the initiative, inmates are able to choose from a wide range of genres, including literature, science, philosophy and classics.

To guard against cheating, participants must write a summary of each book, which is reviewed by a judge. The magistrate then decides whether to grant a sentence reduction of up to four days per book, according to the decree that appeared last month in the government's official gazette. Capped at 12 books a year, the program can shave up to 48 days a year off of participants' sentences.

That's far more books than the average Brazilian reads. A recent survey by Pro-Livro, the lobbying arm of Brazil's publishing industry, suggested the average Brazilian finishes just 2.1 books a year. Though Brazil has made great strides in reducing illiteracy, one in 10 citizens over the age of 15 still can't read, according to the 2010 census.

The federal prisons also offer programs that reduce inmates' sentences if they take elementary school to college-level classes.

Some say the idea could eventually help trim overcrowding in Brazil's prisons, which hold an estimated 500,000 people. Human rights groups have long complained of appalling conditions and widespread violence.

Prison director Silva disagrees with any suggestion the inmates are being coddled.

"People say that we're turning prisons into a kind of luxury hotel," said Silva. "But this is the only hotel I know of where no one wants to stay."