I have conducted robotics workshops for children. Children are assembling robo-cars. Each car has 6 batteries. When batteries ran low, I give the children new ones. The children mix them up every damn time. As a result of all this chaos after several workshops I had a box with a hundred batteries, and I had to manually check them to find the bad ones and dispose of them.
Then I dreamed of some kind of machine that would do this nasty job for me. Here, finally, I made it.
You put batteries into the tray. The servo pushes the battery forward. Second servo measures the voltage of the battery. The third servo operates the door to sort the batteries into two piles: dead ones and good ones.