I have an Arduino Mega powered by a 12v 1.5a wall plug. This is connected to 2x 4 channel relay boards and 1x 1 channel relay board all with a 5v VCC. All of the 5v VCC share the same output from the Arduino via a breadboard.
I originally left the 4 channels out of the coding and just had the single relay switching on and off at certain times which worked fine. Now I have added code for the the other two relays, every time I disconnect the Arduino USB from my laptop (only leaving the 12v wall supply) all of the relays seem to just come on... go off... come on... go off. Any ideas why? Could it be that all together they are trying to pull either too much current or too much voltage and so it all turns off?
I have and all is grounded. It works fine if the 12v power supply AND the USB is connected to te laptop, but as soon as I take the USB out, it starts flicking on off on off.
Lol. Sorry. Had a busy weekend. This is a hand drawn (badly hand drawn) rough schematic of how it is now. I am assuming is should power the relay boards with their own 5v supply from other than the arduino?
I'm guessing I need to have a separate 5v power supply positive and negative running to each relay board. The Arduino can then solely run the data pins telling the relay boards whether to open them or shut them. However, will I need to link this new separate ground to the arduino ground to make the data lines work?