Relays
Ligação de um Arduino a esta placa de 4 Relays:
This is a 5V 4-Channel Relay interface board, Be able to control various appliances, and other equipments with large current. It can be controlled directly by Micro-controller (Arduino , 8051, AVR, PIC, DSP, ARM, ARM, MSP430, TTL logic) .
5V 4-Channel Relay interface board, and each one needs 15-20mA Driver Current
Equiped with high-current relay, AC250V 10A ; DC30V 10A
Standard interface that can be controlled directly by microcontroller (Arduino , 8051, AVR, PIC, DSP, ARM, ARM, MSP430, TTL logic)
Indication LED’s for Relay output status
Para realizar estas ligações precisamos de saber como funciona um Relay (ou relé) e para isso temos muita informação na Web, exemplo: http://electronicsclub.info/relays.htm
The relay's switch connections are usually labelled COM, NC and NO:
COM = Common, always connect to this, it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Fazendo a ligação de acordo com esta placa e com o seu funcionamento:
U1= Optoacoplador para isolar o sinal
Como já existe uma resistência em série com o LED do optoacoplador, podemos ligar o pino digital do Arduino directamente a um dos IN [1,2,3,4].
Nota: VCC-JDVCC: If you remove the jumper you can use a separate power supply to run the relays if you hook it up to JDVCC. With the jumper in place the power for the relays comes from VCC aka your arduino.
Como teste podemos colocar uma ventoinha ligada ao Relay e ligar/desligar a mesma através do Arduino. Esquema de ligações:
Código de teste no Arduino:
#define O1 12
void setup() {
// initialize the digital pin as an output.
pinMode(O1, OUTPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(O1, HIGH); // turn the relay on
Serial.println("LIGADO");
delay(5000); // wait for a second
digitalWrite(O1, LOW); // turn the relayoff
Serial.println("DESLIGADO");
delay(5000); // wait for a second
}
No caso de pretendermos ligar um Relay normal (sem ser uma placa como a referida), basta seguir um dos seguintes esquemas:
1 - Relay 5v
1 - Diodo IN4004 ou IN4007
1 - Transistor (BC548 ou BC337 ou TIP102 ), no caso do TIP102 as pernas EMISSOR e COLETOR estao trocadas.
1 - Resistor 1k ou 2k2
B: http://www.arduino.cc/playground/uploads/Learning/relays.pdf