Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: dsp on March 19, 2015, 03:10:16 pm

Title: how do I read values of LRADC0/1?
Post by: dsp on March 19, 2015, 03:10:16 pm
Hello,
I would like to read the analog voltage of a sensor and use it in puredata or python.

1) how do I read the values of LRADC? I only find information how to read the digital I/Os.
2) Is this a sensible way to connect an analog sensor to the LIME2? or would it be better to use e.g. a Pinguino Board and connect this to some GPIO with I2C?

I am using the A20 LIME2 board to make an electronic music instrument and this is my first post here.
Any help appreciated...
Dominik
Title: Re: how do I read values of LRADC0/1?
Post by: dave-at-axon on March 19, 2015, 04:48:41 pm
What resolution do you need from your sensor? What is the range of output from your sensor?

The LRADC is only 6 bit so not very good for general sensor interfacing as this is only 64 bits.

Better you use an external ADC with higher bit count with a min of 12 but ideally 16 bit gives the best resolution. There are a number of I2C interfaced IC's that can be used with ease with the A20. I use the MCP3428 4 channel 16 bit device and it gives a nice clean signal.
Title: Re: how do I read values of LRADC0/1?
Post by: deskwizard on March 19, 2015, 05:06:20 pm
Just to shime in, I am with Dave on this, an external I2C ADC would probably be the best course of action
Title: Re: how do I read values of LRADC0/1?
Post by: Gerrit on March 19, 2015, 10:31:56 pm
For now the only way is via the sun4i-keyboard module

https://www.olimex.com/forum/index.php?topic=2425.0
Title: Re: how do I read values of LRADC0/1?
Post by: dsp on March 23, 2015, 02:37:59 pm
thank you for your answeres!

I have used one Arduino board now and connected it via I2C. This basically works.
I need to learn a bit more about I2C though: I can only send/receive one byte number.
I would like to send 10 bit value. but it's better than 6bit :)

thank you Gerrit. Good to know which road to turn to get the LRADC to run. The name sounds to me like it could be used as audio in...