Back to Johnny Five

Relay

docs/relay.md

2.1.01.4 KB
Original Source
<!--remove-start-->

Relay

<!--remove-end-->
Relay - normally open

The breadboard diagram shows a Keyes Relay, however any Relay will work.

Fritzing diagram: docs/breadboard/relay-open.fzz

 

Run this example from the command line with:

bash
node eg/relay.js
javascript
var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
  var relay = new five.Relay(10);

  // Control the relay in real time
  // from the REPL by typing commands, eg.
  //
  // relay.on();
  //
  // relay.off();
  //
  this.repl.inject({
    relay: relay
  });
});

Illustrations / Photos

Relay - normally closed

The breadboard diagram shows a Keyes Relay, however any Relay will work.

Fritzing diagram: docs/breadboard/relay-closed.fzz

 

Additional Notes

 

<!--remove-start-->

License

Copyright (c) 2012-2014 Rick Waldron [email protected] Licensed under the MIT license. Copyright (c) 2015-2023 The Johnny-Five Contributors Licensed under the MIT license.

<!--remove-end-->