Various devices for sterilizing a surface and an object in contact with the surface are disclosed. For example, a first device includes an ultraviolet light source, a touch sensor, a processing system, and a computer-readable medium. The computer-readable medium stores instructions which, when executed by the processing system, cause the processing system to perform operations that include detecting, via the touch sensor, a tactile state of the device, detecting a tactile state of at least one additional device, determining, based upon the tactile states, that the device is on an edge of a pattern of contact between an object and a surface comprising the device and the at least one additional device, and implementing an action associated with the ultraviolet light source in response to determining that the device is on the edge of the pattern of contact.