Farmers use the cleaner, cheaper fuel - which requires no extra land to grow its feedstock - to run irrigation pumps, making them less vulnerable to poor rains.
Kenyan farmer Abel Mutie Mathoka thought it must be a joke when he was told he could irrigate his drought-hit crops more cheaply, cleanly and efficiently using a pump fuelled by cotton waste.
"Who could believe it's possible to make a fuel better than diesel from cotton seeds? I didn't!" laughed Mathoka, crouching down to inspect the watermelons on his 10-acre (four-hectare) shared plot in Ituri village in Kenya's southeast Kitui county.
"But it works," he said, walking over to a nearby tree and plucking a large green pawpaw. "Irrigation with this biodiesel water pump has helped me get higher yields, especially during drought periods."
Mathoka said his earnings had doubled in the two years he has been pumping water using biodiesel, which is both more efficient and 20 shillings ($0.20) per litre cheaper than regular diesel.
The biodiesel he is using is not just good news for him - it is also good news for the planet.
Unlike most biofuels, which are derived from crops such as maize, sugarcane, soybean, rapeseed and jatropha, it is made from a byproduct of the cotton-making process.
No extra land
That means that as well as being cleaner and cheaper than regular fuel, it is more sustainable than other biofuels because no extra land is needed to produce it.
From Brazil to Indonesia, the rush to cultivate biofuel crops has driven forest communities off their land and pushed farmers to switch from crops-for-food to more profitable crops-for-fuel - exacerbating food shortages.
"Our biodiesel comes from crushing cotton seeds left over as waste after ginning - the process of separating the seeds from raw cotton," said Taher Zavery, managing director of Zaynagro Industries Ltd, the Kitui-based company producing the biodiesel.
"We started producing and using it to power our cotton ginning factory in 2011. With increased production, we now use it for our trucks, sell it to the United Nations to run some of their buses - and also to local farmers for irrigation."
More than 1,200 farmers in Kitui have so far invested in biodiesel pumps for irrigation as part of an initiative launched by Zaynagro in 2015, said Zavery.
Dry river beds
Climate change is taking a toll across east Africa and increasingly erratic weather is becoming commonplace in countries such as Kenya, Somalia, Uganda and Ethiopia, resulting in lower rainfall.
The recurring dry spells are destroying crops and pastures and are starving animals - pushing millions of people in the Horn of Africa to the brink of extreme hunger.
The number of Kenyans in need of food aid in March surged by almost 70 per cent over a period of eight months to 1.1 million, largely due to poor rains, according to government figures.
With almost half Kenya's 47 counties declared to have a serious shortage of rain, humanitarian agencies are warning of increased hunger in the months ahead.
"Only light rainfall is forecast through June...and this is not expected to alleviate drought in affected areas of Kenya and Somalia," said the Famine Early Warning Systems Network in its latest report.
"Well below-average crop production, poor livestock body conditions, and increased local food prices are anticipated, which will reduce poor households' access to food."
In Kitui's Kyuso area, the signs are already evident
Rivers, water pans and dams are drying up as a result of the prolonged dry spell.
Villagers complain of trekking longer distances - sometimes more than 10 km (6 miles) with their donkeys laden with empty jerry cans in search of water.
Small-scale farmers, most of whom are dependent on rain-fed agriculture, discuss plans to sell their goats to make ends meet if the harvest is poor.
But not all Kitui's farmers are worried.
Irrigation systems
A small but growing number are shedding their burden of reliance on the weather - and investing in irrigation systems powered by Zaynagro's cotton seed biodiesel through a pay-as-you-go scheme launched more than three years ago.
Neighbouring farmers band together to invest in the irrigation system - which includes the biodiesel pump, 12 metres of pipes and 10 litres of biodiesel - at costs starting from 32,000 shillings, depending on the size of the pump.
The farmers make an initial payment, then pay interest-free monthly instalments until the total is paid off. They buy the biodiesel to run the pumps from Zaynagro at Ksh80 ($0.8) a litre.
Farmer Alex Babu Kitheka, 39, said the biodiesel pump allowed him to irrigate a larger portion of his one-acre plot, where he grows a variety of vegetables including maize, tomatoes, spinach and sweet potatoes.
"With a diesel pump, maize yields were lower and I would get Ksh15,000 ($150) in three months. With the biodiesel pump, I can earn Ksh45,000 ($450)," said Alex Babu Kitheka, standing near his plot in Ilangilo village, 40 km (25 miles) from Kitui town.
Circular economy
Other farmers point to the scheme as a major benefit in helping improve their output.
"The instalment scheme is good. Most farmers don't have the money and cannot easily get a loan to buy a pump like this," said Maurice Kitheka Munyoki, 41, as he stood next to his blue biodiesel pump.
"Having a scheme like this helps us a lot. Our yields are good which means we can pay off the cost of the pump slowly in small amounts, and have money left over to pay the school fees."
Zaynagro's initiative is still in its early stages, with few farmers having repaid the full cost of the pumps.
But such biofuel schemes are promising because they create a circular economy by turning waste to biofuel for profit, said Sanjoy Sanyal, senior associate for Clean Energy Finance at the World Resources Institute.
The simplicity of the model - easy-to-use, robust technology, assured supply of biodiesel combined with a pay-as-you-go scheme - could help electrify rural Africa, he said.
"There is a mosaic of sustainable energy options in the world. The key issue is testing ideas and approaches in a collaborative fashion," said Sanyal.
"Other cotton ginning factories in the region should try and learn from this experiment. Financial institutions should start experimenting with loans to groups of farmers. International donors and investors need to support experimentation."