Analog Sensor Advice

Magnetic: you should be able to make this work with two metal plates, the distance is not too much but your sensitivity will have to be very high - to the extent that if you breath over it (increase humidity/temperature of the air) you will detect it. You'll also detect your hands getting within about 10 cm of the device. You'll detect just about anything that's placed in between the plates. So environmental factors are such that you may not be able to do a reliable measurement.

If using eg a linear hall sensor and magnet it would be extremely immune to anything except ferromagnetic materials - that's not the problem. The response would be very non-linear and 4cm is a long way.

Allan