We have tried using an LED backwards: not get it to shine by letting an electric current pass through it but produce electricity by shining light on an LED (this is how solar panels work). It’s important to use a sensitive LED for this experiment, and as we have observed, it also seems to be important to use light photons of the same frequency as the colour of the LED (red laser didn’t work on a white LED, but it may have to do with the fact that red light is weaker than white light anyway, i.e. has a lower frequency). The picture below shows us measuring the voltage of the current produced by the LED.



We’ve have learned this and a a lot more from Steve Mould’s video on How diodes, LEDs and solar panels work: Photovoltaic cells and LEDs are both made of diodes. Diodes are designed to allow electricity to flow in one direction only but the way we make them (out of semiconductors) means that can absorb and emit light.
In the video, Steve shows how the semiconductor atoms share elctrons. Semiconductors are crystal structures of atoms are replaced by the atoms of neighboring elements, for example a structure where some silicon (Si) atoms are replaced by phosphorus (P) or boron (B) atoms, thus providing for free electrons inside the structure (N-type conductor) or for free “holes” unoccupied by electrons (P-type conductor). A diode is basically two semiconductors pushed together. With enough voltage, the electrones are able to jump from the N-type semiconductor across the depletion zone and into the P-type semiconductor, emitting light (photons) as they fill the holes and go from a high energy state into the low energy state.
If you shine a light at a diode, you can kick some electrons from their shells and thus create free electrons and holes that will move (because of the electric field in the depletion zone) and generate voltage.