Connection of batteries