Design of a solar-harvesting circuit for batteryless embedded systems