The role of repetitive firing in neurophysiologic or neuropsychiatric disorders, such as Parkinson, epilepsy and bipolar type disorders, has always been a topic of medical research as therapies target either the cease of firing or a decrease in its frequency. In electrotherapy, one of the mechanisms to achieve the purpose in point is to apply a low density electric current to the nervous system. In this study, a computer simulation is provided of a treatment in which the stimulation current is computed by nerve fiber cell membrane potential feedback so that the level of the current is automatically instead of manually adjusted. The behavior of the nerve cell is represented by the Hodgkin-Huxley (HH) model, which is slightly modified into a linear model with state dependent coefficients. Due to this modification, the algebraic and differential Riccati equations can be applied, which allows an optimal controller minimizing a quadratic performance index given by the user. Using a controlled current injection can decrease unnecessarily long current injection times that may be harmful to the neuronal network. This study introduces a prototype for a possible future application to a network of neurons as it is more realistic than a single neuron. (C) 2010 Elsevier Ireland Ltd. All rights reserved.