Does the second law of thermodynamics imply that renewable energy also leads to global warming/climate change? So I have this (possibly dumb) question about the implications of the second law of thermodynamics to the use of renewable energy for the world, so please bear with me. Here goes: Apart from the finiteness of fossil fuels (FFs), which is obviously an issue, the main problem for sustainability in burning FFs for energy is that it leads to the release of greenhouse gases. These trap a lot more of the incoming solar energy than otherwise would have been the case, leading to global warming. OK. So we need to move to solar, wind, nuclear, etc.
But the second law implies that we can only extract some finite amount of energy for useful work, and the rest invariably goes to heat (right?). Solar panels, batteries, wind farms, etc. all presumably leak all unconverted energy into heat. And a lot of this energy is coming from 'outside' the biosphere. So doesn't that mean that even with renewable sources, we will inevitably leak heat into the biosphere leading to at least some global warming?
So isn't it really only a difference of scale in terms of the warming that is caused by greenhouse gases from FFs vs. from renewables? Won't we always heat up the surface, no matter how efficient we get?
Also, increasing efficiency could (and I think tends to) lead scaling up our use of energy, so that the total waste heat generated might still increase. Is it possible to keep the biosphere at the same approximate temperature even if billions more people start using the same amount of energy per capita as say a modern wealthy European does?
So finally, are there 'sinks' for all this excess heat that we could tap into? Space is at ~4 K, right? So can we use space as an infinite heat sink?
 A: You need to differentiate between the different means of renewable energy generation:
Harvesting of energy in wind:
This has no effect on earths temperature. The energy that is available as wind will end up as heat either way, whether we harvest and use it first, or not.
If we don't harvest it, friction between the air and the earth surface will turn this energy into heat or movement of water/leaves which will again produce heat via friction until the energy is dissipated.
If we harvest the energy, we will do whatever we want with the electricity, and eventually most of it will end up as heat again.
Harvesting the sun:
This does increase the temperature a bit. The problem is, that solar arrays are darker than leaves or sand, and will thus absorb more of the visible light from the sun than the plants/ground would if there were no solar cells installed.
The same is true for all kinds of solar power generation. If you consider mirror based power plants, they convert the sunlight into heat first, then they have the losses of converting the produced steam into electricity. If we assume 40% efficiency of the steam turbine, the overall heating is 2.5 times the electric output of the power plant (this includes the electric output because that will be converted into heat when we use it).
This effect may become problematic when we start plastering deserts with solar arrays: The solar cells heat up the air around them, and the air will start to updraft, possibly changing the local climate. The larger the areas, the more pronounced this effect will be. As far as I know, this is not a problem yet for the sizes of solar arrays that we use. But it may become a consideration as we scale up the solar array sizes.
Harvesting the earth's heat:
Again, this does increase the temperature a bit. Heat is taken from the underground and will end up as heat on the surface much faster than if we had left the heat underground, insulated by hundreds or thousands meters of rock. Again, the efficiency of the power plants dictates how big the factor is between the heating and the usable electric energy.
Harvesting the earth's rotation:
Sounds funny? Well, I'm talking about tidal power plants. The answer here is close to the wind answer, but not fully. Because, if we build tidal power plants, we are slowing the flow of the water, which has a tiny effect on the effective heights of the tides and their timing. This changes the angular momentum that the moon and sun exert on the earth, thereby changing the speed at which earth's rotational energy is converted into tidal energy. I don't know whether the effect would be positive or negative, it would require detailed simulation of the behavior of the tides to determine this.

However: This is all irrelevant!
When we worry about global warming, we worry about the $CO_2$ and other greenhouse gases, not about the heat that's generated by burning oil/coal/gas. And not without reason. The point is, that the heating effect of the $CO_2$ far exceeds the heat generated by burning the coal. When I start my coal grill with 3kg of coal, it will heat my garden a bit. But the 9kg of $CO_2$ that I generate in the process will keep on heating the climate for hundreds of years to come. The gases are the problem that we need to address if we want to leave an inhabitable world to our great grandchildren.
A: The second law of thermodynamics is only valid for isolated systems.
The earth is an open system. We keep receiving energy from the sun, which can be put towards useful work / decreasing entropy.
A: No it does not. The second law applies to an isolated system. The earth is not isolated but a little participant on an specific process and converts high energy photons to lower energy photons (we take up sunlight and convert it to infrared).
These processes take place in the atmosphere and down to a few miles into the ground; below that nothing which we do will change the cooling our of the earth on the cosmic timescales scale relevant to the second law of thermodynamics on the universal scale.
So what is left is an energy balance in the little crust in a highly non equilibrium system. Burning fossils tempers with this balance in one direction, renewable energy avoids this channel.
A: Some existing answers are quite good but I want to get straight to the heart of the situation. It is that there are huge energy exchanges going on as sunlight arrives at Earth and is absorbed and re-radiated. World energy consumption by human activities, averaged over a year, is around $18 \times 10^{12}$ joules per second. But solar energy arriving at the Earth's surface is larger than that by about a factor 6500. So human impact on the thermodynamics here is not by creating heat, it is by modifying the ability of the atmosphere to absorb electromagnetic energy in the infra-red region.
The word 'renewable' here is perhaps not the most apt term. A better term would be 'sustainable'. The problem is not that oil, coal and gas will run out; the problem is that the amount we already have access to underground would overheat the planet if burned. It does this not by generating heat directly but by adding to the greenhouse gases and thus modifying the overall absorption from the Sun. The Earth is like someone sitting in a fridge (the universe overall) with a nearby white-hot radiator. They have a coat on (the atmosphere). If they add a layer to their coat they will overheat.
Sustainable power-generation methods such as solar power obey thermodynamics of course. They just skim off a little energy from the sunlight and put it to use, largely without generating greenhouse gases. If they cause a little more absorption overall of solar energy (which they do not necessarily have to do---the ground absorbs sunlight pretty well after all) then they would cause a slight net increase of energy absorbed and thus heating. But this would be a tiny effect compared to the energy exchanges associated with the atmosphere. To mitigate such an effect one could take action to reduce the amount of greenhouse gases and thus reach a break-even. That is the future we can now work towards if we chose.
A: It's useful to think in terms of three categories: heat in, heat out, and heat generated.
For the Earth's surface the heat input is solar radiation. The radiation itself is fairly constant, but what we care about is the radiation absorbed by the surface as heat. Clouds and ice reflect the sun's light and any light reflected is not absorbed. Thus melting ice or reduced cloud cover will increase the heat in.
Next, the heat out is thermal radiation from the Earth's surface. It's important to realise that the amount of radiation generated increases with temperature, that is the hotter the Earth is the faster it loses that heat. The portion of the radiation that escapes the atmosphere is affected by the amount of greenhouse gas in the atmosphere, and the more greenhouse gases the less radiation escapes.
From these two things we immediately see why carbon emissions are having an effect on our climate. Increasing the amount of greenhouse gas means the heat out is reduced, but the heat in is unchanged. This imbalance causes the temperature to rise until balance is restored. This restoration will come from the increase in thermal radiation that comes from the higher temperature of the earth. Therefore carbon emissions create a long-term change in the Earth's surface temperature.
The heating method you propose falls into the final category, heat generated. If heat is being generated at the Earth's surface then yes, the temperature will rise until the thermal radiation balances both the solar radiation and heat generation. However, if we turn off the heat generators then the temperature will return to normal. In particular, if we generate the same amount of heat every year then the temperature will plateau at some equilibrium value.
This is the fundamental difference. At present our global economy depends on increasing the global temperature by a certain amount every year. In this way the temperature continues to rise. With renewables, the global temperature rises by a fixed, small amount. That is, a coal power plant increases the global temperature every year it is on, whilst a nuclear power plant increases the global temperature when you turn it on, and the temperature drops when you turn it off.
Finally, it's worth realising that solar power, for example, may actually cool the planet in some cases. The heat in from solar radiation is turned partly into heat and partly into electricity, whereas otherwise it would have been turned purely into heat. Thus we reduce heat in cooling the planet. Eventually, though, that electricity may heat something up, meaning we are net neutral on heat.
Edit
For clarity, above I meant that a fixed amount of renewable power (like nuclear) raises the temperature by a fixed amount. To discuss the case of a growing economy, I'll use a simple mathematical model. Let $P$ denote the total energy/time (power) going into heating the planet, that is solar radiation and heat generation by humans. Let $T$ denote the average global temperature. Then, at equilibrium, because the thermal radiation of the Earth goes as the fourth power of temperature, we have
$$
\frac{P}{P_0} = \left( \frac{T}{T_0} \right)^4
$$
where $P_0$ is a reference power and $T_0$ is a reference temperature at which the planet is in equilibrium. Thus increasing the power by an amount $\Delta P = P - P_0$ results in an increase in temperature $\Delta T = T - T_0$ of
$$
\Delta T = T_0 \left(\left( 1 + \frac{\Delta P}{P_0} \right)^{1/4} -1 \right)
$$
Now, the Earth receives about 174 petawatts (PW) (cite) or $P_0 = 1.74 \cdot 10^{17}\ W$ of power from the sun. The total energy consumed by all peoples on Earth is 158,000 terrawatt hours per year (TWh/y) (cite) or $\Delta P = 1.80 \cdot 10^{13}\ W$ of power. The average global temperature in the late 1800s was $T_0 = 13.7\ ^{\circ}C = 287\ K$ (cite). Plugging our numbers into the equation we obtain that the contribution of heat generation to global warming is
$$
\Delta T = 0.00742\ ^{\circ}C
$$
That isn't very much. It is entirely possible that the global temperature will rise by $\Delta T = 5\ ^{\circ} C$ by 2100 (cite). Keeping $P_0$ and $T_0$ the same, to obtain this much of a temperature rise purely by heat generation would require
$$
\Delta P = P_0 \left( \left( 1 + \frac{\Delta T}{T_0} \right)^{4} - 1 \right) = 1.24 × 10^{16}\ W
$$
or 691 times more power than the human race currently uses. This would all have to be newly generated power that wouldn't turn into heat without human intervention, so no solar or wind or geothermal or tidal counts here. Basically this is how much nuclear power (fission or fusion) we can use before it becomes as big a problem as carbon emissions.
This is just to stress that, because this is such a simple mathematical model, the error in the numbers will be quite large, say $20-30 \%$ or so. The point is not the details of the digits, but the size of the number.
A: 
These trap a lot more of the incoming solar energy than otherwise would have been the case, leading to global warming. OK. So we need to move to solar, wind, nuclear, etc.

It's not so much about trapping the incoming solar energy so much as trapping the outgoing infrared energy.  That energy emitted into space is is why the temperature of the Earth isn't continually increased by incoming solar energy until it's white hot.  Greenhouse gases absorb that outgoing energy and bounce some of it back towards the surface or in other directions.
Think about an incoming photon of light from the sun.  That photon excites an atom in a solar cell (or in a tree, a rock, the ocean, snow, or anything as long as it doesn't get reflected).  This electrical energy is converted into vibrational energy we know as heat.  If that was the end of the story, the temperature of the Earth would continually increase due to the incoming energy from the sun.
However the materials that make up the Earth emit infrared radiation.  This causes them to cool.  Without input from the Sun (and without internal heating due to nuclear reactions) the Earth would eventually cool down towards the temperature of the cosmic microwave background radiation.
Greenhouse gases are particularly good at absorbing this infrared radiation, preventing it from leaving the Earth and thus causing a warming of the system.  If you paint one board black and one board white and leave them in the sunlight, the black one will become warmer than the white one.  This is because black absorbs more of the wavelengths of light coming from the sun and white absorbs less and reflects more.
Most of our atmosphere is mostly transparent to the wavelengths of infrared radiation emitted by the Earth, but greenhouse gases absorb them like the black paint absorbs sunlight, warming the atmosphere.  When this gas then emits infrared radiation to cool down it can be emitted in any direction, and may be emitted back towards the surface.
This is very much like covering yourself in a blanket on a chilly night.  You are not generating more heat than you would without the blanket, but the blanket is trapping the heat in an enclosed area, causing the overall temperature to increase.  This can be observed over the course of a winter.  Generally the clear nights can get much colder than cloudy nights.  This is because clouds are mostly water vapor, a potent greenhouse gas.  This helps reflect some of the infrared radiation that is being emitted from the cooling ground from making it to space.

But the second law implies that we can only extract some finite amount of energy for useful work, and the rest invariably goes to heat (right?). Solar panels, batteries, wind farms, etc. all presumably leak all unconverted energy into heat. And a lot of this energy is coming from 'outside' the biosphere. So doesn't that mean that even with renewable sources, we will inevitably leak heat into the biosphere leading to at least some global warming?

Whatever power generation we use will indeed tend to raise the temperature.  This can be a problem locally with water used to cool power plants raising the temperature of individual rivers for instance, but it is currently, and for the foreseeable future, dwarfed by the warming we receive from the sun. According to wikipedia, world-wide energy consumption was 162,494 terawatt-hours in 2017.  The sun continuously pumps about 173,000 terawatts of solar energy into the Earth.  That's roughly 9,000 times the energy we produce.  There are science fiction stories where energy generation actually performs enough direct warming to affect the climate, but we're a long way from that.
But think about solar cells.  They convert some of that incoming solar energy into electrical energy.  When this is used to power a car for instance, it does get converted eventually into heat.  However that energy would have been converted to heat initially anyway if it wasn't converted to electrical energy by the solar cells (or reflected into space).  So that is not actually causing as much warming as fossil fuels or nuclear.
The Earth achieves an equilibrium temperature with various forces affecting it.  Energy comes in mainly from the Sun, and energy goes out mainly from thermal radiation to space.  Anthropomorphic energy generation is a very small part compared to others.  To use common units, let's take numbers as watts per square meter of the Earth's surface.  A common space heater here in the US is 1500 watts full power, so I'll also give the numbers as if the Earth were covered in space heaters with a heater covering a certain area.

*

*The Sun - average 340 watts, one space heater ever 4.5 square meters (ref)

*Greenhouse Gases - average 2.3 watts, one space heater every 650 square meters or about 22 meters by 30 meters (ref)

*Human energy consumption - average 0.036 watts, or one space heater every 42,000 square meters or about 8 American football fields (calculated based on 160,000 terawatt hours per year, divided by hours in a year, divided by area of the Earth's surface in square meters)

A: The problem is that heat is supposedly trapped in the atmosphere by these greenhouse gases. This prevents energy from escaping the earth since earth emits heat into space from its surface as well as from the atmosphere (Earth is not an isolated system).
Also, the disordered heat or energy released through the operation of renewable energy devices is extremely small by comparison to that absorbed from the sun.
A: 
So doesn't that mean that even with renewable sources, we will inevitably leak heat into the biosphere leading to at least some global warming? So isn't it really only a difference of scale in terms of the warming that is caused by greenhouse gases from FFs vs. from renewables? Won't we always heat up the surface, no matter how efficient we get?

As others have answered, that solar energy was going to heat up something. Converting it to work first doesn't change that much.
But what if it was as you say and solar panels did add to the Earth's heat budget? They don't, but what if they did? Which would heat the Earth more? Adding heat by "trapping" solar energy (again, doesn't work like that, but let's pretend), or the radiative forcing due to greenhouse gases? Let's look at some numbers.
Annual world energy production is roughly $5\cdot 10^{20}\ J$. If we converted totally to solar, our fictional solar panels would be adding that much extra heat (again, solar panels do not add to the Earth's energy budget). How does that compare to radiative forcing?
The Earth receives that much energy from the Sun about every hour. Since 1750 we've added enough greenhouse gases to trap about an extra 3 watts/m2, and climbing rapidly. The Earth has an area of about $5 \cdot 10^{14}\ m^2$. Multiply them together and greenhouse gases are piling on $1.5 \cdot 10^{15}\ \text{watts}$. A watt is a joule per second. There's roughly $3.15 \cdot 10^{7}$ seconds per year. Multiply them together and that's about $5\cdot 10^{22}\ J$ extra heat due to greenhouse gases.
Greenhouse gases trap about 100 times more energy than we use. So even if it did work as you wondered (it doesn't), it would still be a huge benefit to switch from fossil fuels to renewables and reduce our greenhouse gas emissions. The truly enormous scale of global warming is important to keep in mind when discussing the merits of possible solutions.
A: Any such theory would rely on the requirement that inefficiency of renewable is equal or of similar magnitude to the improved trapped energy radiated by the sun due to additional CO2 content of the atmosphere.
Additionally you are talking about the heat from the conversion, not say heat from electrical resistance.
A: Solar and Wind won't but nuclear fission and fusion would if we used a lot of it.
Since solar and wind energy is already coming from the sun, this energy is basically already going to turn to heat anyway without us doing anything.
Fission and fusion however create another source of energy distinct from the sun, so the waste heat from this would add to global temperatures. However we would need to use way more energy than we currently do, for this to be noticable (Eddy's answer estimates this at around 691 times more energy than we use now for a 5∘C temperature rise).
A: There is no increase in heating from solar or wind power, because they're using energy that's already in the system.  Yes, it all eventually gets converted to heat--but it would anyway.  Sunlight not falling on solar panels would fall on something else; wind hitting wind turbines would otherwise run into buildings, trees, or mountains.
A: The CO2 absorption band is already practically "saturated", so adding more CO2 to the atmosphere doesn't have nearly as large of an effect as you imply.
Also, some sunlight is reflected back into space, and some sunlight is absorbed by the ground.  The absorbed sunlight heats the ground and that heat must be radiated to space in the IR wavelengths.  If you implement renewable energy devices that capture sunlight that would have heated the ground (e.g., solar cells), you will get some work out of those devices before that sunlight heats the surrounding environment or the ground and the net effect on global warming should be zero.  If, on the other hand, your renewable energy device absorbs sunlight that would have been reflected to space, there may be a small increase in global warming, but it is doubtful that the effect would be large enough to be easily measurable.
