I'm doing a project to control the cat door. The problem is the sensor: I need something that would sense if it's my cat and not a racoon (could be a magnet attached to his collar, his metallic tag, whatever not too big)! I tried a Hall-effect sensor and a metal detector but their detection range are minimal (1 inch or less). I need something with at least 3-4 inches. Any idea?
Well, Jezuz, I don't underestimate the racoons: the initial problem is that the racoons understood that they could pull the door with their claws, so they'll find the button.
As for RFID, any combination of reader/tag to suggest? All the ones I've seen have a very small range.
Any solution possible with a simple RF emitter/receiver?
a lead-detector, that is, modify it, to output a signal to the arduino you will be using... every time your lead-coated cat gets near the door, the door swings open...
i bet those raccoons wont figure out how to coat themselves with lead!
RFID seems the quickest, easiest, and probably the one you should choose.
Teaching an old cat new tricks? Good luck :).
You can also try to teach the cat to meau the anthem, and do voice-printing :).
If you're willing to go the extra mile (or a million) you could try a camera and do facial recognition. No teaching the cat, no burdening the cat. Yet similar to removing cockroaches with a nuclear weapon (meaning an overkill :)).
and a metal detector but their detection range are minimal (1 inch or less)
I don't believe that a metal detector has a range of less than 1 inch.
If you wind a coil round the cat flap, so that the cat has to go through the coil it will pick up any metal or magnet on his collar.
Back in the 60's I built metal detectors much larger than your cat flap for detecting tiny metal partials in food and pharmaceuticals.
basically you need there coils of one turn each. The centrer one is energised with a signal of about 40KHz. The outer two are fed to differential amplifier so that any change in what has been picked up is amplified. When metal passes through you will get a peak first in one coil and then in the other. This is the clue to unlock the flap.
My cat door uses a magnet that hangs from the collar. When the cat sticks his head on the door, the magnet is right over a reed switch and the door unlocks. It works surprisingly well, but I didn't trust it enough to keep using it. A lost collar or a dead battery = a cold cat.
I think that technique would be OK for just sensing, but if by "control" you mean to allow the door to open, I'd be hesitant.
Perhaps you could use 1 sensor to check for the magent and another just to see if the door opens. If it opens but no magnet, it could unlock your gun rack.