1

I need to connect two sensors like this https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcRDDlL2AK_eYo9BKbImJcekMZ0PgIYC2GL0OLIMVGzkWAtq54zG to rpi 3 b.

I found that it is not a problem and only thing is that you have to connect another sensor to same pins as previous. However, I am wondering what is best way to do so. Currently I am using GPIO wires. Is there some king of splitter for GPIO or something?

tlfong01
  • 4,384
  • 3
  • 9
  • 23
PostarLakogSna
  • 81
  • 1
  • 1
  • 9
  • This post might help - https://raspberrypi.stackexchange.com/questions/103962/how-to-connect-two-bme280-sensors-via-i2c-to-a-raspberry-pi-3b – tlfong01 Oct 06 '19 at 07:24
  • Thanks, the casw is how to connect both together to same pi pin? – PostarLakogSna Oct 06 '19 at 07:26
  • Ah, yes, same two pins of both modules to the I2C bus's SCL and SDA pins. Choose either module, solder/cut its address decoder soldering pads, and the two modules now have different addresses. And even if cutting is badly done (not clean/sharp cut) , fake joint ("dry" soldering) etc, need not worry something might explode (99% sure!), you only get rubbish outputs. And in case you have too many I2C devices on the same bus, each device's pull up resistor in parallel might make the resultant pull up resistor value too small, causing problems. – tlfong01 Oct 06 '19 at 07:44
  • Ah, yes, same two pins of both modules to the I2C bus's SCL and SDA pins - what is best way to do it? Connecting two pins to scl pin? – PostarLakogSna Oct 06 '19 at 07:51
  • Ah, I might have overlooked that you are asking about the physical connections. If you are using breadboard, then two module pins and the I2C pin go to the same column. I am using proto board which has "strips" of three points connected. You might like to read my answer of the question below to see how my proto boards, and how to remove the pullup resistors of the devices: https://raspberrypi.stackexchange.com/questions/97995/how-to-communicate-with-navio2-raspberry-pi-3-to-ard-ltc1867-using-i2c-protocol – tlfong01 Oct 06 '19 at 08:00
  • And without boards, is it possible to solder two gpio wires into one? – PostarLakogSna Oct 06 '19 at 08:22
  • Possible duplicate of [How to connect two BME280 sensors via I2C to a Raspberry Pi 3B+](https://raspberrypi.stackexchange.com/questions/103962/how-to-connect-two-bme280-sensors-via-i2c-to-a-raspberry-pi-3b) – Fred Oct 06 '19 at 08:50
  • I read the OP's question again and found him seems to say that he has no problem in the logical circuit of connecting two I2C sensors (BME280) to the I2C bus. His question is WHAT IS THE BEST WAY TO DO THE PHYSICAL CONNECTION. So I am giving an answer for that. – tlfong01 Oct 06 '19 at 12:31

2 Answers2

1

Question

And without boards, is it possible to solder two gpio wires into one?


Answer

Yes, I often do it, not soldering, but the following:

(1) Strip two jumper wires, one longer than the other.

(2) Twist two ends together,

(3) Crimp to a duPont pin and insert it into female connector.

But I almost never do it for joining two GPIO wire together灶.

Usually I do it on the device side, where the device has one common ground for two two data/power lines. In this case, I "split" the common ground into two grounds, one for power ground, another for signal ground. This reduces noises.

Looking at the GPIO pins side, there are two or more wires/signals going into the same GPO pin. So it is more appropriate to say two or more wires/signals join/merge into one.

This time I don twist many jumper wires together. Instead I use duPont male pin stripes solder on the protoboard (top left corner of second picture). It is more flexible than hard twisting or soldering many wires together, because it is easy to add/merge/join/connect or remove any wire any time.

join pin

join pin 2


References

(1) PC-board Design - Properly ground your circuits - EDN 2017jan06

(2) Removing Pullups in MCP23017 - tlfong01 2018

(3) I2C Spike Problem


Appendices

Appendix A - Sensor Ground Problems (Ref 1)

Analog ground


.End of answer

tlfong01
  • 4,384
  • 3
  • 9
  • 23
  • 1
    First of all thanks a lot for your answer, you helped me a lot already. Can you explain a litrle bit more this part, or possible provide some kind of scheme/sctratch for this regarding bme pins and rpi pins? Usually I do it on the device side, where the device has one common ground for two two data/power lines. In this case, I "split" the common ground into two grounds, one for power ground, another for signal ground. This reduces noises. – PostarLakogSna Oct 06 '19 at 18:13
  • Hi @PostarLakogSna, Well, ground wiring is in the same area for PCB trace design. It is a bit hard to understand. You might like to read the article of Ref 1. An oversimplified picture is something like below. For your sensor case, there are three grounds points (1) Analog ground, (2) Digital ground, (3) Power ground. If you don't separate the three grounds, current flowing in the common ground wiring might affect the analog voltage, as offset or noise, ... Figure 4 shows the basic idea. – tlfong01 Oct 07 '19 at 04:31
  • Often the power loop/ground unavoidably overlaps the digital/anglog loop/ground. Then you need to use bypass caps to reduce the noise effect. See Ref 3. Usually only when you have many devices on the same bus, or using many long wire, then you will have a noise problem – tlfong01 Oct 07 '19 at 05:29
  • I encountered another problem, instead of temperature/pressure sensor, I have to connect MQ-7 CO sensor. Is it possible to do it in same way? Are there any issues with this sensor? – PostarLakogSna Oct 30 '19 at 19:04
1

I encountered the same problem and after not finding an easy way to stack stuff on GPIO pins, I decided to try a daisy-chain approach.

It looks like your sensor is typical in that it requires a header to be soldered on:

sensor

Often they come with headers in the bag. But you can also purchase a header with longer pins.

long header

This one has 21mm "total height", and the plastic mold is usually 2mm. So we can have 9mm on each side if we forcibly center the pins as shown in Suggestion 8 here:

header with centered pins

Actually the female jumper wire sockets only need about 6mm, anyway if you solder the long-pin header properly to the sensor, then you should be able to leave enough length of wire sticking out on both sides of the circuit board so that female jumpers could be attached on each side. One side will connect to the Pi, the other side to the next sensor.

Maybe I'll attach a picture when the product arrives. There may be problems with I2C maximum cable length - but I only have a few sensors, with low bandwidth needs.

Metamorphic
  • 253
  • 2
  • 11