Help with a function that magically crashes the arduino?

david_2018:
What specific relay are you using, and how is it connected to the arduino? Hopefully you are not trying to power the relay from the arduino.

Another test you can do is to connect the relay, but leave the pump disconnected, and see if it is the relay or the pump itself that is causing the problem.

This is legitimately fascinating, I didn't stop to consider that the issue could be interference!

So the relay itself is SRD-05VDC-SL-C 5V, its connected with jumpers to pin4, gnd, and vcc of a breadboard. The pump is powered via an external 5v power unit.

However absolutely worth mentioning is that this whole arduino circuit is currently running as a prototyping on a breadboard next to the plant that I'm auto-watering... which happens to be sitting next to a speaker that has a massive fucking magnet in it...

I probably should test this away from the speaker. I'll also give it a shot without the pump attached and see whats what.

This absolutely gives me a good direction to go in search of a fix!