Learning is usually associated with a complex nervous system, but there is increasing evidence that life at all levels, down to single cells, can display intelligent behaviors. In both natural and artificial systems, learning is the adaptive updating of system parameters based on new information, and intelligence is a measure of the computational process that facilitates learning. Stentor coeruleus is a unicellular ponddwelling organism that exhibits habituation, a form of learning in which a behavioral response decreases following a repeated stimulus. Stentor contracts in response to mechanical stimulation, which is an apparent escape response from aquatic predators. However, repeated low-force perturbations induce habituation, demonstrated by a progressive reduction in contraction probability. Here, we introduce a method for quantifying Stentor habituation using a microcontroller board-linked apparatus that can deliver mechanical pulses at a specified force and frequency, including methods for building the apparatus and setting up the experiment in a way that minimizes external perturbations. In contrast to the previously described approaches for mechanically stimulating Stentor, this device allows the force of stimulation to be varied under computer control during the course of a single experiment, thus greatly increasing the variety of input sequences that can be applied. Understanding habituation at the level of a single cell will help characterize learning paradigms that are independent of complex circuitry.