MacBook Pro 13 doesn't fall asleep when the lid closed
Lets start with a test to find out your settings.

copy paste following in your Terminal

pmset -g


now copy paste results here

If you think it is the sensor (unlikely)

To test the sensor, take a small (SMALL) magnet like the one on your Fridge, and slowly slide it where the screen and keyboard connect. The sensor is usually at the outer most edge of the keyboard part, while the build in magnet (yes there is one already inside your Mac) is usually in the screen portion (outer edges)