Blind and visually impaired people face several accessibility and mobility problems due to a lack of information from the environment. The environment information could help visually impaired people to avoid physical barriers and identify alternative ways to reach the desired destination. This work proposes an assistive technology device called the electronic long cane to serve as a mobility aid for blind and visually impaired people. The cane has an ergonomic design and an embedded electronic system, which fits inside the handle of a traditional long cane. The electronic system uses haptic sensing to detect obstacles above the waistline. When an obstacle is detected, the cane vibrates or makes a sound. Experiments are conducted and the interaction between blind and visually impaired people and the urban environment is discussed. Experimental data are processed using a J48 classifier. The obtained confusion matrix output shows a satisfactory validation.