Hello guys, today we would like you to meet our new Surilli.io member, the "Surilli Relay Shield". This add-on is stack-able onto any Surilli development board as shown in the picture below. We will be using one of the two relays on the Surilli Relay Shield to switch 2 pins of Surilli GSM HIGH and LOW. Let's not wait and get started.
Note: If you are using this Surilli for the first time, follow our Startup Guide for Surilli GSMand then move to step 1.
STEP 1: Setup Arduino IDE for SurilliMake sure you have selected the right port, board and processor for the Surilli as shown in the picture below and it is programmable (compile and upload “Blink” from File>Examples>Digital>Blink onto your Surilli to check if everything is working fine).
STEP 2: The circuitry
The circuitry is very simple. Complete your circuit connections as shown in figure below and then move on to the next step.Do not forget to stack the relay shield onto Surilli. Stacking powers up the relay board.
STEP 3: Upload & Burn Code Onto Surilli
- Now you have completed setting up your hardware and Arduino IDE. Copy and paste the Arduino sketch given below into your Arduino IDE. Hit the upload button.
- After it is uploaded successfully, move to the next step. Your Surilli is now ready to turn ON & OFF your appliance ;)
That’s all for now. If you have any queries, visit surilli.io or contact our support. Stay connected with Surilli family for more amazing stuff :)
int FirstRelayPin = 5;
int SecondRelayPin = 6;
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital Relay_Pins as an output.
pinMode(FirstRelayPin, OUTPUT);
pinMode(SecondRelayPin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(FirstRelayPin, HIGH); // turn the Relay on (HIGH is the voltage level)
digitalWrite(SecondRelayPin, HIGH);
delay(1000); // wait for a second
digitalWrite(FirstRelayPin, LOW); // turn the Relay off by making the voltage LOW
digitalWrite(SecondRelayPin, LOW);
delay(1000); // wait for a second
}
Comments
Please log in or sign up to comment.