Thank you mister_e for the answer.
I forgot to mention that I'm using a commercial switching power supply for the logic that is able to deliver 4A at 12V. Then I slow down from 12V to 5 with the LM7805. The power supply is really bigger than my needs.
But let me explain what I've discovered next:
The board that is "misunderstunding" the pulses is inside a big metal case. This big metal case is connected to the earth ground throught the switching power supply, BUT not to the GND of my boards.

Then, when I was making my tests, a personal computer inside this big case was running in the same time. Then I was experiencing the erratic behaviour as I told you.
I found that the personal computer inside the case was running by ANOTHER power extension that DOEN'T HAVE any earth socket!
Now, I'm running this PC with the earth ground connected and SEEMs that this erratic behaviour is disappeared.
I Hope...

There is a logic in this?