Diffused double-layer heterojunction battery