2

I have an Exhaust Air Heat Pump (Nibe F470) and I would want to monitor pressure differential between incoming and outgoing pipes and pressure differential between the house and outdoor air pressure.

Can I use Raspberry Pi with multiple I²C devices, such as Sensirion SDP600 sensor line? As far as I understand, SDP600-500Pa would be suitable for this purpose.

How many such sensors I can use with a single Raspberry Pi? Have I understood correctly that I²C allows me to connect at least two such devices to the same input pins in Raspberry Pi?

  • You seem to have answered your own questions here WRT "Can I use this sensor?" (yes if it is I2C based) and "Can I connect multiple I2C devices?" (yes); your other questions seem either very tangential to the pi and would be better at our larger sibling site, Electrical Engineering, or else are shopping recommendations which are explicitly off-topic. – goldilocks Oct 20 '15 at 13:54
  • There is one issue WRT to I2C (if you want to ask a more generic question about multiple devices, that would be great): If you want to connect multiples of the same device, make sure they are capable of using different bus addresses. If the device is hardwired to always use 0x66, then you can only attach one. In this case, the datasheet refers to a "default address" of 0x40 (see page 4); I don't know if/how that can be changed (a more specific, singular question about that would be fine). – goldilocks Oct 20 '15 at 13:56
  • I contacted Sensirion by email and the sensor address can be changed. Changing the address requires overwriting the EEPROM partially and the instructions are not public because the device will be destroyed if incorrect part of the EEPROM is changed. Each device has been calibrated in the factory and the calibration data is also stored in the same EEPROM. – Mikko Rantalainen Oct 23 '15 at 10:24
  • 1
    I did receive the documentation to reprogram the EEPROM but the sender asked me to not publicly distribute the instructions. I guess other people can get the instructions from info@sensirion.com, too. – Mikko Rantalainen Oct 23 '15 at 10:25
  • More info about Sensirion differential pressure sensors: https://www.soselectronic.com/articles/sensirion/sensirion-sensirion-sdp-sensors-measure-pressure-but-even-a-flow-1440 – Mikko Rantalainen May 23 '17 at 12:27

1 Answers1

2

After doing some research, I have following answers:

  1. Yes, Raspberry Pi can interface multiple I²C devices as long as each device has individual I²C address. I²C bus needs two pull-up resistors in general case but Raspberry Pi has this handled internally so you can just connect the bus wires and you're done for the wiring.
  2. Maximum number of I²C devices sharing a single wire pair is 0x70 - 0x08 - 1 = 0x67 or 103 in decimal notation (the address space is 7 bit and the I²C specification reserves addresses 0x00..0x08 and 0x70..0x7F). In addition, one should keep in mind that I²C wiring should be kept shorter than 1.0 m total due to line capacitance. The I²C bus allows only a single device active at any given time so attaching very many devices causes longer delays to access all devices.
  3. Sensirion SDP600 sensor line has default I²C address of 0x40. As a result, one can attach only a single such device to a given I²C bus out of box. The address is stored as raw binary value inside the device EEPROM, in offset 0xC2C. The EEPROM reprogramming instructions are not publicly available because the same EEPROM contains factory calibration for each device and possibly part of the firmware, too. I was able to successfully request instructions to reprogram the EEPROM by emailing info@sensirion.com. The instructions I received included following warning:

    After writing to the EEPROM it is not possible to reset to the factory settings. Do not write to any other field of the EEPROM. This may destroy the configuration and calibration of the system. Sensirion disclaims any warranty for sensors with changed EEPROM entries other than the I²C address.

    In addition, I was asked to not redistribute the instructions on a public server. The document was called "Application Note for I²C Flow and Differential Pressure Sensors" with subtitle "Change I²C address".

  • You do not need, and should not try, to pull up the lines externally on the Pi. – goldilocks Oct 26 '15 at 09:27
  • Thanks for the comments. I fixed the answer. Could you elaborate on the misinterpretation about the software? Do you mean the part where I write that only one device can be active in the bus? I mean that bus has hardware limitation that only one device can "talk" to the bus at a time. – Mikko Rantalainen Oct 27 '15 at 12:09
  • For example, Sensirion devices have latency around 8-10 ms if I read the datasheet correctly. If I put 20 such devices in a single bus and repeatedly read all of those, I can read each device about 5 times a second. This is because I need to read 19 other devices before each repeated read and each read takes around 10 ms for total of around 200 ms. – Mikko Rantalainen Oct 27 '15 at 12:11
  • Linux kernel can hide the fact that devices cannot be read simultaneously but it cannot hide the latency caused by hardware limitation. – Mikko Rantalainen Oct 27 '15 at 12:11
  • About pull up resistors: I had previously misunderstood that Pi didn't have I²C resistors maching the specification and if I connect multiple devices a pair of pull up resistors are needed. I had understood that the internal resistors were okay for a single I²C device only. – Mikko Rantalainen Oct 27 '15 at 12:15
  • The latency of a device does not determine the latency of the bus it is attached to. You do not have to wait for one request to complete to make another one. For example, if you had one process for each device, and the cost of a context switch is < 1 ms (casual guess), you could in theory query hundreds of such devices per second. This would certainly be true using threads, or (even better) poll()ing. – goldilocks Oct 27 '15 at 12:17
  • WRT pull-up resistors, even that Robot Electronics "Using the I2C Bus" tutorial says explicitly, "You only need one set of pull-up resistors for the whole I2C bus, not for each device...". The pull-up is just to ensure the line does not float when idle. – goldilocks Oct 27 '15 at 12:19
  • I mentioned the software thing because that tutorial has a section about implementing the I2C protocol on a low level. You don't need to, and I think will not benefit from, doing that when there's already a kernel interface available. So I wanted to make sure you knew about that and did not waste your time re-inventing the wheel. ;) – goldilocks Oct 27 '15 at 12:22
  • I moved all of my comments about the userland I2C API to here: http://raspberrypi.stackexchange.com/a/37690/5538 – goldilocks Oct 27 '15 at 14:24