The delusion capsules? You don't get access to the machine until 2-2/2-3. You gain memories through certain scenarios, like in My Room, completing a chapter or for a certain one, explore the area before you leave for the next chapter(refer to guide)
If you're talking about the capsule for upgrading, then you gain SP through either leveling up by defeating/ killing enemies, filling up the book or getting 100 affection with the demons you befriend in My Room.
The battery is straight forward for the most part. The first one where you fight Lampas is obvious. The ones following up after getting the lantern are located like this;
-When you enter the room, make your way to the far right and you should see a ladder, go down that ladder and then make your way to the far left, you should see the battery there, continue this process to progress through the chapter.
Again the guide will help you a lot when you're stuck.