Light can generate an electrical current in semiconductor materials. This is how solar cells generate electricity from sunlight and how smart phone cameras can take photographs. To collect the generated electrical current, called photocurrent, an electric voltage is needed to force the current to flow in only one direction.