Here's a slightly more robust circuit diagram that includes some important additions for stability and protection: