badly need help guys..
I am working on a security system project and I uploaded this sketch in my arduino mega, at first it worked out well but after few more trials the my security system randomly restarts after entering the password. Is there something wrong with the EEPROM of the arduino or the code?
I'm guessing he's using c strings (as he should) and he's running off the end of char array, or doing something wrong regarding the null termination causing something else to run off the end of the unterminated string. Or if he's using Strings, he's concatenating recklessly and runs out of memory - Strings are bad, use strings.
The problem is 99.99% likely your code or your wiring (ie, you try to drive something that draws so much current that it pulls the supply below the BOD voltage, triggering a BOR) - but you haven't posted either of those, so we can't really tell you what's wrong!
I would bet that there is some hardware that is causing a power crash and reset. When an arduino has a memory hang, I doubt that there is anything that will normally cause it to actually reset.