O'Reilly logo

Practical Internet of Things with JavaScript by Arvind Ravulavaru

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up relay with Raspberry Pi

As of now, Raspberry Pi has the smart weather station sensors attached to it. Now, we are going to add a relay to the setup.

A relay is an electrical switch that is driven by an electronic signal. That is, triggering the relay with logic high 1 will turn on the relay and logic low 0 will turn off the relay.

Some relays work the other way around, depending on the component. To know more about types of relay and how they work, refer to, https://www.phidgets.com/docs/Mechanical_Relay_Primer.

You can purchase a simple 5V driven relay from Amazon: (https://www.amazon.com/DAOKI%C2%AE-Arduino-Indicator-Channel-Official/dp/B00XT0OSUQ/ref=sr_1_3).

Relays deal with AC current, and in our examples, we are not going ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required