Grove

Grove Sockets

The SODAQ Mbili board contains two columns of Grove connectors. The power to the first column can be switched on and off while the second column is always on. The pins for each socket are listed here and can also be found printed on the board.

Switched Column

  1. Analog: A2 A3
  2. Digital: D10 D11
  3. Serial (USB): TXD0/RXD0В 
  4. Digital: D6 D7
  5. Digital: D18 D19
  6. Digital: D8 D9

Always On Column

  1. Analog: A4 A5
  2. Analog: A0 A1
  3. Serial1 (Bee): TXD1/RXD1
  4. Digital: D4 D5
  5. Digital: D20 D21
  6. I2C socket

Note: The switched column is off by default off.

The switched column allows for software control over the 3.3v line that powers that column of Grove sockets. Note that not all sensors or components require that the 3.3v line be powered in order to operate. For example, an LED connected to a Grove socket, will still function without power to the 3.3v pin. That is because the LED draws power from the I/O pin that it is connected to. However, a component like a button will not function as it draws power (when pressed) from the 3.3v pin and sends that power up through the I/O pin it is connected to.

The constant GROVEPWR specifies the digital pin (D22)  which switches on and off the 3.3v power line to the switched Grove column. In order to switch that column on we must first initialise the GROVEPWR pin to OUTPUT mode:

pinMode(GROVEPWR, OUTPUT);

Then we can switch that Grove column on and off by specifying the output of the GROVEPWRpin (HIGH = on).

digitalWrite(GROVEPWR, HIGH);
digitalWrite(GROVEPWR, LOW);

Note: This also switches the red  indicator LED in the bottom left corner of the board on and off.

Serial Connections using Grove

The TXD0/RDXD0 (3) are the same I/O lines that are connected to the USB port. These can be used instead of the USB port for purposes such as debugging. Connecting a USB port always causes a reset, this is by design. So if you want to disconnect and reconnect a debugging cable without interrupting the running program, you can use these I/O lines instead.

Additionally, the TXD1/RXD1 (9) are the same I/O lines that are connected to the Bee slot. So instead of using a bee style module these could be used to wire up a serial device on this grove connector.

Wiring Diagram