I'm looking to build an autonomous robot car, but needed to set it a difficult problem beyond following a line or avoiding edges. I've settled on getting it to learn to collect objects and drop them off in a fixed area, initially unknown to the robot. The obvious mechanism seems to use a magnet and for the objects to be small iron objects, nails perhaps or small polystyrene blocks tagged with iron tags. The magnet needs to be switchable so the iron can be collected and later dropped off.
First of all I need an electro-magnet controlled by a RPi on battery power only. Secondly, I need to know when the magnet has picked up an object.
The first is obviously a purchasable item, but I haven't found anything suitable. Secondly, I need a sensor to tell when it has collected an item.