Biological light-driven ion pumps move ions against a concentration gradient to create a membrane potential, thus converting sunlight energy directly into an osmotic potential. Here, we describe an artificial light-driven ion pump system in which a carbon nitride nanotube membrane can drive ions thermodynamically uphill against an up to 5000-fold concentration gradient by illumination. The separation of electrons and holes in the membrane under illumination results in a transmembrane potential which is thought to be the foundation for the pumping phenomenon. When used for harvesting solar energy, a sustained open circuit voltage of 550 mV and a current density of 2.4 μA/cm2 can reliably be generated, which can be further scaled up through series and parallel circuits of multiple membranes. The ion transport based photovoltaic system proposed here offers a roadmap for the development of devices by using simple, cheap, and stable polymeric carbon nitride.