Context : Aims : We take advantage of the capability of the OTELO survey to obtain the H \alpha luminosity function ( LF ) at { z } \sim 0.40 . Because of the deepest coverage of OTELO , we are able to determine the faint end of the LF , and thus better constrain the star formation rate and the number of galaxies at low luminosities . The AGN contribution to this LF is estimated as well . Methods : We make use of the multiwavelength catalogue of objects in the field compiled by the OTELO survey , which is unique in terms of minimum flux and equivalent width . We also take advantage of the pseudo-spectra built for each source , which allow the identification of emission lines and the discrimination of different types of objects . Results : The H \alpha luminosity function at z \sim 0.40 is obtained , which extends the current faint end by almost 1 dex , reaching minimal luminosities of \log _ { 10 } L _ { lim } = 38.5 erg s ^ { -1 } ( or \sim 0.002 \text { M } _ { \odot } \text { yr } ^ { -1 } ) . The AGN contribution to the total H \alpha luminosity is estimated . We find that no AGN should be expected below a luminosity of \log _ { 10 } L = 38.6 erg s ^ { -1 } . From the sample of non-AGN ( presumably , pure SFG ) at z \sim 0.40 we estimated a star formation rate density of \rho _ { SFR } = 0.012 \pm 0.005 { \text { M } _ { \odot } yr ^ { -1 } Mpc ^ { -3 } } . Conclusions :