Pages: [1]   Go Down
Author Topic: [SOLVED] 16 Channel 12 volt relayboard and Arduino UNO  (Read 1114 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm having some difficult problems with getting a 16 channel relayboard running on  my Arduino UNO. So maybe someone could point me in the right direction.

Today i received my Elecfreaks 16 channel mini-relayboard (12volt), and i tried to hook it up to my Arduino. It is this relayboard:


As you can see, it has 3 rows of headerpins. The top row with the red headers are all connected together from lef to right. The middle row is used to connect the red ones with a shunt to the corresponding channel. This is only used, when i want to use the board without a MCU. They are switched on then, by the switch on the right. So this is not the problem, because i don't use this feature.

The bottom row is my problem. From left to right:
VCC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 GND

I connect my external 12 volt to the VCC and GND pins, and a second GND line to my Arduino GND. The other pins 1, 2, 3, etc etc are then connected to my Arduino pins 2, 3, 4, etc etc. But when i test it, with a modified Blink sketch. Nothing happens.

The relayboard works as far as i can see. All channels can be switched by hand, and if i connect the channels to a arduino pin, the relay responds. But only then. When the sketch has to do his job, the relay does nothing, where it normally would have to blink / switch on and off.

When i connect the VCC and GND of the relayboard, to my 5V and GND on my Arduino, the relays do switch on and off, but without a click. So it has not enough current to switch it on i guess. But the relayboard has to use 12 volt.

What am i doing wrong?

Thanks in advance
« Last Edit: May 09, 2013, 08:55:52 am by n00bduino » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You have to use a 12V power supply for the board's Vcc but you have to,connect the ground of this power supply to the ground of the arduino.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the quick reply  smiley

But i did this already, with no success. I tried it with a 4 channel 24 volt relayboard i made myself, and that works like a charm. But the problem is, that i have to use the 16 channel board. I almost running out of options on the wiring side. I do not hope, that i have a faulty board. Normally it would work, because i wired it up like any other relay, with external power.

I made a quick sketch with paint (so nothing fancy), that shows how it is connected at this moment. In the sketch i only made 2 connections to the arduino output pins.

« Last Edit: May 08, 2013, 06:33:06 pm by n00bduino » Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well if you did what you show in the pic you probably killed your uno you are sinking 12 volts..  
http://elecfreaks.com/store/download/16_Relay.pdf
« Last Edit: May 08, 2013, 07:52:32 pm by be80be » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well if you did what you show in the pic you probably killed your uno you are sinking 12 volts..  
http://elecfreaks.com/store/download/16_Relay.pdf

My Arduino is working fine.

It worked the same way for ages on a homemade 4 channel relayboard with 24volt relays on it. And they where connected just the same way. The 24volt to the VCC and GND of the relayboard, the signal pins to my arduino, and the GND also to my arduino's ground.

I just tried it again with the 24volt relays. Still working fine. Like a mystery  smiley-eek-blue

On the relayboard in question, it has to be the same way, but with 12 volt instead. No luck yet.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The way it shows in the pdf you hook the pin from the uC to ground the led of the Optocoupler
it has a built in resistor to limit it to 20 mA.

You didn't add one did you? 
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well if you did what you show in the pic you probably killed your uno you are sinking 12 volts..  
http://elecfreaks.com/store/download/16_Relay.pdf

Wow I can't believe what a stupid design that is. The whole point of having an opto isolator is to isolate the supply from the driver. Having the same Vcc on each side of the opto isolator is just so stupid. What should happen is that Vcc on the LED side of the opto should come out as a separate connection.
What is saving your arduino is the 1K resistor and the LED, that is limiting the current through the protection diodes on the arduino but is exceeding the safe value of 1mA.

Having said that it should work because you are sinking the current. Are you sure that the pins you connect to the board have had their pin modes set to be outputs in the setup() function?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup, the design is not something to write home about  smiley

I ordered this board, to look at the "quality" of china made stuff. Just to give it a try. It does not cost that much.

Anyways, it is now sort of working. I tried different resistor values between the Arduino digital pins and the signal pin on the relayboard. And with a 4.7K resistor it works. Kind of funny in some way. because you would expect, that it had all the necessary parts working.

I will change the topic title to solved for now smiley

Thanks for all the answers and help guys.
« Last Edit: May 09, 2013, 09:26:53 am by n00bduino » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31483
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
when i disconnect the ground to the arduino, it still works
That means the ground connection is from some other route, maybe through a computer or mains ground.
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lol no one looked at the PDF if you cut the ground from the uno the relays are still hooked to the supply ground and if you turn on one closing the power loop. But the OP should rethink this and read the data sheet the relays are setup to use 20 mA to turn on, and Like I said you don't need a resistor from the uno to turn these on with five volts but your using a resistor and 12 volts that sets it to about 21mA.

That's why it works now but it's not a good idea you forget the 4.7 good by port pin.

So if you left off the resistor and just use 5 volts it should work too and no worries off blowing a port pin.
« Last Edit: May 09, 2013, 08:45:52 pm by be80be » Logged

Pages: [1]   Go Up
Jump to: