Using solar panel is a great way to harvest energy. But you cannot connect panel directly to battery or device. The angle of sun changes constantly, clouds appear what leads to solar panel output fluctuations. This is why a charge controller or inverter is used which takes care of smooth energy flow. Debasish Dutta have been successfully experimenting with solar energy harvesting and so he built solar charge controller.
He put Arduino to control the process. It takes voltage reading from solar panel and battery to be charged. Then according to voltage levels on either side he charges battery using PWM control signal. Energy flow is driven with MOSFET transistors that ensure low energy loss. He put significant effort in selecting right MOSFETs by going through transistor parameters and finding proper ones. Also his charging controller is equipped with basic filters on both – battery and solar panel sides. It seems really simple but efficient solution for hobby level use.