Are you wanting to build something that requires DC power but changing batteries would either be inconvenient or just plain annoying? Here’s a simple how-to for converting AC mains voltage to rectified and regulated DC voltage.
The idea behind it is really simple. We first take AC mains voltage and step it down to about 12-16VAC. That is then passed through a bridge rectifier to flip the negative portion of the AC waveform into positive voltages. On an oscilloscope it looks like a bunch of bumps that swing between 0 and 12VDC. The signal is now DC, but it is really unstable, so we add some capacitors to help keep the voltage up high while the signal from the rectifier swings back low again. As long as the capacitor is large enough to keep the voltage above the input threshold of our voltage regulator, the output from the regulator will be a clean and stable DC voltage that we can now use to power our circuits.
Check out the Instructable!