charging Li ion battery

It would be easier to simple use a dedicated chip with all the logic (and safety) built into it like an MCP73831 or the like. There are breakout board on the net that are cheap.