We study a new class of ergodic backward stochastic differential equations (EBSDEs for short) which is linked with semi-linear Neumann type boundary value problems related to ergodic phenomena. The particularity of these problems is that the ergodic constant appears in Neumann boundary conditions. We study the existence and uniqueness of solutions to EBSDEs and the link with partial differential equations. Then we apply these results to optimal ergodic control problems.