Advertisement

Quick Links

Grove/Actuator/Grove - Relay
Grove - Relay
The Grove-Relay module is a digital normally-open switch. Through it, you can control circuit
of high voltage with low voltage, say 5V on the controller. There is an indicator LED on the
board, which will light up when the controlled terminals get closed.

Table of contents

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Grove-Relay and is the answer not in the manual?

Questions and answers

Summary of Contents for Seeed Grove-Relay

  • Page 1: Table Of Contents

    Hardware Software The Grove-Relay module is a digital normally-open switch. Through it, you can control circuit Play With Raspberry Pi (with … of high voltage with low voltage, say 5V on the controller. There is an indicator LED on the Hardware board, which will light up when the controlled terminals get closed.
  • Page 2: Version

    Resources Projects Tech Support Version...
  • Page 3: Platforms Supported

    Parameter V1.1 V1.2 Product Release Date 27 Jan 2013 9 June 2014 Operating Voltage 3.3V~5V Operating Current 60mA 100mA Relay Life 100,000 Cycle 100,000 Cycle Max Switching Voltage 250VAC/30VDC 250VAC/30VDC Max Switching Current  More details about Grove modules please refer to Grove System Platforms Supported...
  • Page 4: Getting Started

    Arduino Raspberry Pi  Caution The platforms mentioned above as supported is/are an indication of the module's software or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.
  • Page 5: Hardware

    Hardware Step 1. Connect Grove-Relay to port D4 of Grove-Base Shield. Step 2. Connect Grove-Button#1 to port D2 of Grove-Base Shield, Connect Grove-Button#2 to port D3 of Grove-Base Shield. Step 3. Plug Grove - Base Shield into Seeeduino.
  • Page 6  Note If we don't have the base shield, we also can directly connect the Grove-Relay and Grove-Button to Arduino board. Please follow below connection. Grove-Relay Arduino Grove Cable Black Yellow...
  • Page 7: Software

    Grove-Button#1 Arduino Grove Cable Black Yellow Grove-Button#2 Arduino Grove Cable Black Yellow Software Here is a demo that shows you how to control a Grove - Relay with a Grove - Button. When one button gets pressed, the relay will close. When the other button gets pressed, the relay will open.
  • Page 8: Play With Codecraft

    pinMode(2, INPUT); pinMode(3, INPUT); pinMode(4, OUTPUT); void loop() (digitalRead(2)==HIGH) digitalWrite(4, HIGH); delay(100); (digitalRead(3)==HIGH) digitalWrite(4, LOW); Step 2. Upload the demo. If you do not know how to upload the code, please check to upload code. Done uploading, if you press the button#1 the relay should be on; and if you press the button#2 the relay should be off.
  • Page 9: Software

    Step 2. Plug the Base Shield to your Seeeduino/Arduino. Step 3. Link Seeeduino/Arduino to your PC via an USB cable. Software Step 1. Open Codecraft, add Arduino support, and drag a main procedure to working area.  Note If this is your first time using Codecraft, see also Guide for Codecraft using Arduino.
  • Page 10: Play With Raspberry Pi

    Upload the program to your Arduino/Seeeduino.  Success When the code finishes uploaded. Relay will turns on when you push the button connected to port D2, and it will turns off when you push the button connected to port D3. Play With Raspberry Pi (With Grove Base Hat for Raspberry Pi) Hardware Step 1.
  • Page 11: Software

     Note For step 3 you are able to connect the relay module to any GPIO Port but make sure you change the command with the corresponding port number. Software...
  • Page 12 Step 1. Follow Setting Software to configure the development environment. Step 2. Download the source file by cloning the grove.py library.   cd ~ clone https://github.com/Seeed-Studio/grove.py Step 3. Excute below commands to run the code.   grove.py/grove python grove_relay.py 12 Following is the grove_relay.py code.
  • Page 13: Play With Raspberry Pi

    main(): import import time len(sys.argv) < 2: print('Usage: {} pin'.format(sys.argv[0])) sys.exit(1) relay = GroveRelay(int(sys.argv[1])) while True: try: relay.on() time.sleep(1) relay.off() time.sleep(1) except KeyboardInterrupt: relay.off() print("exit") exit(1) __name__ == '__main__': main()  Success If everything goes well, you will be able to see the LED indicator blinking. You can quit this program by simply press Ctrl Play With Raspberry Pi (with GrovePi_Plus)
  • Page 14: Hardware

    Get One Now Step 1. Plug the GrovePi_Plus into Raspberry. Step 2. Connect the Grove-Relay to D4 port of GrovePi_Plus. Step 3. Connect the Grove-Button to D3 port of GrovePi_Plus. Step 4. Connect the Raspberry to PC via USB cable.
  • Page 15: Software

    Software If this is the first time you use GrovePi, please do this part step by step. If you are an old friend with GrovePi, you can skip Step1 and Step2. Step 1. Setting Up The Software. In the command line, type the following commands: ...
  • Page 16   /home/pi/Desktop   clone https://github.com/DexterInd/GrovePi.git For more detail about this part, please refer to Setting Software. Step 2. Follow Updating the Firmware to update the latest firmware of GrovePi.  Note We firmly suggest you to update the firmware, or for some sensors you may get errors. Step 3.
  • Page 17: Play With Ti Launchpad

    import grovepi # Connect the Grove Switch to digital port D3 # SIG,NC,VCC,GND switch = # Connect the Grove Relay to digital port D4 # SIG,NC,VCC,GND relay = grovepi.pinMode(switch,"INPUT") grovepi.pinMode(relay,"OUTPUT") while True: try: grovepi.digitalRead(switch): grovepi.digitalWrite(relay,1) else: grovepi.digitalWrite(relay,0) time.sleep(.05) except KeyboardInterrupt: grovepi.digitalWrite(relay,0) break except...
  • Page 18 This example shows how to use the Grove-relay module to control larger load, i.e. a desk lamp light. A 3V voltage signal can cause the relay to switch on, allowing current to flow through the connected appliance.   Relay The basic Energia example.
  • Page 19: Schematic Online Viewer

    pinMode(RELAY_PIN, OUTPUT); // initialize the digital pin as an // the loop routine runs over and over again forever: void loop() { digitalWrite(RELAY_PIN, HIGH); // turn the relay on (HIGH is the delay(1000); // wait for a second digitalWrite(RELAY_PIN, LOW); // turn the relay o by making th delay(1000);...
  • Page 20 We have this part available in geppetto, easy modular electronic design with Seeed and Geppeto. Build it Now. geppetto.seeedstudio.com Resources...
  • Page 21 [Eagle] Grove - Relay Schematic and PCB in Eagle format [PDF] Grove - Relay PCB in PDF format [PDF] Grove - Relay Schematic in PDF format [Datasheet] HLS8-T73 Series Relay Datasheet [Codecraft] CDC File...
  • Page 23: Tech Support

    Tech Support Please submit any technical issue into our forum.

Table of Contents