Analog to Digital Converter

Hi,

I need analog to digital converter for pi.
I’ve found ADS1015 or ADS1115 be right ones for my project (these connects to I2C pins on raspberry pi).
There are also sample code for pi so it should work fine.

But how can I read values to Xojo from it? Do I have to make some plugin or driver with these python examples or is it possible to use it directly with Xojo GPIO module?

Or is there some other ad converters for pi (min. 12bit) that works out of the box with xojo?

Thanks

Jukka

I don’t get the answer that you need right now. But I will be doing guide on this one here for Xojo use:
PCF8591 AD/DA Converter Module Analog To Digital Conversion when I have had time to work on it. I already have them but have not had time to test / work with them (that is if I get them to work of course).

This document shows you how to measure analog signals with the PI

I have now python script that gives me right values from ADS1115.

I plan to loop it in thread with shell.execute and 100ms delay
something like this:

while 
    shell.execute "value.py"
    window1.py_value = shell.result
    me.sleep 100
wend

I think this should work?

But first I have to celebrate christmas time with my family and wait until my wife let me go back working :slight_smile:

Can you please share the details of your whole of hardware setup?
Also which range of the ADC do you want to build?
I want to know the details of the ADS1015 and ADS1115?
What are the specifications for your Pi?

Hi,

I have ADS1115 from Adafruit.
It’s connected like this:

Few things have to change in raspi-config:

  1. disable device-tree (there propably is not need for this but could not figure out)
  2. enable i2c

In /boot/config.txt You should have:
dtparam=i2c0=on
dtparam=i2c1=on
dtparam=i2c_arm=on
dtparam=spi=on
device_tree=

Install wiringPi, i2c-tools, python-smbus

Check your ads1115 address with:
i2cdetect -y 1
(my is 48)

I have this little xojo app that displays volts from A0 from ads1115 (Do not put more than 5V). It is configured as AINP = AIN0 and AINN = GND and gain amplifier is ±4.096V and it uses address 0x48. You can change all this from code.

I don’t use Xojo GPIO module because I haven’t got time to test it but it looks like you can do this also with it.
This uses i2c-tools (i2cset and i2cget from shell). I don’t know whitc is more efficient?

Jukka