Two-dimensional layered materials have gained significant attention in recent years as novel materials. By fabricating devices from these materials and evaluating their electrical and optoelectronic properties, we can preliminarily assess their potential applications in electronics and optoelectronics. This paper analyzes the physical properties of two-dimensional black phosphorus from both electronic and optical perspectives. Optoelectronic devices based on black phosphorus are fabricated, and their applications in basic photonics and bio-photonics are explored. A tunneling acceleration sensor is developed by integrating two-dimensional black phosphorus with a cantilever beam structure. The sensitivity, repeatability, and response time of the sensor are tested through simulation experiments. The experimental results show that the photocurrent of the 2D black phosphorus-based photodetector increases from about 103