In another section of Soweto, called White City — because it was one of the first sections to get electricity and so was bright white after dark — two young men sat at a curbside with a sign reading “Pray for Madiba,” a reference to Mandela’s clan name, by which he is widely known in South Africa.

“All we can do is wait and see now,” said Jabu Mkwele, 21, a taxi van driver when he can find work. “Madiba will go in his own time, and we must be strong and let him go.”

Although the effect of Mr. Mandela’s illness on Mr. Obama’s visit was not clear, his stay in South Africa is likely to be overshadowed by expressions of disappointment and even anger over his conduct in office.

While South African government officials promise an appropriately warm welcome, a coalition of trade union groups and left-wing political organizations is planning a “national day of action” on the first day of his visit, including a march on the American Embassy in Pretoria. The next day, student groups intend to protest outside the University of Johannesburg’s Soweto campus, where Mr. Obama is to receive an honorary degree.

Meanwhile, two national groups, including the Muslim Lawyers Association of South Africa, have urged the South African government to arrest Mr. Obama when he lands, accusing him of “war crimes, crimes against humanity and genocide” for the American drone attacks in Pakistan and elsewhere and for keeping the Guantánamo Bay prison in Cuba running.

“When President Obama was ushered into the world, there was a promise for change of policy, like the closure of Guantánamo Bay, and how he is going to respond to the dispute between Israel and Palestine,” Phutas Tseki, the regional chairman of the Congress of South African Trade Unions, said in announcing his group’s participation in Friday’s protests. “Now he is on his second term, and he continues to be arrogant, and his policies continue to entrench American power to the whole globe without any change.”

Asked to comment on the planned protests, Benjamin J. Rhodes, the deputy national security adviser, said only that South Africa “is a vibrant democracy.”