An autonomous microfluidic metal-ion sensor is demonstrated using an electrochemical system integrated with a compact photovoltaic cell power supply. The sensor uses electrodeposition to remove ions from the fluid around the sensor and deposit them on an electrode at the tip of a cantilever, which changes the resonant frequency. The sensor is designed to be dropped in liquids or flow through microfluidic systems. The photovoltaic cells are directly integrated on the device and are capable of producing tens of microwatts of power at about 15% efficiency with laser excitation. However, the sensor operates using only scavenged daylight or room light at power levels of 50nW. The complete device is integrated into a total volume below 0.046mm3, which is more than two orders of magnitude smaller than any autonomous electrically-powered sensor reported to date. Individual particles detect metal ion concentration within a factor of two of the actual concentration, making them suitable for safety testing and endpoint monitoring among other applications.