Data Logging a paintball trigger movement with an external ADC

I'm trying to build a datalogging device to plot force vs. displacement data of a paintball gun trigger. How I plan for my system to work is to use a stepper motor linear actuator with a load cell attached to it to push against the trigger, measuring force. A linear potentiometer will be actuated at the same time to measure displacement. Given the nature of a trigger actuation, I need a lot of very precise data in a very short time frame.

For my requirements and to future proof my design for adding additional sensing capabilities down the road, I landed on using a Teensy 4.1 with an external ADC from TI ADS131M08IPBS Texas Instruments | Integrated Circuits (ICs) | DigiKey, which samples at 32khz and a 24 bit resolution. It can also sample simultaneously on 8 different channels which allows for more expandability in the future. To prototype with this chip, I bought a SOIC-8 breakout board and I understand to interface my chosen external ADC with the Teensy I need an external 8.192 MHz clock ECS-2520MVLC-081.92-CN-TR ECS Inc. | Crystals, Oscillators, Resonators | DigiKey.

At a high level, how I understand my system to operate will be for the Teensy to log the raw sensor data input and store it to RAM, then write to an SD card or transmit via ethernet where I can filter the raw data with DSP using Python. However I know the Teensy is capable of DSP and has an audio library built for it, which would be nice to use if possible.

From my basic understanding, I think I should have enough RAM, assuming I sampled at 32 kHz and I collect my trigger data over 3 seconds, 32000kHz x 3s x 24 bits = 2304000 bits which is only 0.3 megabytes.

For the pin connections, this is what I landed on based on my research from the datasheets.

Power Supply and Ground:
DVDD from ADC goes to Teensy 3.3V.
AGND from ADC goes to Teensy GND.

SPI Communication:
ADC SCLK (serial clock) to the Teensy SCK (SPI clock) pin 13.
ADC DIN (serial data input) to the Teensy MOSI (master out, slave in) pin 11.
ADC DOUT(serial data output) to the Arduino’s MISO (master in, slave out) pin 12.
ADC CS (chip select) to any digital pin.

External Clock:
Tri-state pin to any digital pin of the Teensy for controlling the clock state.
Output pin to the XTAL1/CLKIN pin of the ADC.
VDD and GND to the Teensy 3.3V and GND lines.

This is the datasheet for the load cell I plan on using:
SM-Installation.pdf (interfaceforce.com)

The load cell has a natural frequency response of 1 kHz which I know is far below the 16kHz frequency that my sensors are capable of...from what I understand this limit is half of my sampling rate to avoid aliasing.

It has an excitation voltage of 10V and a bridge resistance of 350 ohms, so it should consume around 30mA.

I also I know that my ADC has a built-in instrumentation amp at each pin which I can use to amplify the load cell signal since the output is rated at 3mV/V which is too low to read from the Teensy.

This is a pic from the specs of the linear pot I will be using:

Right now some of the things I need help with are figuring out how to power all the peripherals of my system. The stepper I will be using will likely run off 12V and consume max 2A. The load cell needs an excitation voltage of 10V and will consume around 30mA. Since its a resistive linear pot, it can run off any voltage from what I understand, but the signal sent to Teensy should be converted to the 0-3.3V analog range. I don't really understand what this means.

Another issue I ran into with the external 8.192MHz clock was that it's insanely tiny so I ordered this adafruit clock generator breakout board instead. Adafruit Si5351A Clock Generator Breakout Board — 8KHz to 160MHz | Raspberry Pi в Киеве (Украина)

I would really appreciate any advice related to my approach, the hardware choices I made, any major hurdles or key things I need to consider, etc. All my experience with Arduino and sensors is at the basic hobby level so all the signal processing stuff is pretty new to me and a lot of the things I said could be totally wrong. I am open to other options for peripherals and sensors which might be able to achieve what I'm doing simpler or better.

Some of the things I considered were piezoelectric load cells rather than strain gauge ones and piezoelectric linear actuators instead of a stepper motor. I also considered using a stepper motor with an encoder and microstepping so I can remove the redundancy of the linear pot, but I know there are some added considerations there regarding backlash. Some of the caveats of my system which I understand is that I probably won't get 24 bits of clean data, some of it will be noise.

To start I'm just looking to integrate my microcontroller, ADC and external clock to read some data from the load cell and linear pot. At the moment I'm unsure of exactly how I can process the signals from these sensors and convert the measurements in Newtons and meters. I'm pretty clueless when it comes to the software side and the ADC chip I'm using is uncommon so it's not really as simple as finding a youtube tutorial that does what I'm doing unfortunately know this is the Arduino forum and I'm using a Teensy but I figured the principles and process is the same. If I can get some help with starter code or pointed in the direction of some areas to research, etc., that would be really helpful, thanks!

Interesting project.

To start I suggest you get your Teensy 4.1 working with an example code (see IDE File/Example/....)

Obviously the ADS131M08IPBS is next. There are libraries but the one I looked at didn't have any example sketches (most libraries include an example).

Read voltages and print to the serial monitor.

Next the load cell. First thing I noticed the load cell you linked shows it is used for tension. Is this how you have it mechanically connected?

Next, I have not performed any comparison, however typically a load cell (bridge) uses an instrumentation amplifier. They do a better job at rejecting noise than two measurements with one subtracted from the other.

If you were one of my guys I would ask: What do you hope to determine with your data? At 32kHz sampling rate I doubt you are under-sampling, however what mechanical part do you expect to move in 31µsec? And how to you make the mechanical system stiff enough to be able to report with at such a rate? We've performed a lot of vibration analysis and keeping the mechanical resonances out of our frequencies of interest was a substantial effort. And were were well below 10k Hz.

Here's a better link for the load cell datasheet: SM-S-Type.pdf (interfaceforce.com). Here it says it works under compression as well, which is how mine will be connected since the load cell pushes against the trigger.

Regarding the instrumentation amplifier, I plan to use the built-in instrumentation amp in the ADC chip but I'm not sure how to go about this at the moment. The key things I'm looking to determine from my data is the maximum pull weight of the trigger and also look for signs of trigger creep. I know for my current setup I don't need to sample at 32 kHz as the load cell only has a frequency response of 1 KHz, however in the future I plan to add other sensing such as from lasers which I would want to get a lot more data from.

For my proof of concept prototype I plan on 3d printing the test fixture, but after that I plan on getting the fixture machined out of aluminum or steel, which I hope would give my system the necessary rigidity to prevent vibration. That is something I didn't consider though, thanks for bringing it up.

I've already setup my Teensy and went through the basic tutorials, now I'm just hoping for some type of example sketch to get started integrating the ADC with the Teensy.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.