Relay
Last updated
Last updated
The Grove Relay module is a digital normally-open switch. Through it, you can control circuit of high voltage (up to 250V AC or 30V DC and 5A current) with low voltage. There is an indicator LED on the board, which will light up when the controlled terminals get closed. Please visit the official WiKi for the full specification. In the following section, you'll learn how to use the on-board user button as a switch to turn on or off the relay to light up or switch off a LED.
Please connect the circuit as the figure shown below to complete this example:
Copy and paste the codes below into the Arduino IDE.
Click the Upload icon to compile and upload the sketch to the board.
When the upload is done, you can turn on / off the LED through the relay by clicking the user button.
A more generic application is illustrated in the scenario below:
By letting the hot wire of an ordinary power cord or the wire in a wall plug to go through the relay (or the 5V power rail of a USB device), a programmable power switch can thus be created by using a relay.