Designer DNA nanodevices have attracted extensive interest for detection of specific targets in living cells. However, it still remains a great challenge to construct DNA sensing devices that can be activated at desired time with a remotely applied stimulus. Here we report a rationally designed, synthetic DNA nanodevice that can detect ATP in living cells in an upconversion luminescence-activatable manner. The nanodevice consists of a UV light-activatable aptamer probe and lanthanide-doped upconversion nanoparticles which acts as the nanotransducers to operate the device in response to NIR light. We demonstrate that the nanodevice not only enables efficient cellular delivery of the aptamer probe into live cells, but also allows the temporal control over its fluorescent sensing activity for ATP by NIR light irradiation in vitro and in vivo. Ultimately, with the availability of diverse aptamers selected in vitro, the DNA nanodevice platform will allow NIR-triggered sensing of various targets as well as modulation of biological functions in living systems.