Over 25 million Americans live with asthma. Many forget to or choose not to adhere to their asthma prescriptions, leading to unnecessary hospital visits and $700 to $4,000 per patient per year in preventable medical costs, according to the CDC.

But a new device by MIT spin-off company Gecko Health is hoping to change all that. Meet the smart inhaler, CareTRx. It’s a small cap “equipped with sensors and onboard memory” that users attach to their inhaler. Every time the inhaler is used, CareTRx records the information and sends it to the CareTRx app.

The app informs users when they’ve missed a dose, and reminds them when it’s time to take a dose (in fact, the CareTRx cap even lights up). The app also awards users badges when they adhere to their prescription. And it tracks useful information such as percentage of adherence, potential triggers, peak flow, and symptoms.

“The idea is to make things very transparent and easy to understand,” said physician and Gecko Health CEO Yechiel Engelhard. “Anything to make you a smarter patient.”

Users have control of the information gathered, but are given the option of sharing it with their health care provider and/or anonymously sharing it with researchers.

CareTRx was first developed at a hackathon where it was called Chameleon and came with an app game that gave children points for properly using their inhaler. Over the years Engelhard and his team refined it, adding many new innovations like long battery life so the device doesn’t require constant charging.