32 Channel Relay Board I2C Arduino Nano

Hi,

I am having an issue with this relay board: https://store.ncd.io/product/32-channel-high-power-relay-controller-with-i2c-interface/

I have an Arduino Nano clone (https://www.amazon.com/ATmega328P-Microcontroller-Board-Cable-Arduino/dp/B00NLAMS9C/ref=sr_1_3?ie=UTF8&qid=1507668948&sr=8-3&keywords=arduino+nano+3.0) that I am using to connect to the board. My wiring setup is pictured here: https://i.imgur.com/KcbZYhl.jpg

My Arduino sketch is here: https://pastebin.com/KrKV2ZdQ

Basically the sketch intends to be a demo program that allows me to write a long integer representing the 32 relays to the Arduino, which splits it into 4 ints to be written to the relay board. So I would send 4294967295 to turn all 32 relays on, 0 to turn all 32 relays off. 65535 would turn all 16 relays of the first chip on. The serial communication and integer splitting is working fine.

However, when I write to the 4th bank of relays (the 2nd chip @ address 0x21 0x01) the whole board begins to chatter depending on the status of the other relays. If I try to write all 32 relays on, the first 24 turn on in sequence, but when it writes to the last bank, the board freaks out. If I write 255 to the last bank and 0s to the others, everything works fine. If I turn on a few relays on the board, everything is fine. If a good amount of relays are on in the first 3 banks then I write to the last bank, it freaks out. Turning on the first 24 is fine, then the 25th freaks it out.

Could you please take a look at my code and wiring and see if you see what could be causing this?

Thank you in advance.

T

Hi,

Can you post a photo of the 32 channel relay board?

R

Also, you might want to make sure the power supply is strong enough to handle all the relays.  We test using our code prior to shipment, I have another engineer will post a link to you so you can try code that we know works.

Thanks,

Ryan

B

HI,

Try this code and see if you still face the issue

https://github.com/ControlEverythingCommunity/MCP23017_16-Channel/blob/m...

this code will turn all relays one by one and then will turn off them one by one. This one is for 16 channel so you will need the change the address to run the last 16 relays.

Thanks

 

Y

Here are some more images: https://imgur.com/a/Smw5x

I took 2 pictures of the board and the power supply. The supply is 12V 1.5 amps.

I will test the sample code again tomorrow, but turning relays on and off one by 1 works fine. I ran your sample code to test my wiring and addressing when I was first starting. Is there any information about power requirements available? 

Another note, when the board "freaks out" (sorry I don't have a better description of it), all lights on the board shut off, come back on, shut off again, etc. The only way to get it out of this state is to re-start the arduino and re-initialize everything and write 0s to all 4 registers.

R

The power supply you are using should be fine for this controller.  But I can't say I have anything to offer on the problem you describe, when we test our controllers, we do not see this problem.

R

On second thought, it might be a good idea to up the size of the power supply if you plan on running all relays at one time.  Go for a 2A or larger supply, the supply you are using may be getting loaded down.  Please let me know what you find out.

Thanks,

Ryan

Y

I was able to test with a digital power supply this morning. The programs I was using worked perfectly. I was able to turn all 32 relays on sequentially then off sequentially. With all 32 relays on, the power supply was showing the board drawing 2.375 amps. When I turned the current limiter on to 1.5 amps, I saw the behavior from yesterday. The voltage actually was able to dip to nearly 9V (approximately 20 relays on) before the board started flickering. I am glad it was something simple like this rather than an issue with the Arduino or relay board hardware / software.

R

Ok great, Bhaskar and I discussed it yesterday and thought you might need more power to the board.  Glad to hear you have it working!

Ryan

Y

Thanks for your help. If it is possible, you may want to note that a 2.5 amp supply is recommended on the product page, as the buy now button suggests a 1.5 amp that is available on your store.

R

Thank you, I have reported this to our web team and they will update all 32-Channel high-current controllers in the compatibility section.

Ryan

Y

Awesome!