Soft biological tissues perform various functions. Sensory nerves bring sensations of light, voice, touch, pain, or temperature variation to the central nervous system. Animal senses have inspired tremendous sensors for biomedical applications. Following the same principle as photosensitive nerves, we design flexible ionic hydrogels to achieve a biologic photosensor. The photosensor allows responding to near-infrared light, which is converted into a sensory electric signal that can communicate with nerve cells. Furthermore, with adjustable thermal and/or electrical signal outputs, it provides abundant tools for biological regulation. The tunable photosensitive performances, high flexibility, and low cost endow the photosensor with widespread applications ranging from neural prosthetics to human–machine interfacing systems.