Cartridge presence detection or type identification