You should post the schematic of your project in order to get proper help. Very likely your problem is in the hardware arrangement.

Cheers

Al.