Today I report from one or even two 5V DC Relays, which in turn can switch up to 5A, 250V AC / 30V DC, from the company MikroElektronika, Serbia / Europe: the RELAY click board.
The board comes in a smart box, with a warning that there are dangers in switching currents.
I show here a structure for the automatic switching on and off of a G9, 40 watt lamp at 230 volts.
SchematicThe lamp is supplied with 230V and a jumper cable is led to the relay via the adapter. As soon as the relay closes the circuit, the lamp burns. Means that with a relay an independent circuit is switched and in this example to indicate the danger to life.
PinoutThe relay itself is powered by 5V from the Arduino. The Arduino hangs on a USB power bank with its own circuit.
The pinout diagram of the manufacturer's well-documented website shows that the two available relays can be accessed via RL1 and RL2.
The codeWith this slim base code, the Arduino can be thrilled to switch the relay on and off every 2 seconds:
const int RelayPin = 5;
const int ledPin = 13;
void setup() {
pinMode(RelayPin,OUTPUT);
pinMode(ledPin,OUTPUT);
digitalWrite(RelayPin,LOW);
digitalWrite(ledPin,LOW);
}
void loop() {
digitalWrite(RelayPin,HIGH);
digitalWrite(ledPin,HIGH);
delay(2000);
digitalWrite(RelayPin,LOW);
digitalWrite(ledPin,LOW);
delay(2000);
}
As a check, the Arduino control light on port 13 is also switched.
First testFor a first function test, whether the relay switches or not, the connection of 5V (+), GND (-) and RL1 or RL2 is sufficient. By the acoustic snapping you can convince yourself of the function.
The resultWith extension around the lamp it looks like this:
NamingBut why is it a "click"-board? The naming I have come to grief with the help of the further portfolio of MikroElektronika: here are other devices on which this Relay can be piggybacked docked.
Do not be confused by the other - paid - products: it is neither a LibStock Libary, nor the revered mikroSDK needed.
PricingPriced at $18, you get 2 Omron G6D1AASI-5DC Relays with PinOut on a PCB.
AlternativesCommon alternatives include the following relays:
- Songle SRD-05VDC-SL-C or
- a Tongling 5VDC JOC-3FF-S-Z with PINs
Anyone interested in remotely controlling a relay via smartphone in conjunction with Blynk will be introduced in this article even closer to relay circuits with the Particle Photon: MyWater Fountain.
VoucherMikroElektronika has given me 5 vouchers worth 15%, which I gladly pass on to you here. Please note that this can not be combined with the current promotion. The code is “HACKSTER-INGO”
Happy Easter!
Comments