Complete Info on build, program, test, and data collection, for a budget prony brake dyno for small motors and engines.
I am building a small diesel engine and needed an affordable dyno to do some testing after I get it running. I still have a ways to go on the engine, but I DIY'd a simple prony brake dyno and was able to test and record the data from a sewing machine stepper motor that is rated at about 1kw. RPM is collected thru a hall sensor and the PULSEIN function, rather than interrupts like others seem to use. As soon as the pulsein function reads the micro secs for one revolution and converts that to RPM, a force reading is taken from the prony brake lever arm pushing against the load cell. That force, along with the length of the lever arm gives the torque, and that along with the RPM is used to calculate the HP (or kw). The prony brake method is a very old method and takes a little eye-hand coordination to get a good run of the dyno that yields a nice looking output graph without weird humps and dips in it. Because a dyno run only takes a few seconds, doing repeat runs is quick and easy so long as the friction part of the prony brake, or the motor are not over-heated.
Here is the code, a napkin schematic, and a you tube video showing the hardware, electrical, setup, and a dyno run, and full explanation. The video is kind of long and geeky, but there are some jump-to times in there if your attention span is that of a puppy, LOL. I spent less than $40 USD on this and it is pretty ok for that. I am sure it can be improved upon in all aspects, but it is a good start considering what ANY kind of dyno SW or HW cost (gasp!).
I have credited a couple of forum members with some of the code, and I am grateful to them for making this first Arduino project a success. Their help is listed in the opening comments of the code.
I don't really have any questions at this time, but comments (constructive, of course, ha ha) are welcome and appreciated.
Lloyd-ss
```cpp
//** Prony Brake Dyno
//Or any other load absorbing dyno
//Arduino sketch and its associated Excel program for instrumentation
//of a small prony brake dyno as demonstrated on YouTube
//***https://youtu.be/7QtO2RXxbck?si=lA_l2PzZd3d5cmJ7***
//by Lloyd-ss (aka, on YouTube) the Airgun Lab
//Uses Hall Effect sensor and 5kg Load Cell with HX711 amp board
//Sketch for Arduino Nano by Lloyd-ss
//
//But based on the work of ** Net^Devil ** for the new "PLX DAQ v2" and
//its associated Arduino Sketch
//Thank you, Net^Devil, your work is much appreciated!!
//*
//And also based on the Load Cell work and library done by Rob Tillaart
//FILE: HX_kitchen_scale.ino
//AUTHOR: Rob Tillaart
//PURPOSE: HX711 demo
// URL: https://github.com/RobTillaart/HX711
//
////////////////////////
// Library file for the loadcell amplifier board
#include "HX711.h"
HX711 scale;
//Pin assignments for the output pins of the HX711 loadcell amp board
uint8_t dataPin = (A5);
uint8_t clockPin = (A4);
// variable for the sequence counter for use in the Excel program
int i = 0;
//
//This is the input pin that receives the output from the Hall Effect sensor
const int rpmPin = 2;
long int duration = 0;
long int RPM = 0;
int torque = 0;
void setup() {
//A5 is the data output from the loadcell amp
//int sensordataValue = digitalRead(A5);
// open serial connection at 9600 Baud
Serial.begin(19200);
// Prep the Excel spreadsheet for new data
Serial.println("CLEARDATA"); // clears the excel spreadsheet starting at row 2
// define 8 columns in the Excel sheet named: Date, Time, Timer, Counter, RPM,
//Force, Torque, and HP. Data will be written to these columns
//%Serial.println("LABEL,Timer,Counter,RPM, Force");
//
// These next 3 lines are start up info for the loadcell amplifier. The offset and scale
//need to be determined by running the calibration routine from the library mentioned at the
//top of this sketch. The offset adjusts the "Zero" point. The scale makes the
//loadcell output read directly in pounds (or grams, etc.).
scale.begin(dataPin, clockPin);
scale.set_offset(610500);
scale.set_scale(211831);
//This sets the pinmode to recieve the High and Low readings from the Hall sensor
//The pullup seems to be necessary for signal stability
pinMode(rpmPin, INPUT);
}
void loop() {
//Hall Effect sensor for the RPM
//****HiLetgo NJK-5002C 3 wire Hall effect sensor****
//Use the Pulse-In function to time how long it takes the magnet(s) on the
//motor shaft to turn one revolution. Mine uses 2 magnets at 180 degrees
//so the timing is for a half revolution. Using 2 magnets improves the data
//acquisition at low RPM. Magnets must be accurately space at 180 deg for accurate readings.
//Only one magnet is needed for higher rpm.
duration = 0;
duration = pulseIn(rpmPin, HIGH, 10000000);
// The pulseIn number is in micro seconds. This numerator over the duration
//has to found by trial and error until the correct RPM is
//printed in the spreadsheet.
RPM = 57058000 / duration;
//
//Now that there is an RPM data point, the Loadcell can be read to find out
//the force from the prony brake lever arm. (I don't know what the 5 does.)
Serial.println(scale.get_units(5));
float force = (scale.get_units(5));
// Convert the analog force reading in pounds to torque by multiplying
// by the torque arm length in feet
float torque = (force * .71);
float HP = RPM * torque / 5252;
//print the data values into the spreadsheet, and then continue to the beginning of theloop.
Serial.println((String) "DATA,TIMER," + i++ + ", " + RPM + " , " + force + ",AUTOSCROLL_20");
delay(1);
}
Here is a napkin sketch schematic.

And here is the you tube video that shows all of it.
https://youtu.be/7QtO2RXxbck?si=NSZDGIm_fuOKpI4T