How to access ADC GPIO pin with Python

5 1559

I am just wondering if there is an example how to use ADC GPIO with Python.

Do you mean the MicroChip MCP300x Series? I've used the MCP3002 over SPI, it has two Analog Inputs. I use one to measure Battery Voltage before it goes into the Voltage Regulator down to 5V.


    There has no ADC on Banana Pro/Pi. But LeMaker Guitar has.you can refer to this article to learn how to use ADC.

Thank you very much for your suggestions and I am sorry for the late reply.
remote.syst3m   : I meant the build-in ADC pins, without any external components.

john.wen : According to this  page Banana Pro has ADC, that's why I decided to ask this question on the forum.

Edited by sashijoseph at Jan 14, 2016 11:51

Well there is no adc on the gpio headers but the 12-bit adc of the (resistive) touch panel controller can apparently be hacked into.
The tp controller supports 3 functions=>

At present there is C-code for reading and writing the appropriate registers (for probing soc temperature) thanks to FM "FPeter"

You would need to set up the registers for your use case.

Go through the TP section of the A20 user manual.
a20 user manual rev1.3

The TP pins seem to be exposed in the camera connector csi port.

Do go through the manual thoroughly and proceed with caution lest you end up causing some hardware damage.

Dear sashijoseph,

Thank you very much for your reply. I am not that skilled to setup register by myself. I thought that there will be ADC on gpio header.

Thanks again.

You have to log in before you can reply Login | Sign Up

Points Rules