ul-gh / PiPyADC

Python classes for interfacing Texas Instruments analog-to-digital converters with the Raspberry Pi
GNU Lesser General Public License v2.1
69 stars 27 forks source link

differential input #6

Closed lukruh closed 6 years ago

lukruh commented 6 years ago

first of all let me say good job! I've looked for a while for useful python code to use my AD/DA High-Precision Board, since the documentation for it is really bad as long as you are not familiar with C to understand the example code.

I didn't read the complete Class code to be honest.. just the example files. Am I doing right to build input pairs of two ADx-Inputs to get the differential voltage between two pins and remove the AINCOM-AGND jumper? For example(.py):

DIFF1, DIFF2 = POS_AIN1|NEG_AIN2, POS_AIN3|NEG_AIN4
CH_SEQUENCE = (DIFF1, DIFF2)

or do I need to setup anything else in the config/initiation of the ads object? I'm used to python, but have no clue about electric stuff and microcontrollers, thats why I ask... just to be sure ;). Further can I use a simple AAA-Batterie (1.5V) or whatever (below 5V ofc) to check if the variables and wirings are correct in my setup?

lukruh commented 6 years ago

Nevermind as I was writing this it seems legit enough to myself to try it and it works. Thanks for this simplicity was too confused by trying to use the bcm2835 C library ;)

ul-gh commented 6 years ago

Hi,

yes, although you do not even need to remove the AINCOM-AGND jumper.

When the jumper is set, the separate AINCOM pin of the ADC is connected to the screw-type terminals of the board, but due to layout imperfections, this is influenced by on-board stray currents causing offset drift. With the jumper removed, you can connect the AINCOM pin using a connector lead to the jumper, ruling out stray current influence (but chances are you could get a noise issue because of missing filter capacitors).

lukruh commented 6 years ago

Good to know I'll check how much that matter in practical use. Thanks for your answer.