Detect which sensor connected and general sensors

Thread Starter

ikosen

Joined Jul 16, 2012
1
I am doing a project with an arduino and an array of sensor, and I would like to be able to detect which sensor is connected to my circuit.

If I connect a temperature sensor it will be able to output the temperature [C], but if it was a force sensor it would output the result in newton [N]. The problem is to detect which sensor is connected, without having a micro controller connected to the sensor circuit that would send some bytes that was unique for different kind of sensor.

My though is to include a resistor in the sensor circuit and thereby measuring what kind of sensor that is connected. Would that be possible?

In addition to this:

If I have lets say 4 jack connectors connected to the arduino, and I made some sensor circuits which also had a jack connector and I would like to be able to connect any sensor to any jack port on the arduino and get the results, how would you construct the sensor circuit.
As far as I can tell there are some sensors which will output some milivolts when used and some which can be measured by resistance, but I want the sensors to be read by the same circuit which would require some sort of tweak to the sensor to have them either output milivolts or output resistance.

The sensors we are talking about could be (pH-meter, temperature, force, decibel ect...)

Hope that someone can help.
 

Sensacell

Joined Jun 19, 2012
3,445
You need to standardize the interface, by adding circuitry to make all your sensors output the same range of voltages, 0-5 V, for example.

This requires that you design signal conditioning that suits each type of sensor, be it voltage output, resistance change etc. You really have multiple 'projects' to complete that may require very different design solutions.

Now for identifying the sensors:

Let's say each sensor 'unit' had a 4 pin plug:
+5V
Signal Out
GND
IDENT

The IDENT signal could be as simple as a different value resistor (as you suggest) for each sensor, or as complex as a serial data stream that provided calibration data for that specific sensor.
 

wayneh

Joined Sep 9, 2010
17,498
Another, more complicated approach would be to define the output of every relevant sensor when it is connected directly to the Arduino. Then have the Arduino measure and decide what sensor is attached. It may or may not be able to tell them all apart without the right conditioning.

The device could then switch out the direct connection to the Arduino and switch in the appropriate conditioning circuit as required. It might be necessary to try more than one type of conditioning before the Arduino can decide which type of probe it is.

This all sounds like a nightmare to work out, but at least in theory it would accomplish the job of making a "smart" interface.
 
For the ident part you could use an I2C EEPROM, you could even store additional data after the ident code if you wanted (calibration data, settings, etc).

It does mean 2 extra wires but you could also use the I2C lines for digital communication for any sensors that use a microcontroller, or sensors that natively use an I2C interface.
 

mcasale

Joined Jul 18, 2011
210
As folks here are saying, this is not a trivial project.

As stated, you'll need to standardize the interface to the Arduino or external ADC. A range of 0-5VDC is a good starting point.

Depending on how many possible types of sensors you have, a set of DIP switches might be easier to use to identify the sensor type. How many types of sensors can be connected at one time, or is this just single-channel?
 

wayneh

Joined Sep 9, 2010
17,498
You know, a color coding scheme for your jacks would go a long way here. Or you could even use a range of non-interchangeable power adapters as jacks, preventing improper hookup of a sensor to the wrong port.

Simple and old-school, but cheap and effective and you could have it built in less than a day.
 

mcgyvr

Joined Oct 15, 2009
5,394
I think including an extra pin for a resistor included with the sensor is a neat idea.. Probe that analog pin first, read its value and change your scaling or whatever,etc.. based on the detected sensor.
 

wayneh

Joined Sep 9, 2010
17,498
..including an extra pin for a resistor included with the sensor is a neat idea..
+1 That'd be easier overall than the approach I described earlier, of trying to determine which sensor is which from its signal alone. But it requires setting up each sensor in advance, maybe making it less plug-n-play for additional sensors. Up to the OP.
 

mcgyvr

Joined Oct 15, 2009
5,394
If he is going to produce/sell these sensors (like sensor bricks) then it would be plug/play.. And put more money in his pocket.. :)
 

MrChips

Joined Oct 2, 2009
30,806
I think what he has is a brilliant idea. Like true Plug & Play.
However all the above approaches don't come close to the perfect solution.

Since every sensor will require some conditioning in order to adhere to a standard, we might as well embed a tiny mcu in each sensor.

Firstly, you have to consider how is the sensor being powered if power is required?
The ideal approach is the one-wire system where both power and data are supplied via one wire plus ground.

The objective is to minimize the number of wires required to connect to the sensor. Thus the minimum wired solution would be two wires, power/data and ground. This is doable but would only work for sensors that require very little power.

The next best solution is three wires, DATA, POWER and GND. This is an excellent solution and is fairly easy to implement.

For a robust industrial application, I would choose RS-485, which would require four wires, +DATA, -DATA, POWER and GND.

The beauty with such a system is that you can use standard USB cables and connectors.
Moreover, you can have as many sensors connected to the system all at the same time.

The system will know exactly what and how many sensors are plugged in.

What more can you ask for?
 
Top