The contradiction between the high number of visually handicapped people and the scarcity of guide dogs has stimulated the demand for electronic guide dogs (EGDs). Here, we demonstrate an EGD by leveraging piezoresistors on a MoS2/Ge heterostructure for simultaneous pressure-sensing and optical-sensing functions. The device has excellent gating capability and exhibits large positive and negative photoresponses under visible (532 nm, 182 A/W) and infrared (1550 nm, 37 A/W) illumination. These characteristics allow the device to efficiently classify different obstacles at all times of day using pressure and light signals. The device reaches nearly 100% accuracy after 48 training sessions when used to classify frequent scenes. The device adopts passive and active detection modes during the day and night, respectively, which improves the battery life of the EGD. This work provides a significant reference for the future design of EGDs, which may help a greater number of visually impaired people by reducing the cost of such devices.