Confused about charge seperation in solar cells I'm a bit confused about how solar cells work. 
My understanding is that there is a p-n junction. A photon is absorbed which creates an electron-hole pair, and the idea is to separate the electron and hole before they recombine in order to produce current.
n-type materials are doped with extra electrons and p-type materials are doped with holes. So why is that in all the diagrams I see, when charge separation occurs, electrons are conducted through the n-type material and holes are conducted through the p-type material? Shouldn't it be the other way round?
 A: It's not quite correct to say that n-type materials are doped with "extra" electrons.  To be sure, n-type material is charge neutral.  It's more correct to say that n-type material is doped with atoms that "donate" an electron to the conduction band; n-type material has excess mobile electrons versus intrinsic material.  So, naturally, n-type material is a good conductor because there are plenty of mobile electrons to participate in an electron current.
p-material is doped with atoms that "accept" an electron from the conduction band so there is a deficit of mobile electrons and thus you would not expect there to be much mobile electron current.  However, there are plenty of "holes" that can participate in a "hole" current.
Now, with respect to your question.  When an EHP is generated in either type of material, the material remains charge neutral.  However, if the EHP is separated by the intrinsic E-field of the PN junction, there is no longer charge neutrality.  When an EHP is generated, it is the minority carrier that will be swept across the junction to become a majority carrier on the "other side". Since there is no longer charge neutrality, charge will flow in an external circuit to restore it.
