One solution are usage of external shmitt trigger like 74HC14 with RC-circuit at input.
But avr microcontrollers have internal shmitt triggers at inputs.
I measure input hysteresis at one input of my atmega328p and get about 0.15V.
This is lower then 0.4V min of 74HC14.
Are internal shmitt triggers sufficient or no?