Spacecraft rely on information from earth to avoid space debris, they don't have instruments for scanning and detecting debris. There's a few reasons for this:
- Power: most spacecraft don't have enough electrical power to run a radar powerful enough to detect small debris far enough away to matter
- Weight: in order to be useful for detecting debris the radar would have to have a very wide coverage as debris could be from any direction, this would be a heavy thing to haul around
- Cost: not only would the radar be expensive in itself, the weight of launching it would make the required rocket much bigger and expensive
Even if you did put a radar on a spacecraft for detecting debris it's utility would be limited because orbital debris is moving so fast. Even if a radar was able to detect debris at 40 miles away there would be mere seconds to react. First a radar would need to detect an object, then track it long enough to project its course with the accuracy needed to determine it's a threat, and by that time it's probably either past or your spacecraft is in tiny little pieces.
In order to maneuver a spacecraft out of the way of debris you have to know about it while it's still over the horizon, preferably several orbits away, this is why debris detection is ground based.