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 ...

Get Practical Internet of Things with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.