The Senegalese village of Bangadj gets 100 cubic meters of water a day for 1,400 residents thanks to its solar-powered water pump, which was installed in 1995. Bangadj lies outside the city of Thies, 70 kilometers (43.5 miles) east of the capital Dakar. SEYLLOU/AFP/Getty Images

Following the lifting of a law that banned solar power in Senegalese cities, the grassroots sector is partnering with the government to implement the renewable-energy source nationwide, starting first with areas not already connected to the national electric grid. The government is working on a project to turn 14,000 traditional rural villages into eco villages -- communities that rely almost entirely on solar power. So far, the government has built only 100 of them, but it plans to build 500 more by the end of 2018.

Senegal has about nine months of uninterrupted sunshine every year, a perfect environment for solar technologies. Outdated laws, government corruption and lack of resources have held the country back from investing in renewable energy. But growing discontent about widespread power outages caused massive protests in the country, forcing the government to reevaluate the way it brings energy to its people.

For years, the Senegalese government banned cities connected to the national electric grid from using solar power except during power outages. As urban centers in the country continued to grow, the government failed to keep up with the growing demand for energy. The country relied on a few aging diesel-fueled power stations, which were expensive because Senegal imported all of its oil. The country’s power bills at one point were the highest in the entire West African region and its service delivery among the worst.

The government’s only option was to adapt and to establish an official solar power sector. Former President Abdoulaye Wade lifted the ban on solar technologies during his time in office and made Dakar, the capital, the hub for importers of solar panels.

The solar power sector in Senegal is now attracting millions of dollars in investment.

The Japanese and Spanish governments, for example, gave Senegal grants and loans to bring solar energy to remote islands and inlets off the delta, areas that would be difficult to connect to the national grid. Germany, though, is Senegal’s largest investor and has supported the expansion of the renewable energy sector in Senegal for over two decades.

Even celebrities are pouring money into the Senegalese solar sector. The rapper Akon is in the process of rolling out off-grid and affordable solar technologies in countries such as Mali, Sierra Leone and Senegal. The program is designed to bring solar street lamps and domestic solar kits to rural communities far from capital cities.

Despite advances in the renewable-energy sector in Senegal, there is still a lot more that needs to be done, say activists.

Marta Torres, a nurse who worked in a clinic just outside Dakar last year, said her facility often did not have power. She and her co-workers said there was a time when they had to stitch a woman who had just given birth by using the light from their mobile phones. Torres is now raising money to buy solar panels for the clinic.

Senegal is one of 40 countries working together on streamlining the process for turning traditional villages into eco villages. Last year, representatives met in Senegal to draft a working paper that outlines how the process of building eco villages can be presented to local authorities. That paper will be presented at the GEN+20 Summit in July, a conference that focuses on the development of eco villages in Africa and Latin America.