A very simple encoder circuit for a dc motor can be constructed using this circuit diagram . As you can see in the circuit diagram , the system shown consists of the HA-2542, a small 12-Vdc motor, and a position encoder. During operation, the encoder causes a series of ''constant-width" pulses to charge CI. The integrated pulses develop a reference voltage, which is proporţional to motor speed and is applied to the inverting input of HA-2542, The noninverting input is held at a constant voltage, which represents the desired motor speed. A difference between these two inputs will send a corrected drive signal to the motor, which completes the speed control system loop.
As you can see the circuit requires few external components , but because of the encoder wheel it has a limitations of use .If you put a pulley under the encoder wheel you can command the speed of other device , by connecting the (motor and other device ) using a belt