Does anyone have an 8_Channel_Rely Sketch that I could try?
The diagram in the post above shows any revalent wiring and pins.
The power supply is the same as this diagram. Measured at 4.94 v up to 6 pins. Then it drops to 3.9 v with 8 pins. However, it is hard to read because the relays are switching on and off some fast.
I have elimated any possible wiring problems.
The websites I listed in the first post will take you to the source used for wiring and code. The only exception is I use slightly different pins.
In reference to pictures and diagrams of my project, I not able to go into that this time. But be assured, any basic relay hookup is the same.
Additional information I've found:
The relays will begin to cycle even if there is only 2 or 3 or ... 7 or 8. It just takes longer to start cycling.
What do you mean by 6pins and 8pins?
What is your power supply and where have you got it connected?
If it drops to 3.9V then I would say your 5v line is over loaded.
If your supply is providing current to the DC socket, then you are possibly overloading the onboard 5V LINEAR regulator.
If you supply is via the DC socket, then it should be 7V or higher to give the LINEAR regulator some headroom to provide a stable 5V.
The schematic you refer to, is not your schematic, PLEASE reverse engineer your project and post the schematic.
Where are the ON/OFF buttons and how are they wired?
Does ezButton turn on the internal pullup resistors if your buttons are from digital input to gnd?
If your buttons are digital input to 5V, then you will need 10K pull down resistors between each digital input and gnd.
PS. Off to bed very late here..
Yes, it does. But the sketch immediately changes all those pins to OUTPUT and uses them for the relays so it doesn't matter unless there really is a button and a relay on the same pin.
As said, get rid of it; you only need it once in setup().
Yeah, but why try it with an inadequate power supply?
Didn't the diagram in reply#5 work for you?
Here's a more visual diagram with 4-relay module shown:
What I ment to say is "relays", not pins.
I have now hook up a computer power supply that measures 5.04 volts, and the relays are not runing wild any more. So it seems that anything below 5.00 volts will make the relays cycle.
It surpises me that no one has had this problem before.
The only other thing I can remotely think of is the " ELEGOO Upgraded 37 in 1 Sensor Modules Kit with Tutorial Compatible with Arduino IDE UNO R3 MEGA Nano" that came in the kit is sending some strange signal or something.
For anyone that wants to you can search Amazon with the kit list above.
I've been trying to learn by other's example sketches. I guess I can't do that because it has caused more problems than solutions.
Thanks for your help.
I only used the ezButtons to try to find a solution.
Your information is very helpful.
I connected a computer power supply measured at 5.04v, all relay ingaged, and the problem went away.
Just aside… I wonder if the original ‘relay’ supply was putting out dirty DC or even AC ? !