4

I have a one of these https://shop.pimoroni.com/products/adafruit-veml6075-uva-uvb-and-uv-index-sensor-breakout and one of these https://taaralabs.eu/1-wire-shield-for-wemos-d1/ I would like to connect to my RPi3.

The first product comes with some pins as below

enter image description here

which I assume is to allow me to stack one on top of another. However what if I want to have more such i2c devices attached? The below would seem to only support one on top and one below the black plastic blocks. Do I just need to get more of these pins and put them on a breadboard or is there a better way? Once I've finished prototyping I intend to solder rather than have a breadboard.

Stuart Brown
  • 219
  • 2
  • 7
  • How far apart are you planning to mount them? How do you plan to individually access them? From what I have read the I2C address cannot be changed on these devices, so you can't have multiple on the same bus. – NathanielJS Mar 28 '19 at 12:12
  • The pins are for cables, not to stack the boards. You break off four pins and solder those. Then you have cables to the Pi GPIO. – Tomas By Mar 28 '19 at 17:23
  • Thanks @Tomas By. I can see how that would allow me to connect the first board back to the RPi, but how should I best connect that first I2C board to other ones? – Stuart Brown Mar 28 '19 at 18:19
  • I don't know about best but if you have multiple I2C devices with different addresses then that should be fine I think (ie all connected to the same SDA/SCL pins). – Tomas By Mar 28 '19 at 19:49
  • Thanks. I think I'm being really dim here, but if those pins connect via jumper cables back to the RPi (i.e. SDA/SCL on the board back to relevant GPIO pins) how do I go from the SDA/SCL pin on the I2C device to the next I2C device? Must I go via a breadboard? – Stuart Brown Mar 28 '19 at 21:06
  • There are some options, like one of these if you have lots of things, or you could just make y-cables, by soldering or using screw terminals. Breadboard is not high on the list. – Tomas By Mar 29 '19 at 03:20

2 Answers2

4

To connect multiple physical devices to the i2c bus, I connect the GND, Vcc, SDA and SCL pins from the Pi to the first i2c device, and then those to the next one etc. Daisy chaining (or wiring in parallel). I don't have a good answer for the physical wiring - essentially you want to 'tap' a 4-wire ribbon for each device. As above, the devices must have different bus addresses.

4

You can't connect them in parallel as they use the same fixed I2C address (0x10). Every device on an I2C bus must have a unique address.

You have a number of options.

  1. use an I2C multiplexor between the devices and the bus. It acts as a gatekeeper allowing multiple devices with the same address to be used on the bus. E.g. the TCA9548A.
  2. use a bit banged I2C bus for one device and use the hardware I2C bus for another. There is Linux driver support for software I2C buses on the Pi. See /boot/overlays/README for details.
joan
  • 71,014
  • 5
  • 73
  • 106
  • OK thanks. So what if i only wanted to use one of those sensors but also have https://taaralabs.eu/1-wire-shield-for-wemos-d1/ which has a different address? I'm primarily looking ot understand the physical connection requirements at the moment. I know that's probably a bit basic but want to understand how to wire them together neatly – Stuart Brown Mar 28 '19 at 12:40
  • Could you edit your question in the light of what you now plan to do? However I doubt there is a best way. I suggest you include whether you plan a temporary or permanent installation. – joan Mar 28 '19 at 13:08
  • thanks @joan, I have improve my question i hope – Stuart Brown Mar 28 '19 at 17:08