For batteries and energy storage devices, elucidating a microscopic detail of an electrochemical reaction that takes place at the electrode and electrolyte interface is important to improve the performance of the electrochemical devices. Although a first-principles calculation is a realistically feasible way to study the electrochemical reaction, it is still difficult to conduct a direct simulation of those devices in working conditions. There are two major difficulties in practical simulations: First, it is difficult to describe the electric field near the electrode surface which is generated in the electric double layer (EDL); second, it is difficult to control the applied bias potential during the simulation. The former is known to be incompatible with the periodic boundary condition used in the first-principles simulation. The latter requires a technique to control the Fermi energy of the electrode on the fly. In 2006, we proposed a method to incorporate the electric field in the EDL with the periodic boundary condition by solving the Poisson equation using Green’s function method, which is called effective screening medium (ESM) method [1]. Using this technique, we successfully simulated an electrochemical reaction which is driven by the strong electric field at platinum-water interface [2]. To address the second issue, we have developed a simulation scheme for performing a first-principles calculation at a constant electrode potential in which we can control the Fermi energy of the electrode, i.e. bias potential, by connecting the system to a potentiostat [3]. We call our constant electrode potential technique as the “constant-μ” method, where μ denotes the Fermi energy (chemical potential for electrons in a metallic system). The most intuitive way to control the Fermi energy of the system is to fix the Fermi energy to the target Fermi energy (μext) during the self-consistent field (SCF) calculation. But this strategy will fail within a few SCF steps. To realize a stable and robust calculation, we employed the extended system technique which is usually used in the constant temperature and constant pressure molecular dynamics simulation. We assume that the charge in the simulation cell is a dynamical variable; we call this the fictitious charge particle (FCP) [3]. This assumption means that the system is conceptually connected to a charge reservoir and is governed by the following grand potential instead of the total energy: Ω = E tot – μext n FCP, where E tot, μext and n FCP indicate the total energy, the target Fermi energy, and the charge of the FCP. By taking the derivatives of the grand potential Ω with respect to atomic position (τ) and n FCP, we can calculate the generalized forces acting on, respectively, atom, F atom=–dE tot/dτ, and the FCP, F FCP=–(μ–μext), where μ is the instantaneous Fermi energy. Since the deviation of the Fermi energy from the target potential is acting as the restoring force for the FCP, F FCP drives n FCP so that the Fermi energy of the system goes to μext. Once we can define the forces, we can combine the constant-μ method with both dynamical and static first-principles calculations. If one needs to simulate dynamical aspect of the electrochemical system, we can conduct a molecular dynamics (MD) simulation with the constant-μ method. By introducing a constrained dynamics such as the blue-moon ensemble method [4], we can calculate the free energy difference and activation free energy of an electrochemical reaction. In the static calculation, minimization of the grand potential results in a generalized optimization problem with atomic and FCP systems. Besides the geometry optimization process for atoms, we need to optimize n FCP along with F FCP so that the Fermi energy of the system corresponds to the target Fermi energy. If one needs to calculate the grand potential difference and activation energy of a reaction, we can combine the nudged elastic band (NEB) method [5] with the constant-μ method. In the presentation, I will give an overview of the method and show some applications for dynamic and static calculations, such as the solvation/desolvation process of the Li-ion and an atomic diffusion on electrode surface under a bias potential.