Article Preview
Buy Now
FEATURE
Raspberry Pi Sensor Fun with ADS1115
Programming the ADS1115 with Xojo API2 and the Einhugur I2C Plugin
Issue: 23.3 (May/June 2025)
Author: Eugene Dakin
Author Bio: Eugene works as a Senior Oilfield Technical Specialist. He has university degrees in the disciplines of Engineering, Chemistry, Biology, Business, and a Ph.D. in Chemical Engineering. He is the author of dozens of books on Xojo available on the xdevlibrary.com website.
Article Description: No description available.
Article Length (in bytes): 21,920
Starting Page Number: 31
Article Number: 23303
Resource File(s):
project23303.zip Updated: 2025-04-30 22:34:07
Related Link(s): None
Excerpt of article text...
The ADS1115 is widely used with sensors to read signals from pressure sensors, light sensors, and temperature sensors. Other applications include industrial automation, data acquisition systems, medical devices, environmental monitoring (such as humidity), embedded electronic systems that require high-resolution input, robotics, and audio applications for signal processing and sound capture.
Since the Raspberry Pi does not have an analog port or pin, it is common to use another device to read the analog voltage into the Raspberry Pi. Using the I2C communication protocol simplifies this process, as only a few wires are required to transmit voltage data. The ADS1115 is a popular 16-bit analog-to-digital converter (ADC). This article will guide you through programming the ADS1115 with Xojo API2 and the Einhugur I2C Plugin.
The ADS1115 has many advantages, including the ability to measure voltages up to 6 volts, the capability to measure raw voltage and differential voltage across two pins, and good sensitivity. Four inputs are available, and in this example, we will use a range of 0.0 volts to 3.3 volts, as this is the main power supply range of the Raspberry Pi.
Some configuration on the Raspberry Pi is necessary to interact with I2C using Xojo. Here are the steps.
Install I2C Plugin for Use with Xojo
It is presumed that a Raspberry Pi 4B or 5 is being used with the latest Raspberry Pi OS, and the program is running in 64-bit mode. This project uses Bjorn Eiriksson's I2C plugin, which can be downloaded online (
https://www.einhugur.com/Downloads/Plugs/I2CPlugin.zip
). More documentation is available at Bjorn's website (https://www.einhugur.com/Html/I2CPlugin/index.html
).
...End of Excerpt. Please purchase the magazine to read the full article.