Newbie how to turn a SPDT Relay(30A) on and off connected to a beaglebone green

When I got my new bbgw I ran an internet search to find how to use the relay and did not find an easy answer, so here goes:

  1. The Grove - SPDT Relay(30A) - uses +5V , so you need to solder the third pin of that groove connector. Disconnect it from the board, and connect it to the input 5v power.
    The groove connector pinout are:

J4
1- I2C2_SCL - P9_19
2- I2C2_SDA - P9_20
3- VDD 3.3
4- GND

J5
1- UART2_RXD - P9_22
2- UART2_TXD - P9_21
3- VDD 3.3
4- GND

The pinout of the relay is:
1- Signal
2- not connected
3- +5V
4- GND

If you connect the relay to J4 use this python code, to toggle it on and off

`

import Adafruit_BBIO.GPIO as GPIO
import time
GPIO.setup("P9_19", GPIO.OUT)
while True:
    GPIO.output("P9_19", GPIO.HIGH)
    time.sleep(0.5)
    GPIO.output("P9_19", GPIO.LOW)
    time.sleep(0.5)

`

When I got my new bbgw I ran an internet search to find how to use the

relay and did not find an easy answer, so here goes:
1. The Grove - SPDT Relay(30A) - uses +5V , so you need to solder the
third pin of that groove connector. Disconnect it from the board, and
connect it to the input 5v power.

It seems that your relay requires nominal 5V coil voltage and 185mA coil
current. This is far beyond what a BBB pin can provide: they put out 3.3V
and barely above 10mA. Additionally, switching the coil on and off
generates inductive spikes that are likely to damage the BBB output
circuits. You need some sort of coil driver; I suggest buying something,
e.g one of Machinekit Blog: BeagleBone Hardware Capes, or building
your own circuit like this one http://i.stack.imgur.com/OhY9d.png

This image is incomplete. You still need a diode across the relay coil or the transistor collector will see a much higher potential than the supply rail.

Regards,
John

John your feedback is always uesefull how refreshing

small updates:

  1. The Grove - SPDT Relay(30A) - uses +5V. So for each groove socket used, you need to solder the third pin, to disconnect it from the board, and connect it to the input 5v power. +5V is at P9_7 or P9_8.