Coffee grounds can be an excellent addition to a compost pile. The grounds are relatively rich in nitrogen, providing bacteria the energy they need to turn organic matter into compost. About 2 percent nitrogen by volume, used coffee grounds can be a safe substitute for nitrogen-rich manure in the compost pile.
Source: www.sciencedaily.com