A cap for a medication container includes a housing with a top portion and a bottom portion. The top and bottom portions together define a cavity therebetween. A sliding plate is disposed in the cavity adjacent the bottom portion. A microcontroller with a contact sensor is disposed in the cavity between the top portion and the sliding plate. The sliding plate is configured to slide toward and activate the contact sensor where the cap is secured to the medication container in a closed state. The sliding plate is also configured to slide away from and not activate the contact sensor where the cap is removed from the medication container in an open state.