Detecting sensor type


#1

Hello, I was just wondering if there is any way of determining which type of sensor is plugged into a particular port (eg. light or heat etc.) at runtime. I am doing a project involving the grovepi, and automatically being able to detect which sensor has been plugged in by the user would be really helpful.

Thanks in advance!


#2

Unfortunately there is no way to find which sensor is connected to which pin through the software. This is because most sensors are connected via Digital or analog pins and you cannot differentiate them on the basis of the data coming in. It might be possible for the I2C sensors such as accelerometers.

-Karan