Arduino uploading problems

Hi, I encounter a problem when uploading a file.

I'm using my Arduino board to control 20+ relays and I'm also using a I/O expander board (I2C).
Sometimes when I upload, let's say to give a signal to relay 1, the program doesn't run.
But after closing Arduino IDE it runs...

I have no idea why that is happening.

Also sometimes when I send a signal to one of the relays, some of them that aren't in the code start to receive a signal from the Arduino. Maybe this is the issue regarding the I/O expander because relays that are connected to it receive the unwanted signal.

I'm powering all the relays + I/O expander using a phone charger plugged into a breadboard.
Do you think that the low power on the relays + I/O expander board are causing these weird errors?

Thanks for the answers in advance!

Please read the forum guidelines to see how to properly ask a question and some good information on making a good post. You will get faster and better help if you post all your code as requested by the forum guidelines.
Also please describe what exact hardware do you use.
Photos that clearly show your wiring can also be very helpful.

Could be a problem with the code or the connections or maybe the Arduino.

If you want help maybe provide some details of the above ?

I used a 5m cable and I kept getting some errors, figured it was because my laptop port is USB1.0 and the cable is too long. When I used a shorter cable, I could upload and then I got the issue of my program being "late".

I can provide you with the code and some pictures later...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.