Converting 12v to smooth 5v?
The type of device you're looking for is called "voltage regulator". It is an integrated circuit where the input is a certain voltage (eventually not stable over time, due to temperature changes or other causes), and it outputs a steady (i.e. constant) valute of voltage. In your case, you need to convert a possibly fluctuating value around 12 V to a constant value of 5 V. As suggested in another answer, you could use the uA7805 model of the uA78xx series.

As suggested in Figure 1 of the datasheet at this link, you also need a couple of capacitors to make it work properly.