Engineers have developed a wearable device that allows humans to harness energy to power small electronics while they sleep.