Hey guys,
I have a microcontroller with multiple 5 pin connectors wired up to it. I also have a bunch of different sensors. I am hoping to have all of the sensors use the same plug, and be able to be plugged into any of the connectors (even though they each operate differently).
What is the best method for the microcontroller to detect which sensor is present by using an additional wire used only for this purpose?
For example... should each sensor have its own resistor value, so the first thing that happens when the sensor is plugged in is that the microcontroller reads the analog voltage created by the resistor to determine what it us?
Then I was slightly worried that what if the wires are longer/shorter that it might change the resistance on that wire...
Is there a better method for doing this?
I have a microcontroller with multiple 5 pin connectors wired up to it. I also have a bunch of different sensors. I am hoping to have all of the sensors use the same plug, and be able to be plugged into any of the connectors (even though they each operate differently).
What is the best method for the microcontroller to detect which sensor is present by using an additional wire used only for this purpose?
For example... should each sensor have its own resistor value, so the first thing that happens when the sensor is plugged in is that the microcontroller reads the analog voltage created by the resistor to determine what it us?
Then I was slightly worried that what if the wires are longer/shorter that it might change the resistance on that wire...
Is there a better method for doing this?