{"id":528,"date":"2022-01-14T16:21:53","date_gmt":"2022-01-14T16:21:53","guid":{"rendered":"https:\/\/andrejacobs.org\/?p=528"},"modified":"2022-04-11T20:22:59","modified_gmt":"2022-04-11T20:22:59","slug":"converting-analog-to-digital-using-the-adafruit-ads1015-breakout","status":"publish","type":"post","link":"https:\/\/andrejacobs.org\/electronics\/converting-analog-to-digital-using-the-adafruit-ads1015-breakout\/","title":{"rendered":"Converting analog to digital using the Adafruit ADS1015 breakout"},"content":{"rendered":"\n

Image by Adafruit<\/a><\/p>\n\n\n\n

Overview<\/h2>\n

The ADS1015 can convert up to 4 analog signals to 12bit digital precision. The Raspberry Pi doesn\u2019t have a built in ADC and thus a module like this comes in very handy.<\/p>\n

I will be following\u00a0Adafruit\u2019s guide<\/a>\u00a0on how to use the ADS1015 breakout board.<\/p>\n

Soldering on the headers<\/h2>\n

I will be using the ADS1015 in a project and not on a breadboard, thus I will be soldering the headers to point out to the top (like a Raspberry Pi\u2019s GPIO).<\/p>\n

I placed the headers inside of a breadboard with the longer leads going into the breadboard.<\/p>\n

Then placed the ADS1015 on top of the headers and soldered them in place.<\/p>\n

\"\"<\/p>\n

Building a simple voltage divider<\/h2>\n

To do the initial testing of the module I will be using a simple voltage divider that runs of the 3.3V line of the Adafruit MCP2221A.<\/p>\n

I have covered how I use the very handy little Adafruit MCP2221A before on this post<\/a> and will be using this module again for communicating to the ADS1015 using I2C.<\/p>\n

\"\"<\/p>\n

Before moving onto installing the software and testing the ADS1015 I decided to dial in the divider to read +\/- 1V at the point where I will be hooking up the A0 port.<\/p>\n

NOTE: I tried powering the ADS1015 via the 5V line from the MCP2221A but then Blinka couldn\u2019t detect the MCP2221A module. Connecting it to the 3.3V line seems to solve the issue.<\/p>\n

Setting up the software<\/h2>\n

Please see\u00a0my post about the Adafruit MCP2221A breakout<\/a>\u00a0for how I setup Python projects like these on my Mac.<\/p>\n

My git repo for this module can be\u00a0found here<\/a>.<\/p>\n