Closed jonathanrjpereira closed 6 years ago
If I run the following command: python3 simpletest.py
I get another error:
Traceback (most recent call last): File "simpletest.py", line 7, in <module> import Adafruit_ADS1x15 ImportError: No module named 'Adafruit_ADS1x15'
I finally managed to fix this. Turns out it was faulty jumper wires between the ADC and RasPi. They were fine when I tested them with my multimeter continuity test( I guess it was probably the manner in which I held them while testing the continuity gave me a false positive). ALWAYS check your wires. Once I changed the jumper wires, it finally showed up as an i2c address and the code worked. Unfortunately the code still doesn't work in Python 3.6. I had to run it in Python 2.7.9. In addition to this, the raw value you get from the ADC is pretty much no use. At the end of the day, when I use an ADC I want my example code to return the 'voltage' instead of the raw value. I still haven't found a way of converting the raw value into a voltage level.
Concerning the conversion from raw data into a voltage level can you not take a ratio (e.g. 12 bit is 4096) to convert, it works for a DAC but I don't see any reason why it won't work for an ADC (reversed)
I created a PR with an example which covers this.
The original examples considered a 16-bit resolution for Single Ended Inputs. But according to the datasheet, 16-bit resolution applies only to Differential inputs whereas a 15-bit resolution applies to the Single Ended Inputs. I made an example which takes this into consideration and also calculates & prints the value of the Input Analog Voltage.
The data for conversion is in the documerntation for the chip. As a last resort, apply a known voltage to an input, read the result. Divide the voltage by the readout and come up with a multiplication factor. Change the known voltage and multiply by the multiplication factor and examine the result for accuracy and precision.
Like I said I created a PR with an example which covers this(Voltage Conversion) a few months ago. But it still hasn't been merged yet.
Acknowledged. Another source of that particular error is chip addressing. Connect the Addr to 5VDC, Vdd, SCL, or SDA and the same error will show up. As a matter of fact, the i2cdetect command is a good test of the address connection. I've often had problems with cheap 'Dupont' jumpers. I'm goint to try a more expensive set hyped a lot by the company that makes them. If that does not work I'm dumping jumpers altogether moving to a different method. Good luck.
I too have found jumpers to be problematic in various other projects. I have found that breadboard connections are more reliable than jumpers, although breadboards may not feasible in every situation.
Have you ever, successfully, addressed, two or more, ADS1115 modules/breakout boards?
No. So far I have only required single ended measurements. And the 4 inputs have been sufficient for my requirements.
Platform/operating system (i.e. Raspberry Pi with Raspbian operating system, Windows 32-bit, Windows 64-bit, Mac OSX 64-bit, etc.): Raspberry Pi 3 with Raspbian operating system
Python version (run
python -version
orpython3 -version
): Python 2.7.13Error message you are receiving, including any Python exception traces:
List the steps to reproduce the problem below (if possible attach code or commands to run):