Integza
Published © CC BY

DIY Torquemeter - Device to Measure Dynamic Torque

This is the result of a project to build a simple and cheap torque meter. For a more detailed tutorial visit Integza on YouTube.

BeginnerFull instructions provided2 hours8,659
DIY Torquemeter - Device to Measure Dynamic Torque

Things used in this project

Hardware components

SparkFun Load cell
×1
SparkFun HX711
×1
SparkFun Photointerrupter
×1
SparkFun Breakout Board
×1
Resistor 220 ohm
Resistor 220 ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

Photointerrupter support

Load Cell Support

Friction Clamp

Flywheel

Code

DIY Torquemeter Code

Arduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

#include "HX711.h"
#define calibration_factor 2150.0 //This value is obtained using the SparkFun_HX711_Calibration sketch
#define DOUT  26
#define CLK  27
HX711 scale(DOUT, CLK);
const int irPin = A8;
int triggers = 0;
unsigned long elapsedTime;
int laststate =0;
const unsigned long sampleTime = 1000;
int rpmMax=0;
void setup()
{
lcd.begin(16, 2);              // start the library
lcd.setCursor(0,0);
lcd.print("MaxRpm:");
lcd.setCursor(0,1);
lcd.print("Torque:");
pinMode(irPin, INPUT);
Serial.begin(9600);
scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0

}
void loop()
{
  
  int rpm=rpmGet();
  if (rpm > rpmMax)
  {
  rpmMax = rpm;
  }
  lcd.setCursor(8,0);
  lcd.print("       ");
  lcd.setCursor(8,0);
  lcd.print(rpm);
  lcd.print(" rpm");
  torque();
}



int torque()
{
  lcd.setCursor(8,1);     // move cursor to second line "1" and 9 spaces over
  lcd.print("        ");
  lcd.setCursor(8,1);     // move cursor to second line "1" and 9 spaces over
  float force = ((scale.get_units())/100);
  float arm = (28);
  int torque = (force * arm) ;
  lcd.print(torque);      // display seconds elapsed since power-up
  lcd.print(" Nmm");
  Serial.println(scale.get_units()); //scale.get_units() returns a float

}

int rpmGet()
{
unsigned long currentTime = 0;
unsigned long startTime = millis();
while (currentTime <= sampleTime)
{
int val = digitalRead(irPin);
if(!val)
  {
      if(laststate){
      triggers++;
      laststate=0;
                   }
  }
else
    {
      laststate = 1;
    }
    currentTime = millis() - startTime;
}

int countRpm = int(60000/float(sampleTime))*(triggers/2);
triggers=0;
return countRpm;
}

Credits

Integza
3 projects • 14 followers
I have a lot of weird ideas and a degree in mechatronics and that should explain my videos.
Contact

Comments

Please log in or sign up to comment.