Electronic – arduino – How to make a self-recognition socket for diferent connectors (sensors)

arduinoconnectordeviceraspberry pisensor

I am working on an electronic device, to which will be a lot of sensors on wires connected to a panel with sockets. Is there any option that will recognise which sensor is connected to a which socket? On the device-box will be a lot of same sockets.

I never made something like this, but I think, that it will be possible with resistivity between some wires and the computer recognise trough this which sensor is it. I will have also Arduino as a slave, so i will be able to use analog inputs/outputs.

May there is an option where three wire sensor is connected to a more pins connector and some pins will be connected together and some logic behind the socket panel recognize what is connected.

Sensors are all digital some of them are using 1-Wire (DS18B20) and some I2C (BH1750)

Datasheets

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

The I2C ideas already mentioned by others are good, but they do suffer from the complexity needed to be added to the sensor or cable and, since the devices are active, powering them can be an issue if you do not add sufficient pins to the connector to do so.

A simpler approach is to simply add a resistor to each device. Then include circuitry on your board to scan each socket for the presence of said resistor using a ADC circuit with a MUX and pull-up.

The latter could all be hooked up directly to your micro, or a cheap scanner micro could be added to monitor the connector and communicate with your main micro via I2C or serial, or whatever.

Again though, without more information on what your idea of "sensors" is, this question is just too broad.