Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 6 months ago.
Transform in analogIn pin
Hello all,
I have 7 sensors. I need to take its mesures always. But there 're only 6 analogIn. How can I transform an other pin to an analogIn ? (for exemple the P14)
Thank you for your answers.
3 Answers
11 years, 6 months ago.
You can't, there is no hardware behind the other pins which can do an AD conversion.
You can use an analog multiplexer to use several sensors on one ADC input, but then you probably might just as well use an external AD converter. Or use sensors with onboard AD converter, you can get pretty much every sensor like that. Generally that is a superior solution compared to using the ADC of a microcontroller.
11 years, 6 months ago.
Yes, completely agree with Erik, an external ADC using say SPI will give superior results and are easy to drive. You can also select one to match more closely your interface requirements.
11 years, 6 months ago.
You can use a multiplexer for an existing analogIn pin. I think that a multiplexer is much cheaper than a ADC. It depends on what you have to measure.