An electroencephalogram (EEG) is a methodology that provides small metal discs (electrodes) connected to the scalp to detect electrical activity in the brain.
Even when a person is sleeping, the brain cells interact with each other via electrical impulses.