Potential damage or brownout

i may have committed a crime among the arduino veterans, but i powered a 5v, 2 relay board directly from an arduino r3. while no problems originally became evident, the arduino began to reset about once every second. this reset cycle happens at random points during the code. thinking this problem may be due to overdrawing power, i isolated the arduino from the relay switches via external power supply, but the problem persists. my hypothesis is that the relay potentially damaged something on the arduino, or my other components are drawing too much power.

such extra components include: ultrasonic sensor, active buzzer, limit switch running on Vout and checked by analog input. most of which run on the Vout, but rarely do they run simultaneously. very few variables are used in the program. software sketch is attached if neccesary.

is my arduino potentially damaged, or does this sound more like a coding/ noise error? forgive my ignorance, this is my first three months of this hobby.

final_project_software.ino (4.47 KB)

Sure, it’s always possible you have damaged something.

You should always format your code in the IDE with .

With the use of all those delay()s, eyes soon gloss over.

Stop, read up on the BWD (blink without delay technique) and how to use a State Machine in C++ programs.

Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components.
Posting images:

Repeated resets could be a code problem (writing off the end of an array or something, typically) or a power supply problem.

Are you able to upload fresh code to it? Try uploading something really safe like Blink.
If this fails, try disconnecting all external hardware from it. If it still resets repeatedly and can't be uploaded to, the board is hosed (i wager you could feel around the board and find one part getting hot).

Did the relay have a diode to clamp the back emf? without it, the spikes generated when the relay is shut off will damage things.

DrAzzy:
Repeated resets could be a code problem (writing off the end of an array or something, typically) or a power supply problem.

Did the relay have a diode to clamp the back emf? without it, the spikes generated when the relay is shut off will damage things.

im using a laptop power supply, 12V 5A, which may or may not be consistent due to non-uniform loads (running a 12v motor for a certain period of time), however i am decently confident in said source, but ill try again with my laptop usb power to double check.

as for the back emf, i wasnt sure if that would even be a problem, but i stand corrected if said measures are necessary. would a simple LED suffice for future reference?

larryd:
Sure, it’s always possible you have damaged something.

You should always format your code in the IDE with .

With the use of all those delay()s, eyes soon gloss over.

as for the delays, yes. i understand its primitive, but the delay is intended how i wish, as no programming is to interfere at said points. its a stone-age level of programming and its intended to be, which makes it functional, not practical.

your comment mentioning formatting goes over my head, but i suppose experience will grant me said knowledge.

schematics: all components were wired through breadboard to the Vout and GND ports on arduino with the exception of the motor, isolated from the circuit via relay board. i suspect said method would be pretty easy to visualize. perhaps i was trying to draw too much current through the 5v Vout pins, but i suspect that wouldn’t cause a brownout, but just hurt the pin instead.

links to components:
http://modtronix.com/mod-rly2-5v.html
http://modtronix.com/lcd162b-fhb.html
http://modtronix.com/mod-usonic1.html

https://www.amazon.com/gp/product/B072B842KP/ref=ppx_yo_dt_b_asin_title_o00_s02?ie=UTF8&psc=1