How to check ATmega328 or ATmega168

(all strings are defined as constants in the code)

Defining a string as "constant" does not prevent it from occupying RAM; you have to go beyond that to putting the strings in PROGMEM and using special code to fetch/store them.