TeensyLoadcell Direct Loadcell Readout with T3.2

Well, why add an external ADC if the internal is good enough for the application? But most important, I need a much faster readout (1ms) than the HX711 provides (80ms). I also tested a LTC2053 (instrumentation amplifier) which works great but since I don't need the performance...
 
its neat to use a T3.2 for the ADC

for more precision do you need a higher resolution ADC or a more stable voltage supply ?
 
Last edited:
for more precision do you need a higher resolution ADC or a more stable voltage supply ?
The main issue with using the built in PGA for load cells is its max gain of 64. The signal from a usual load cell after a 64x amplification is still too small to use the full input range of the ADC which limits the precision. As often, you can trade measurement precision by measurement speed. E.g. with a 5ms time constant of the exponential smoothing algorithm "setTau(0.005)" I ended up at about 10bit precision. If you increase the time constant you can improve that.

Anyway, if you need high precision you are better off with an instrumentation amplifier (see linked data sheet with load cell example above) where you can adjust the gain to the input range of the ADC. Or, if speed is not an issue use the HX711 which does a nice but slow job.
 
The T3.2 has 2 ADC/PGAs. ADC0 uses the differential pin pair A10/A11 and ADC1 uses A12/A13. So, you can connect 2 load cells. TeensyLoadcell is able to use both in parallel (you pass the used adc module in the constructor). But to be honest, I only tested adc0 :)
 
Hi Lini,,

I am liking what you have done with a T3.2

I have a project where I want to read 4x Load cells

could i use 8 x analogue pins to do this on a T3.2 ?

if i use a normal analogue pin does this mean there is no amplification PGA ?
 
No, the T3.2 only has two differential pairs and only these are connected to the PGA. You can not measure the load cell output voltage directly (they would be too small).
 
i try to use your code but it gives me following error can you please help. I'm very new in programming cant sort this problem.

Thanks in advance
Regards


Arduino: 1.8.13 (Windows 7), TD: 1.53, Board: "Teensy 3.2 / 3.1, Serial, 72 MHz, Faster, US English"



C:\Users\Emilio\Documents\Arduino\libraries\Teensy Loadcell-master\src\TeensyLoadCell.cpp:4:17: error: operator '==' has no left operand

#if ADC_USE_PGA == 0

^

C:\Users\Emilio\Documents\Arduino\libraries\Teensy Loadcell-master\src\TeensyLoadCell.cpp: In member function 'void TeensyLoadcell::Loadcell::start()':

C:\Users\Emilio\Documents\Arduino\libraries\Teensy Loadcell-master\src\TeensyLoadCell.cpp:75:29: error: no matching function for call to 'ADC_Module::enableInterrupts()'

adc->enableInterrupts();

^

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ADC/ADC.h:59:0,

from C:\Users\Emilio\Documents\Arduino\libraries\Teensy Loadcell-master\src\TeensyLoadcell.h:3,

from C:\Users\Emilio\Documents\Arduino\libraries\Teensy Loadcell-master\src\TeensyLoadCell.cpp:1:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ADC/ADC_Module.h:184:10: note: candidate: void ADC_Module::enableInterrupts(void (*)(), uint8_t)

void enableInterrupts(void (*isr)(void), uint8_t priority = 255);

^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ADC/ADC_Module.h:184:10: note: candidate expects 2 arguments, 0 provided

Error compiling for board Teensy 3.2 / 3.1.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
 
It looks like the ADC library had some breaking changes recently. Maybe the simplest and quickest would be to checkout an older version of the ADC library.
 
I just found it and tried it that relise was 2019 it gives exactly the same error for me

C:\Users\Emilio\Documents\Arduino\libraries\ADC-8.0.0/ADC_Module.h:175:10: note: candidate expects 2 arguments, 0 provided
Error compiling for board Teensy 3.2 / 3.1.
 
I'm very new in programming cant sort this problem.

So, I assume you are not too familiar with git. I therefore rolled back the changes in ADC to the last commit (52a0d77) with the old enableInterrupt() and did a git archive of it: View attachment adc_52a0d77.zip. If you replace your ADC library with this version it should compile.
 
I just found it and tried it that relise was 2019 it gives exactly the same error for me
Sorry crosspost. Unfortunately the library is not blessed with a lot of tags / releases. -> See post #16
 
Perfect,
Hope you do not expect too much performance wise. If you need really good loadcell readouts you should go for an external ADC like the HX711.
 
nice job. I too am using these load cells but with the HX711. We (my high school race car team) built a dynamometer to test our electric motors. I get a lot of noise from the load cell and we're still trying to figure out how to clean the signal up.
 
Back
Top