This battery holder connects 2 AAA batteries together in series with a built-in ON/OFF switch. 2 AAA's add up to about 2.0-3.0V depending on the type and charge of the batteries.
NOTE: most projects with 3V microcontrollers require between 3.0-4.5V so the 3 x AAA battery holder might be a better choice.