1
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ You should edit your question to explain what format the signal from each sensor is. That will have a large bearing on the solution. Add links to datasheets for each of the sensors. \$\endgroup\$ – Transistor Nov 18 '17 at 16:27
1
\$\begingroup\$

You could use an analog method of resistance or voltage to determine the sensor, but that requires an extra pin per sensor, plus a way to communicate that back to the RPI.

Instead, look at i2c sensors. Each sensor would have a unique address and the RPI can scan for these sensors using the LM-sensor or i2c-tools package.

Of course, you want to mix and match how these sensors are wired so a custom solution by you is require. You already have the basic idea down.

\$\endgroup\$
  • \$\begingroup\$ Are you able to describe it more detailed, please? For example for one 3-wire sensor and two sockets? \$\endgroup\$ – Josef Brich Nov 18 '17 at 13:55
  • \$\begingroup\$ I2c is a bus, so they would be wired in parallel, and the i2c system scans the device address. The i2c sensor only responds to the master when it's address is called. Google rpi i2c sensors for an example. \$\endgroup\$ – Passerby Nov 18 '17 at 13:57
1
\$\begingroup\$

Details of your sensors are not well understood (from your question - if you fix this you may get better answers). If we can assume nothing about the type of sensors, consider adding a small form factor I2C or SPI EEPROM in the sensor's cable to identify the type of sensor. For example, a VGA monitor self identifies using pins 12 (ID1/SDA) and 15 (ID3/SCL) of the VGA cable.

Using this technique, it would be trivial to employ the correct calculations necessary to deal with a T-type verses a K-type thermocouple. Likely one of this simplest (and durable) sensors possible.

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.