O'Reilly logo

Mastering Arduino by Jon Hoffman

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

Circuit diagrams

The following diagrams show how we would connect an AC-powered device and an Arduino to a relay:

The AC-powered device is connected to the relay as described in the Introduction section. The VCC pin on the relay is connected to the 5V out on the Arduino, and the GND pin on the relay is connected to the GND pin on the Arduino. We connect the digital 3 pin on the Arduino to the pin labeled IN on the relay. The digital 3 pin will be used to control the relay.

The following diagram shows how we would use a relay to control a DC motor and 9V power source with the Arduino:

In preceding circuits, we stressed the need to have a common ...

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