Introduction: Larson Scanner With Relay Module
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.

Participated in the
Pocket-Sized Contest

Participated in the
Hurricane Lasers Contest
23 Comments
4 months ago
used a variation of this code for my KITT Replica! Didn't use the shield.
I had to tweak it to allow all 8, the count was off for some reason.
I took out the delay between the count + 1 ; its not really necessary and it causes two lights to be on at once, which doesnt look right on the scanner bar and causes more draw.
Thanks so much!
6 years ago
be careful ! the layout depends on the board, the most common board on the market is different in function and connection.
read this:
http://creatgraphy.com/04/2017/technik-kram/arduino/use-it-right-8-channel-relais-board-chinesesainsmart-version-185/
9 years ago
então, eu alimento meu arduino com uma fonte de 9Vs, acho q fiz confusão... no seu video vc alimenta o arduino com a bateria 12v e só...eu to alimentando o arduino com 9v e tentando alimentar a placa com outra fonte 12v
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...
e outra, como é a ligação da lampada, qual imagem ta certa a ligação q vc fez, nao entendi muito bem, eu to tentando ligar uma sirene 12v
obrigado pela ajuda cara!
Reply 9 years ago on Introduction
Todas as formas de ligar estão corretas. Uma é ligada no normalmente aberto (fecha os contatos com sinal do arduino) e outra, é normalmente fechado (abre os contatos com o sinal do Arduino). Se for usar energia elétrica da tomada, toma cuidado com todas as ligaçãoes.
Reply 9 years ago on Introduction
consegui fazer funcionar cara, obrigado pela sua ajuda mesmo, vo deixar aqui uma imagem de como ficaria a ligação sem o sensor shield
Reply 9 years ago on Introduction
Meus nobres, penso em outra configuração por aqui: essa placa é pouco documentada, o que causa muitos problemas. Conectar as a fonte no VCC e no GND (da esquerda) está correto. O que faltou é 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é e outro com 5v só abrindo e fechando as portas usando o arduino. Espero ter ajudado e que entendam eu ter me metido no assunto de vocês.
Me desculpem a ilustração patética e infantil mas deve dar pra entender.
Reply 9 years ago on Introduction
É isso ai! Parabéns! Boa sorte nesse mundo da eletrônica.
9 years ago on Introduction
Olá. Você pode sim ligar o GND no negativo. Porém, coo sua fonte é de 12 Volts, vc tem que ligar o positivo da fonte no Vin do Arduino senão vai queimar pois colocando no Vin, a placa vai ser alimentada pelo regulador dela, que vai fornecer os 5 Volts.
9 years ago
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..
obrigado!
9 years ago
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..
obrigado!
9 years ago
cara, vc é brasileiro né....então, tenho uma fonte 12v DC 800mA e tmb comprei esse mesmo modulo de relay...posso liga essa fonte no modulo?
Reply 9 years ago on Introduction
Sim, pode sim!
11 years ago on Introduction
I can't understand the use of sensor shield?
Reply 11 years ago on Introduction
Sensor Shield makes things easier. How to connect the wires for example. I made this way to demonstrating the use of this material.
Reply 10 years ago on Introduction
Hi PL, great instructable. I am very interested in implementing AC control thru this setup.
I am about to order an arduino.
First of all, which is the latest model and would you recommend it?
Second, you said “Sensor Shield makes things easier.”
The question is: what is the “difficult” part of NOT using the Sensor Shield?
And can I instead interface the Arduino directly to the Relay board?
ron.dacosta-AT-gmail.com
Reply 10 years ago on Introduction
Hello, Thanks for commenting. The comments help us improve and refine our ideas. I used the "Arduino Duemilanove" 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
Reply 10 years ago on Introduction
of course you can use the relay board without sensor shield.You can use female to male wires
My relay board has 10A 230V AC relays . I get it from ebay for 9$ (search e bay for "5V 8 Channel Relay Module Board for Arduino "
11 years ago on Introduction
,,,have some... /its fun!
11 years ago on Introduction
Do you have a price list or sourcing information?
Thanks.
Reply 11 years ago on Introduction
Yes!
Arduino Board:
http://www.dealextreme.com/p/arduino-duemilanove-2009-atmega328-p-20pu-usb-board-blue-60cm-118078?item=50
Sensor Sheild:
http://www.dealextreme.com/p/jy-mcu-sensor-shield-v4-0-arduino-uno-2009-123623?item=32
Relay Module:
http://www.dealextreme.com/p/8-channel-5v-solid-state-relay-module-board-red-blue-121337?item=89
BreadBord Wires:
http://www.dealextreme.com/p/30cm-breadboard-wires-for-electronic-diy-40-cable-pack-80207
Lipo Battery:
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