Intro
In my first iteration of sensors I relied on wire connections between sensors and the actual node board. The result for a motion sensor and a temperature and humidity sensor looks like this
The problem with that is that during sensor modules assembly run I spend quite a bit of time on the wiring. On top of that, the result is a mess of small wires inside a box. It makes it hard to add another sensor. Another thing that can improve a sensor is to just connect the modules directly to the PCB. The problem here is that there is no universal order of I2C pins on modules. Here are a bunch of modules
So attaching 2 sensor modules looks like this
Far from ideal. Another one!
What to do?
I have a few options at the moment
1 – Route 4 I/O pins
Make everything software configurable, each pin can be either GND, VDD, SCL, SDA and use software I2C. The problem here is that it creates a dangerous situation concerning the power supply: during the microcontroller startup there is no control of the I/Os and it may end up damaging the sensor. On top of that, I will need 4 dedicated pins for each sensor, so 3 sensors would need 12 pins instead of just 2.
2 – Multiple, different headers
It is quite clear from the picture on top that one of the order is quite common: VDD, GND, SCL, SDA. So in this proposal I would use 1-2 headers in this configuration plus 1 header in the second most popular configuration. Great…but wait! Some sensors need to be oriented in a specific direction so I might actually need a header with a reverse direction. Still not good.
3 – Jumpers
The last option is to use solder jumpers where each pin of the I2C header can be connected to either of the 4 options: VDD, GND, SCL, SDA. Drawback: lots of PCB space.
Hm…everything seems far from ideal.