Another option is weight - trigger a microswitch as the piece is placed on the board. Easy digital reading, guaranteed no interference with neighbouring parts but more complex to install and it has moving parts. Or even visual - camera mounted above the board.