The Food and Drug Administration has approved the first drug in the US to come with a digital ingestion tracking system. The pill is embedded with a tiny sensor about the size of a grain of sand that lets doctors know if and when a patient has taken their medication.

Abilify MyCite is used for the treatment of schizophrenia, manic and mixed episodes associated with bipolar I disorder, and as an add-on treatment for depression in adults.

The pill works by generating an electrical signal when it hits a patient’s stomach acid. This is picked up by a wearable patch—worn on the left rib cage and replaced after seven days—which then sends the information to a smartphone app that allows patients to track when they took their medication.

Providing they sign a consent form, patients can allow up to four other people, including their doctors, caregivers, and family members, to access the data via a web-based portal.

“Being able to track ingestion of medications prescribed for mental illness may be useful for some patients,” said Mitchell Mathis, M.D., director of the Division of Psychiatry Products in the FDA’s Center for Drug Evaluation and Research. “The FDA supports the development and use of new technology in prescription drugs and is committed to working with companies to understand how technology might benefit patients and prescribers.”

The New York Times reports that the pill contains copper, magnesium, and silicon, all of which are “safe ingredients found in foods.”

While there’s little doubt the system could be of great benefit to those with schizophrenia, there are concerns that it could be used in more controversial scenarios, such as court-ordered medical treatment for parolees. It’s also been pointed out that as schizophrenia symptoms often include paranoia, it’s unlikely that every patient will be willing to take a meditation that monitors behavior in such a way.