analog input?

Started by sanzoghenzo, November 20, 2013, 12:56:51 PM

Previous topic - Next topic

sanzoghenzo

Hi all, given that I'm not so electronic savvy, is better to start with something simpler than interfacing a macbook lcd ;)

I just found this post that shows how to measure the capacity of a battery using arduino. It simply discharges the battery with a fixed load (some resistors) and logs the voltage every second. once the data is collected, it's just a matter of doing some math to know the maximum capacity.
The thing is, it uses arduino that has analog input pins. I saw A20 has LRADC1, but with only 6bit resolution and 2V max.
Should I use an external ADC connected to some GPIO ports and poll all of them? Is it the best way to do that? Note that I can be interested in using a similar setup to log temperature and humidity for another project.
Thanks for the attention, cheers from Italy!

sanzoghenzo

I found something... basically an external ADC connected to SPI (one of the two UEXT) interface and some python should do the job ;)
I see in the wiki
QuotepyA20 is Python library for access to A20-OLinuXino-MICRO GPIOs, I2C, SPI
but in pyA20.c I see only GPIO 1,2 and 3 pins definition. Can someone tell me if is there a way to use UEXT's SPI? or should I simply use some GPIOs like adafruit does?

blejku

I think, however, you can simply use I2C. There are a lot of A / D according to the needs, measurement tempraretury and humidity is also not a problem.
For Python need to install python-smbus for I2C
There is no need to use the GPIO. I2C is in the ports Uext
I use mostly Maxim Integrated circuits but it's a lot.


Pozdrowienia z Polski :-)