ROS2 Jazzy driver for ADS1015 12-bit 4-channel ADC over I2C (Texas Instruments).
The ADS1015 is the faster, lower-resolution sibling of the ADS1115 (16-bit). It offers data rates up to 3300 SPS (vs 860 SPS for ADS1115), making it ideal for applications that need speed over precision. Same pinout and register layout as ADS1115.
- Publishes
std_msgs/Float32per active channel onadc/channel{0-3} fake_modefor testing without hardware (random Gaussian data)- 4 single-ended channels, configurable PGA (±0.256V to ±6.144V)
- Fast data rates: 128–3300 SPS
- Voltage offset calibration via service call
- Runtime
publish_ratechange viaros2 param set
- ROS 2 Jazzy
- Python 3
smbus2(pip install smbus2) — only needed for real hardware
cd ~/ros2_ws
colcon build --packages-select ads1015_adc --symlink-install
source install/setup.bashros2 launch ads1015_adc ads1015_launch.pyros2 run ads1015_adc ads1015_node.py --ros-args -p fake_mode:=trueros2 launch ads1015_adc ads1015_launch.py params_file:=my_params.yamlads1015_adc_node:
ros__parameters:
fake_mode: false
i2c_bus: 1
device_address: 0x48
active_channels: [0, 1]
pga_gain: 1
data_rate: 6ros2 topic echo /adc/channel0| Parameter | Type | Default | Description |
|---|---|---|---|
fake_mode |
bool | true |
Use fake driver (no hardware) |
i2c_bus |
int | 1 |
I2C bus number |
device_address |
int | 0x48 |
I2C address (0x48–0x4B) |
publish_rate |
double | 10.0 |
Publishing rate (Hz) |
active_channels |
int[] | [0,1,2,3] |
Channels to read (0–3) |
pga_gain |
int | 2 |
PGA: 0=±6.144V, 1=±4.096V, 2=±2.048V, 3=±1.024V, 4=±0.512V, 5=±0.256V |
data_rate |
int | 4 |
DR: 0=128, 1=250, 2=490, 3=920, 4=1600, 5=2400, 6=3300 SPS |
| Service | Type | Description |
|---|---|---|
adc/calibrate |
std_srvs/srv/Trigger |
Collect samples for 2s, compute voltage offset bias |
adc/reset |
std_srvs/srv/Trigger |
Clear bias, reinitialise sensor |
ads1015_adc/
├── CMakeLists.txt
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── .gitignore
├── package.xml
├── config/
│ └── ads1015_params.yaml
├── launch/
│ └── ads1015_launch.py
├── nodes/
│ └── ads1015_node.py
├── ads1015_adc/
│ ├── __init__.py
│ └── ads1015_driver.py
└── test/
└── test_ads1015_node.py
Tested on Ubuntu 24.04 (WSL2) with fake_mode: true.
| Test Category | Test | Result |
|---|---|---|
| Topics | adc/channel{0-3} publishes std_msgs/Float32 |
PASS |
| Services | adc/calibrate returns success=True |
PASS |
| Services | adc/reset returns success=True |
PASS |
| Parameters | publish_rate runtime change |
PASS |
| Shutdown | Clean exit | PASS |
| Linting | pep257, flake8, copyright, xmllint | PASS |
MIT