In a study published in Science Magazine, researchers report that using a small so-called ‘minidosimeter’ can tell you whether you’re getting too much sun.

The device—which looks like a button—sticks directly to skin or clothes, even when they’re wet. It uses a photodiode, a kind of semiconductor that converts light into electricity, to not only measure the sunlight to which it’s been exposed for power, eliminating the need for batteries. A tiny antenna sends measurements wirelessly to the user’s smartphone.

Science Magazine writes that Tthe researchers tested the technology with volunteers that wore multiple chips on different parts of their bodies while participating in a variety of outdoor activities, like hiking and swimming, over 4 days. They also wore a larger, traditional dosimeter for comparison.

Sensors could be fabricated in different shapes and sizes, could capture UVA and UVB exposure for clinical phototherapy, and could measure blue light exposure on infants with jaundice during bilirubin phototherapy. This wireless sensor platform technology enables high precision tracking of instantaneous and cumulative light exposure.

– The researchers conclude.

Based on the results, the research team concluded that the minidosimeter performed just as well as the bigger models and that the device could even have applications beyond the beach, for example monitoring the therapeutic light treatment given to preterm infants with jaundice.