Can diffusion produce energy? A friend and I recently got into a silly argument where I stated 

pure diffusion can't produce energy since diffusion are a part of passive transport.

He stated if we 

If we have tinny turbine which allow to transfer only one molecule at a time due to the different concentration the molecule will make turbine rotate and produce energy (which I thought this assembly will be a non-permeable since direct  contact is must in diffusion )

On the other hand we encounter some research trying to produce energy by differentiating level of water separated by a semi-permeable. And they accomplish producing energy how that happen (I think they give an energy in another way by differentiating concentration and they collect this energy. It is only an engineering)
 A: It depends what you mean by diffusion.
If you're considering a system at equilibrium, e.g. a sodium chloride solution, and you're trying to extract energy from the diffusional motion of the sodium and chlorine atoms then you can't extract any energy. Your friends idea of a tiny turbine is effectively the same as the Maxwell's demon idea for extracting energy from the thermal motion of gas molecules.
On the other hand, if you're considering a non-equilibrium system, e.g. where there is a concentration gradient, of a solute then yes you can extract energy from this. The easiest way would be to use a semipermeable membrane as you describe.

If your semipermeable membrane allows solvent through but not the solute, then there will be a net flow of solvent from the low concentration to high concentration side. This creates an osmotic pressure so there is a force on the membrane, $F$. Allow the membrane to move a distance $x$ and you can extract some work $W = Fx$.
A: If there is a concentration difference in a closed system then from that difference, energy can be extracted. And the sum of the energy extracted would be equal to the energy that made the system imbalance in the first place.
For example suppose there is a room full of Nitrogen and Oxygen molecules and there is a membrane dividing the room letting Nitrogen molecules to pass but not letting the Oxygen molecules. Somehow i brought an Oxygen magnet and managed to pull all the Oxygen molecules to one side of the room. If i let go the Oxygen molecules, then the Oxygen molecules will want to go back to the other side of the room, too, to make it equilibrium again, that is called diffusion. Suppose i have tiny Oxygen turbines, then i could regain the energy while the diffusion occurs. And the amount of that energy would be equal to the energy i input to make it imbalance initially.
An implementation example of this concept could be read here:  https://en.wikipedia.org/wiki/Osmotic_power
