The Internet of Things (IoT) requires non-pollution energy sources to power small electronic devices. These energy sources can be harvested using triboelectric nanogenerators formed by lightweight and eco-friendly components. Herein, we develop a novel triboelectric layer of coffee grounds for a triboelectric nanogenerator with ability to harvest the vibration energy and transform it into electrical energy. This layer of coffee grounds has a simple electromechanical configuration that simplifies the collocation of the nanogenerator on irregular topologies of vibration sources. This device uses sustainable and eco-friendly components, achieving a stable electromechanical behavior close to 22500 operating cycles. With a load resistance of 39.97 MΩ, our device can generate an output power density of 75.48 mWm−2 under vibration of 3 g at 25 Hz. This device lighted 116 blue commercial LEDs and powered a thermohydrometer and a digital chronometer. Furthermore, an emergency alarm button with Arduino was implemented using the nanogenerator. The proposed device can be used to generate low-cost sustainable energy for applications in IoT devices.