loading
Hello! This time I'll show how I used an Arduino to control a relay module with eight channels.

Arduino in offers several advantages such as:

- Open source;

- Easy programming;

- You can assemble your own board;

- Is supported on various forums on the Internet;

- Has several "shields" (facilitates the use of it with sensors, for example.)

- Among others.

  The idea I had was to create a simple programmable hardware. Where only would create a different software for each application.

Just as our computer. What we do (generally) is add a software The hardware remains the same.

We can control larger loads within the limits of current and voltage relays. For example, connecting a ventilator, an appliance, among others.

Step 1: Materials

Below the list of materials:

- Arduino board;

- Sensor shield;

- 8-channel relay module;

- Wires;

- 11.1V battery

Step 2: Mounting

Mount the sensor shield on Arduino Boar and connect the shield to the relay modulde following the statement below.

link:

module ->  Shield

  in1        ->  pin 13

  in2        ->  pin 12

  in3         -> pin 11

  in4         ->  pin 10

  in5         -> pin 9

  in6         -> pin 8

  in7         ->  pin 7

  in8         -> pin 6

 

Take care not to invert the wires.

 The battery is connected as follows: A wire was added to the negative pole connected to GND and the shield and the other of the DC relay module.

  The module was connected to the wire GND which is the same shield plate Arduino.

Step 3: Connecting and Programming

After assembling the hardware, just plug in and program the Arduino.

The following program was done to test the relay module. Works like the lights of the "Knight Rider". The effect is quite interesting. Hope you enjoy.

Software:

Software:

int pinArray[] = {13, 12, 11, 10, 9, 8, 7, 6};
int count = 0;
int timer = 50;

void setup(){
for (count=0;count<7;count++) {
pinMode(pinArray[count], OUTPUT);
}
}

void loop() {
for (count=0;count<8;count++) {
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count + 1], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(timer*2);
}
for (count=7;count>0;count--) {
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count - 1], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(timer*2);
}
}

Step 4: Exemple to Connect a Lamp to a Relay.

<p>be careful ! the layout depends on the board, the most common board on the market is different in function and connection.</p><p>read this:</p><p>http://creatgraphy.com/04/2017/technik-kram/arduino/use-it-right-8-channel-relais-board-chinesesainsmart-version-185/</p>
ent&atilde;o, eu alimento meu arduino com uma fonte de 9Vs, acho q fiz confus&atilde;o... no seu video vc alimenta o arduino com a bateria 12v e s&oacute;...eu to alimentando o arduino com 9v e tentando alimentar a placa com outra fonte 12v<br><br>no meu eu ainda tenho um arduino mega, um etherneth shield, e um GSM shield ligados no 9v 1000 mA.... vo trocar a fonte pela de 12v 800 mA...<br><br>e outra, como &eacute; a liga&ccedil;&atilde;o da lampada, qual imagem ta certa a liga&ccedil;&atilde;o q vc fez, nao entendi muito bem, eu to tentando ligar uma sirene 12v<br><br>obrigado pela ajuda cara!
<p>Todas as formas de ligar est&atilde;o corretas. Uma &eacute; ligada no normalmente aberto (fecha os contatos com sinal do arduino) e outra, &eacute; normalmente fechado (abre os contatos com o sinal do Arduino). Se for usar energia el&eacute;trica da tomada, toma cuidado com todas as liga&ccedil;&atilde;oes.</p>
<p>consegui fazer funcionar cara, obrigado pela sua ajuda mesmo, vo deixar aqui uma imagem de como ficaria a liga&ccedil;&atilde;o sem o sensor shield<br><br></p>
<p>Meus nobres, penso em outra configura&ccedil;&atilde;o por aqui: essa placa &eacute; pouco documentada, o que causa muitos problemas. Conectar as a fonte no VCC e no GND (da esquerda) est&aacute; correto. O que faltou &eacute; soltar o jumper da outra extremidade (a direita) e conectar o GND do arduino no pino COM. Pronto!! Assim teremos dois circuitos completamente isolado, um operando com 12V da fonte para alimentar o rel&eacute; e outro com 5v s&oacute; abrindo e fechando as portas usando o arduino. Espero ter ajudado e que entendam eu ter me metido no assunto de voc&ecirc;s.</p><p>Me desculpem a ilustra&ccedil;&atilde;o pat&eacute;tica e infantil mas deve dar pra entender.</p>
<p>&Eacute; isso ai! Parab&eacute;ns! Boa sorte nesse mundo da eletr&ocirc;nica.</p>
<p>Ol&aacute;. Voc&ecirc; pode sim ligar o GND no negativo. Por&eacute;m, coo sua fonte &eacute; de 12 Volts, vc tem que ligar o positivo da fonte no Vin do Arduino sen&atilde;o vai queimar pois colocando no Vin, a placa vai ser alimentada pelo regulador dela, que vai fornecer os 5 Volts.</p>
Cara, vc pode me dizer como conecto a fonte no modulo sem o sensor shield? posso ligar o vcc(modulo) no positivo da fonte e o GND(modulo) no negativo da fonte? tenho medo de queimar minha placa..<br><br>obrigado!
Cara, vc pode me dizer como conecto a fonte no modulo sem o sensor shield? posso ligar o vcc(modulo) no positivo da fonte e o GND(modulo) no negativo da fonte? tenho medo de queimar minha placa..<br><br>obrigado!
cara, vc &eacute; brasileiro n&eacute;....ent&atilde;o, tenho uma fonte 12v DC 800mA e tmb comprei esse mesmo modulo de relay...posso liga essa fonte no modulo?
<p>Sim, pode sim!</p>
I can't understand the use of sensor shield?
Sensor Shield makes things easier. How to connect the wires for example. I made this way to demonstrating the use of this material.
Hi PL, great instructable. I am very interested in implementing AC control thru this setup. <br>I am about to order an arduino. <br>First of all, which is the latest model and would you recommend it? <br>Second, you said &ldquo;Sensor Shield makes things easier.&rdquo; <br>The question is: what is the &ldquo;difficult&rdquo; part of NOT using the Sensor Shield? <br>And can I instead interface the Arduino directly to the Relay board? <br> <br>ron.dacosta-AT-gmail.com <br>
Hello, Thanks for commenting. The comments help us improve and refine our ideas. I used the &quot;Arduino Duemilanove&quot; because not much like to use the latest release because there is always some errors that need updates. What can be frustrating for some people. I recommend, for now, the Uno. As for the shield, it really is not necessary. You can implement any way you see fit
of course you can use the relay board without sensor shield.You can use female to male wires <br>My relay board has 10A 230V AC relays . I get it from ebay for 9$ (search e bay for &quot;5V 8 Channel Relay Module Board for Arduino &quot;
,,,have some... /its fun!
Do you have a price list or sourcing information? <br>Thanks.
Yes! <br>Arduino Board: <br>http://www.dealextreme.com/p/arduino-duemilanove-2009-atmega328-p-20pu-usb-board-blue-60cm-118078?item=50 <br> <br>Sensor Sheild: <br>http://www.dealextreme.com/p/jy-mcu-sensor-shield-v4-0-arduino-uno-2009-123623?item=32 <br> <br>Relay Module: <br>http://www.dealextreme.com/p/8-channel-5v-solid-state-relay-module-board-red-blue-121337?item=89 <br> <br>BreadBord Wires: <br>http://www.dealextreme.com/p/30cm-breadboard-wires-for-electronic-diy-40-cable-pack-80207 <br> <br>Lipo Battery: <br>http://www.dealextreme.com/p/11-1v-1200mah-lithium-polymer-lipo-battery-pack-for-6-ch-v3-v4-series-r-c-helicopters-33027?item=24 <br>
Make your own: http://arduino.cc/forum/index.php/topic,101183.0.html
nice i wish to make it but i don.t have a ardiuno
Thanks! <br>Try to join some money. It's worth!

About This Instructable

21,525views

93favorites

License:

More by PeckLauros:El Chapulin Colorado Custom  Stranger Bits Ping Pong Larson Scanner 
Add instructable to: