A 1x1 brick is 8 mm by 8 mm width, and 9.6 mm (3x 3.2) high.
The stud on top of a brick has 4.8 mm ⌀, and is 1.8 mm high.
LEGO Power Functions
See e.g. https://www.philohome.com/tech.htm
LEGO power functions works with 9V. A cable has 4 wires: 9 Volt, ground, C1 and C2. C1 and C2 are either 0 Volt or +9 Volt, and are used to power motors or lights.
Speed of motors are controlled with a pulse width modulation (PWM) on C1 and C2.