I have a board, which is the host for several different sensors. All sensors have the same 4 pin plug with the following pin-out:
- Pin: VDD
- Pin: Signal
- Pin: Free
- Pin: VSS
Means, I got 1 free pin, on each plug.
All plugs / sensors should be interchangeable and the MCU should be able to determine, which sensor is plugged in.
My MCU, does not have enough analog pins left, otherwise I could so something like put a voltage divider on each board and read the analog value.
I have still enough digital pins left.
I would like to be able to determine at least 20 different kinds of sensors, better 32.
Is there a neat little trick, to achieve this?
Some other SE questions, that are on a similar topic, but did not solve my issue:
What is a good way for the mcu to determine which hardware version it is running on?