# Ifttt + 4 relay shield

**URL:** <https://community.particle.io/t/ifttt-4-relay-shield/42406>\
**Category:** Hardware\
**Created:** [June 13, 2018, 5:26pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406 "2018-06-13T17:26:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lagartus](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lagartus/32/14055_2.png) [@Lagartus](https://community.particle.io/u/Lagartus)\
**Post date:** [June 13, 2018, 5:26pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/1 "2018-06-13T17:26:47Z")

</div>

hello  
im looking for a library to use IFTTT with the 4 relay shield  
is this library the one?

**internet\_Relays.cpp**

thanks

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [June 13, 2018, 7:24pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/2 "2018-06-13T19:24:32Z")

</div>

Have you tried it? No reason it shouldn’t work.

---

<div class="post-metadata">

**Author:** ![Lagartus](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lagartus/32/14055_2.png) [@Lagartus](https://community.particle.io/u/Lagartus)\
**Post date:** [June 14, 2018, 12:25am UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/3 "2018-06-14T00:25:59Z")

</div>

No Sir  
I needed previous confirmation before buying the boards.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 14, 2018, 5:47am UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/4 "2018-06-14T05:47:59Z")

</div>

You don’t really need any library to have IFTTT talk to the Particle devices - it’s all in the stock APIs

---

<div class="post-metadata">

**Author:** ![Lagartus](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lagartus/32/14055_2.png) [@Lagartus](https://community.particle.io/u/Lagartus)\
**Post date:** [June 14, 2018, 2:39pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/5 "2018-06-14T14:39:57Z")

</div>

Sorry, I meant if its the correct library to control relays over internet

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 14, 2018, 3:22pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/6 "2018-06-14T15:22:25Z")

</div>

The library for the relay shield is here  
[https://build.particle.io/libs/RelayShield/0.0.6/tab/RelayShield.cpp](https://build.particle.io/libs/RelayShield/0.0.6/tab/RelayShield.cpp)

But for that too: No library actually needed.  
The relays are connected to the following pins

```cpp
#define relay1 D3
#define relay2 D4
#define relay3 D5
#define relay4 D6

```

And with that you just use `pinMode()` and `digitalWrite()` as you’d do with any other GPIO manipulation.

---

<div class="post-metadata">

**Author:** ![Lagartus](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lagartus/32/14055_2.png) [@Lagartus](https://community.particle.io/u/Lagartus)\
**Post date:** [June 14, 2018, 4:05pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/7 "2018-06-14T16:05:33Z")

</div>

is any complete library ready to use ? im not (yet) a programming code guy !

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 14, 2018, 4:15pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/8 "2018-06-14T16:15:35Z")

</div>

> [@Lagartus](#):
>
> im not (yet) a programming code guy !

Hmm, even using a library does also require some basic programming - or are you asking for a ready-to-use solution for your particular problem?

---

<div class="post-metadata">

**Author:** ![Lagartus](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lagartus/32/14055_2.png) [@Lagartus](https://community.particle.io/u/Lagartus)\
**Post date:** [June 14, 2018, 4:30pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/9 "2018-06-14T16:30:18Z")

</div>

I normally use NCD boards with their standard library.  
I just wanted to try particle shield board and be sure I can use internet relays for a standard online+ifttt use.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [June 14, 2018, 4:35pm UTC](https://community.particle.io/t/ifttt-4-relay-shield/42406/10 "2018-06-14T16:35:41Z")

</div>

The Particle Relay Shield is a lot easier to control than the NCD’s.

```cpp
void setup() {
  pinMode(D3, OUTPUT);
}

void loop() {
  digitalWrite(D3, !digitalRead(D3));
  delay(1000);
}

```

This is all you need to have Realay 1 toggle on/off every second.
