Black phosphorene (BP) has a high specific surface area due to its puckered honeycomb lattice structure, so it has great advantages in gas sensor applications. Doping and defects have a great effect on its sensitivity. Our aim is to obtain an insight into the sensing mechanism of black phosphorene towards CH
2O, a hazardous organic compound. Based on the first-principles method of density functional theory (DFT), the sensing behaviors of the BP system, with intrinsic, Al doped, P vacancy-defected and P-vacancy and Al doping coexistent, before and after CH
2O adsorption are studied. By establishing the structural models of four BP systems, the values of adsorption energy, energy band structure and charge transfer are calculated. Calculation results show that CH
2O molecule prefers to be adsorbed perpendicular to the P vacancy-defected BP nanosheet with oxygen atom on the top site and close to the sheet. For the intrinsic, Al doped, P-vacancy and Al doping coexisting BP nanosheet, the CH
2O molecule tilts towards the sheet surface. It is found that the CH
2O adsorption on intrinsic BP nanosheet (adsorption energy is 0.179 eV) is very weak. In contrast, the adsorption of CH
2O to the BP systems, with P vacancy-defected BP, Al doped, P-vacancy and Al doping coexistent, shows relatively high affinity (0.875, 0.542, 0.824 eV). Thus, Al doping, P vacancy or P-vacancy and Al-doping coexistence can substantially improve the adsorption ability of BP systems towards CH
2O. In order to investigate the sensing mechanism of BP systems, the electronic properties such as the density of states, energy band and charge transfer are calculated. The change of energy gap of intrinsic BP nanosheet before and after CH
2O adsorption is 0.024 eV, and that for P vacancy-defected BP nanosheet is zero. In addition, P atom vacancy has no effect on charge transfer. These suggest that the conductivity of intrinsic BP or P vacancy-defected BP nanosheet has not obviously changed, thereby, they are not suitable for sensor materials. For the BP system with Al doping or the coexistence of P vacancy and Al doping, it is obviously seen that an impurity level is generated in the energy band diagram, the effective band gap is significantly narrowed, indicating that the Al doping improves the sensitivity of BP. In addition, the charge transfer is significantly increased, which changes the carrier concentration and improves the electrical conductivity. Therefore, the BP system with Al doping or the coexistence of P vacancy and Al doping is expected to become a kind of new sensor material.