Breakout boards - GPIO headers and shields particularly Grove

Dear core electronics,

This is not about specialized hats and shields such as rs485, fibre optic, iic (i2c), adc/dac, POE that are sold at core electronics.

This is about the GPIO hats and shields which allow input and output connected to sensors, switches and some IIC (I2C) and possibly but not ADC. Emphasis is on the Grove board.

Questions please on the Grove GPIO breakout board.

(1) What is unique about the Grove based hat SKU: SS103030275 for the RPi compared to a breakout such as SKU: CE07895 and SKU: ADA2711 or cobbler connectors which are either screw or slip in slot.

(2) What is the purpose of the programming section at the bottom right of the Grove board and what is being programmed. And how is it programmed?

Ref https://files.seeedstudio.com/wiki/Grove_Base_Hat_for_Raspberry_Pi/img/pin-out/6.jpg

(3) Connections to Grove SKU: SS103030275 and other breakout board with 3 Grove connections, SKU: CE09482.
The link to the mechanical connection of the Grove-based board for the RPi, SKU: SS103030275 is at:

The associated link to the pdf file the mechanical drawing of the Grove connection at
https://wiki.seeedstudio.com/images/6/69/3470130P1.pdf is non-existent.

I have retrieved the file from archive.org.

GroveFemaleHeader-SMD-4P-2_24116a39080.pdf (235.5 KB)

It appears that the Grove connection is a JST PH with a 2.0mm pitch between pins. There are 4 pins. The dimensions of the connector are the same for both the JST and those used in the Grove system.

Any comments on this matter?

Thank you
Anthony of Sydney

1 Like

Hi Anthony, welcome back to the forum, good questions!

That would be this little guy:

Thatā€™s an STM32F3 microcontroller, and itā€™s job is to measure analog voltages on the Ax pins on that board, and relay them back to the Pi, as the Pi doesnā€™t have an Analog-to-Digital converter (ADC) on-board. Other solutions also exist if you arenā€™t invested in the Grove ecosystem.

That should also answer your second question. If youā€™re feeling adventurous you could use an ST-LINK to reprogram it.

Regarding your third question, JST is one of the largest manufacturers of connectors that people use on their PCBs, and it looks like Seeed purchase 4-pin JST-PH for use with their grove system in the same way we purchase JST-SH for our PiicoDev ecosystem.

Thank for the reply.
(1) The microcontroller gets the voltage from the RPiā€™s Ax pin. How is that voltage read from the microcontroller back to the RPi? And where is the Ax pin getting the voltage from.

(2) For programming the microntroller you shown a USB uart chip. How do you program the microcontroller on tbe Grove board. Yes it isvthe STM32 chip but what is the purpose of programming the Grove board?

(3) You gave a link to an 8-channel 17-bit adc. How does one get access to the binary values for a particular channel and where are the pins for a particular analog input channel 0 to 7 on the pcb so as to hook a wire, eg sensor0 to sensor7?

Thank you
Anthony, of Sydney

Hi Anthony

Not sure what you mean by this, By Ax I just mean the connectors A0, A2, A4, A6 on the HAT. Itā€™s not an RPi pin at all really. The ADC in the STM32 reads the analog value when prompted by the Pi, and sends it back over I2C. You can find more info on it in the wiki page you linked earlier.

Apologies, looks like I linked an image rather than our product page, take a look at my updated post. You would generally just leave the STM32 programmed as-is (as an ADC effectively). But if you wanted it to do something else, you could reprogram it to do so.

Generally a library for an ADC will give back an integer value, but you can break that back out in code to binary if thatā€™s what you want

Right where youā€™d expect :slight_smile:
image

Again thank you for your replies.

How is the abovementioned Pi ADC, 8 channel SKU: CEO7486 is described as 17-bits while your 4 channel SKU: FR0316 is18 bits yet both based on the MCP3484.

Note the CEO7486 has 2 x MCP3484 while FR0316 1 x MCP3484

Thank you
Anthony, Sydney

It depends on whether you count the sign bit as part of the data bits - both units are 1 sign bit followed by 17 value bits.

1 Like

Thanks for the reply.

Correct me on this. If there is an analog signal which varies between -1V and 1V, by setting sign bit bit17 to 0 the signal is regarded as between 0 and 2V.

Whereas if bit17 is set to 1, the signal is between -1V and 1V?

Put it another way, how to set bit17 as the sign bit.

Note: bit range is between bit0 and bit17, the 18th bit.

Thank you,
Anthony, Sydney

The device cannot be used with an analog signal of less than Vss-0.3V, so an input voltage of -1V would be out of range. The measurement is a differential voltage - the difference between the + and - inputs of the selected channel - expressed in terms of the reference voltage of 2.048V. So a positive value is a differential above 2.048V and a negative value is a differential below 2.048V. Typical usage is single-ended. That is, the negative side of the channel connected to Gnd and the positive side in the range 0-Vdd (probably 3.3V or 5V). The result is adjusted by 2.048V to give an input voltage reading with respect to ground.

1 Like

I need clarification please.
(1) I need to put a DC offset of 2.048V to the signal?
The maximum the offsetted signal level is either 3.3V or 5V.
If the maximum voltage is chosen to be 3.3V, then the original signal + offset voltage, has a max value of 3.3V a ā€œzeroā€ value of 2.048V and minimum value of 3.3 - 2.048 = 1.252V.
So the original ac signal range is 2 * 1.252 = 2.504V pk to pk. Or the unoffsetted signal max is -1.252V to 1.252V?

(2) If the 18 bits are bit0 to bit17 how does the bit range of bit0 to bit17 relate to the signal? Is bit0 the representation of the minimum value of the offsetted signal at 1.252V. I need clariity of what bit17 represents is it the maximum value of the offsetted signal of 3.3V?

Thank you
Anthony, Sydney

(1) No. The values returned by the device are based on a reference voltage of 2.048V. That means that negative values represent a voltage below 2.048V and positive values represent a voltage above 2.048V. This measured voltage is the difference between the absolute voltages presented to the + and - inputs.

So if the + input was at 4V and the - input was at 0v (GND) then the differential is 4V and the value read from the device would be positive (greater than 2.084). You would add 2.084 to that value to get the voltage. This is the simplest case (ā€˜single-endedā€™) and is probably the assumed case for the examples and tutorials you will find.

If the + input was 3V and the - input was 2V then the differential is 1V and the value read from the device would be negative (less than 2.084).

The maximum voltage that can be applied to the analog inputs (channel + and -) is the power supply voltage actually connected to the device. This is probably either 3.3V or 5V, depending on your MCU, but in other applications it could be any voltage in the allowable supply range for the device.

You canā€™t provide a voltage at the analog inputs that is less than 0V (Gnd) so your example does not apply.

(2) The 18 bits make up a number. That number can be positive or negative and the way that the particular number format works (2ā€™s complement) is that the high-order bit indicates the sign. Thatā€™s why you can refer to it as either 17 bits of data (plus sign) or 18 bits of data. For other than the sign bit thereā€™s usually no point in trying to work out how each bit contributes to the final value (although it can be done if necessary). Just convert it to a decimal number.

The value returned from the device represents the voltage differential between the + and - inputs of the selected channel, where a value of zero is 2.048V.

1 Like

Thank you.
I recall 2ā€™s complement from a TAFE course.

To give a binary representation of the signal invert the binary number and add 1 to the lsb. The msb is 1 for -ve number and 0 for +ve number.

So from your answer about the ref voltage of 2.048V, a signal < 2.048V, the msb is 1 and a signal > 2.048V the msb is 0.

Thank you
Anthony, Sydney