ACS712 Power Spikes Resetting Mega 2560

Hello all, I am presently using a number of ACS712 20amp Hall sensors to read 120v US AC current. Like this one: All is well largely and the code works great. The outputs of the sensors are plugged directly into A0-A15. Most of the time when I plug a load into the AC side, everything works well, but sometimes when I plug a load in, the Mega seems to freeze up. Sometimes its just the USB serial that ceases to work, sometimes the board resets. I am assuming the issue is that there is a power spike when the load first hits. I am recording the amp readings and I can see for example, that when I plug in a 200w bulb, it temporarily reads >400w on the Hall sensor, just for a fraction of a second. What should I do? I am guessing that the answer is to buffer the spike somehow.

I'd be cautious about "assuming" anything.

Even if your lamp transiently consumes 400 watts when it starts up, that is still only about 4 amps so not outside the capability of your current sensing device.

How is your arduino powered ? Batteries or wall-wart ? The possibility cannot be entirely ruled out, that starting up one device causes enough voltage disturbance in the mains supply to disrupt the arduino, not through the connection to the sensor, but the power supply.

Thanks very much for responding. I'm using a regulated 12v power supply, but I suppose I have no way of knowing how good it really is. I suppose if I added a good sized electrolytic cap in parallel it should smooth out that sort of issue. The question of power supply is an interesting one. Consider this, 90% of the time when something goes wrong, the result is that the USB based serial stops working but the ZigBee serial keeps working, only rarely does a full reset or freeze occur, leading one to think about a conflict between the USB 5v and the regulated 12v. When the USB serial freeze occurs, simply unplugging and re plugging the USB does not resolve the issue. The board must be fully power cycled. The power supply is this one: I need a pretty good amp rating as I am running a good number of relays (not through the Arduino. The circuit splits before power reaches the board). I have a HP computer grade supply that I know a bit more about (ATX supply converted to bench power). I'll try swapping that out.

If you are getting a "spike" from the current sensor, then it going to get into your arduino either through the analog connection or back through the power connection. Either way, it might blow up your arduino but it is unclear how it would cause a reset. Unless the "spike" is in the ground connection.

I don't know what else to suggest, apart from checking all your connections, and doing experiments to see how repeatable the condition is.

Changing power supplies did not help it seems. Keep in mind that he main issue here, despite my misleading subject, is that the USB based serial connection ceases to work. I have only seen a full reset a few times and have not been able to replicate that lately. If I wanted to try some kind of voltage protection (avalanche diode?) does someone have any suggestions? It would be helpful to know which components to use (which diodes?), where to place them (between the sensor and the board?), and how that will affect the readings (will that lower the incoming voltage? if it trips will it turn the sensor off or just limit the top voltage?).