Check engine light says EGR sensor not working

egr not working properly. What could cause this.

The codes that are associated with the check engine light cannot tell you that a part is not working. It points to a system of things where a fault was detected. Every code has a set of diagnostic steps to use to locate the fault. There are at least a dozen codes that can point to the EGR system. So the place to start is with the actual code - what was the exact code (format: P0123)?