The voltage sensor pictured at the left is composed of transmembrane segments S1, S2, S3 and S4 , its function is to sense the membrane electric field by its charged groups. Most of the sensing is done by the outermost positive charges (arginines, blue) of the S4 segment (although one negative charge (E293) of the S2 segment also contributes, by shaping the electric field seen by the sensor).
When the membrane voltage is changed, the charges move from the inside (down) to the outside (up) depending on the membrane potential crossing an hydrophobic plug, made by the side-chains of residues in segments S1, S2 and S3.
A simplified view of the sensor is shown as a cartoon (bottom left). The hydrophobic plug (in green) separating the inside from the outside is where most of the voltage drop occurs.
While at the resting membrane potential (negative inside), the positive charges of S4 are attracted to the inside (this is the resting position)
When the internal membrane potential is near zero or positive, the positive charges of the S4 segment are attracted to the extracellular side (this is the active position).