{"id":745,"date":"2019-06-14T20:26:29","date_gmt":"2019-06-15T03:26:29","guid":{"rendered":"https:\/\/doubleecpu.com\/?page_id=745"},"modified":"2019-06-15T21:05:58","modified_gmt":"2019-06-16T04:05:58","slug":"pi-16adc","status":"publish","type":"page","link":"https:\/\/doubleecpu.com\/index.php\/raspberrypi3bsensors\/pi-16adc\/","title":{"rendered":"Pi-16ADC"},"content":{"rendered":"\n<p>Raspberry Pi HAT (expansion board) designed for the Raspberry Pi B model 40 pin connector. Pi-16ADC uses a <a href=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/Pi-16ADC\/Pi-16ADC-py.zip\">LTC2497 <\/a>chip that adds sixteen (16) single end or 8 differential Analog to Digital Converter (ADC) ports for collecting data from analog sensors or devices. With a sampling Data resolution 16 bits on all 16 ports. Sample code in Python is available to program analog sensor connections to a Raspberry Pi over an I2C address if needed. Solder-less connections via screw down terminal block and additional solder points are provided for each input channel and ground. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1167\" height=\"1590\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/20190614_224241.jpg\" alt=\"\" class=\"wp-image-755\"\/><figcaption>Pi-16ADC<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Features<\/h3>\n\n\n\n<p>Each terminal block connection is paired as Channel-Ground. (ex: Channel-0 and Ground is in the top left corner. Channel-1 and Ground is the next pair going clockwise). *To minimize spurious readings and stray noise pickup, it is recommended to use the channel-ground pair as provided. It is also recommended to connect unused channels to the ground with a short jumper wire when a channel is not in use. <br>All terminal block connections are marked on the board. Each terminal block Channel also has a corresponding solder point next to it. These are also labelled and are shown below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setup<\/h3>\n\n\n\n<p>Pi-16ADC communicates with the Raspberry Pi using the I2C bus.  <br>To set the address, 3 jumpers A0, A1 and A2 are provided. <br>Each jumper can be<br> 1) Connected to +5V \u2013 state defined as \u201cHigh\u201d.<br> 2) Connected to Ground \u2013 stated defined as \u201cLow\u201d.<br> 3) Removed \u2013 state defined as \u201cFloat\u201d.<br>27 possible addresses can be defined using the I2C address jumpers (listed in sample code). <br>Check <a rel=\"noreferrer noopener\" aria-label=\"I2C (opens in a new tab)\" href=\"https:\/\/doubleecpu.com\/index.php\/raspberrypi\/pinouts\/\" target=\"_blank\">I2C<\/a><a href=\"https:\/\/doubleecpu.com\/index.php\/raspberrypi\/pinouts\/\"> <\/a>is Setup<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"443\" height=\"228\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/I2C_Peripheral_Check.png\" alt=\"\" class=\"wp-image-752\"\/><figcaption> The default address is 0x76 (A0=High, A1=High, A2=High) <\/figcaption><\/figure>\n\n\n\n<p>Clone Repository or <a href=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/Pi-16ADC\/Pi-16ADC-py.zip\">Download Code<\/a><br> git clone <a href=\"https:\/\/github.com\/gilmedel\/Pi-16ADC\">https:\/\/github.com\/gilmedel\/Pi-16ADC<\/a> <br>The python code uses time, smbus, sys, os, subprocess  python scripts.  Starts by initializing the i2c bus, address, and channel to be used,  sets reference variables used for Voltage, reading, <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Connect Analog Sensor<\/h3>\n\n\n\n<p>Connect analog sensor output to channel0 on the terminal block connector and common ground. The signal must be between .2-2.5V (-2.5 to 2.5 V for differential comparison) <\/p>\n\n\n\n<p>To run code from Terminal setup a virtual environment for Python and activate and install any missing dependancies<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 -m venv pi16_test-env\nsource pi16_test-env\/bin\/activate\npip install smbus\npython3 pi16adc_test.py<\/pre>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/doubleecpu.com\/wp-content\/uploads\/2019\/06\/Connect_Analog_Sensor.png\" alt=\"Running Test python code\" class=\"wp-image-764\" width=\"576\" height=\"222\"\/><figcaption>Running Test python code<\/figcaption><\/figure>\n\n\n\n<p>In this example a soil moisture sensor is connected. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi HAT (expansion board) designed for the Raspberry Pi B model 40 pin connector. Pi-16ADC uses a LTC2497 chip that adds sixteen (16) single end or 8 differential Analog to Digital Converter (ADC) ports for collecting data from analog sensors or devices. With a sampling Data resolution 16 bits on all 16 ports. Sample &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/doubleecpu.com\/index.php\/raspberrypi3bsensors\/pi-16adc\/\" class=\"more-link\">Read more<span class=\"screen-reader-text\"> &#8220;Pi-16ADC&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":160,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-745","page","type-page","status-publish","hentry"],"featured_media_urls":[],"_links":{"self":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/comments?post=745"}],"version-history":[{"count":0,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/745\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/pages\/160"}],"wp:attachment":[{"href":"https:\/\/doubleecpu.com\/index.php\/wp-json\/wp\/v2\/media?parent=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}