# Ergo-meter power and calorie calculations.

Hi,

I’ve got an old exercise bike (ergometer) that I’m trying to build a new interface for. The bike is an old Precor C846, it works ok, but it only displays a single metric at a time i.e. pedal speed, OR power OR distance OR time OR calories.

My interface is pretty simple, but it has a 2x20 LCD display that can show all the data at the same time. I haven’t actually hacked the old bike, I’ve just added my own hall probe to the flywheel (to pick up the pedal speed) and added a button to allow me to set the resistance level to match that of the bike. The power is calculated from a map() function to replicate that shown on the ergometer.

My problem is that I can get all my metrics to exactly match those of the exercise bike except for calories consumed. If I set the bike to ‘rpm’ then the figure matches what my unit gives, if I set the bike to ‘power’, the figure also matches my unit, and the same for time, distance and heartrate.

The difference comes with working out the total calories consumed in an exercise session.

I can work out the energy used (joules) from the following…

``````  // work out the joules used so far. A joule is the work required to produce 1 watt for 1 second.
if ((millis() - ts5) >= millisBtwnJoule)
{
// power is an integer (typically 220 watts), joule is an long and millisBtwnJoule is an integer
joule = joule + long((long)((long)power*(long)millisBtwnJoule)/1000L);
//Serial.print("power=<");Serial.print(power);Serial.print(">, joule=<");Serial.print(joule);Serial.println(">");
ts5 = millis();                   // timestamp the moment the Joules used was calculated.
}
``````

The figure for joules seems to be exactly what I expect. 1 watt is one joule per second, so if I pedal at 200watts for 10 seconds I use 2000 joules.

There’s a simple conversion factor to get calories…

``````const float cf4 = 0.000239006;                   // conversion factor for converting joules to calories (1 joule = 0.000239006 kilocalories)

// for base unit's I'm sticking with SI units for power & energy (i.e. watts and Joules), for display
// purposes will use calories instead for comparison with the exercise bike
calories = (int)((float)joule*(float)cf4);
//Serial.print("calories=<");Serial.print(calories);Serial.println(">");
``````

The problem is that I just can’t get my figure for calories to match that shown on the exercise bike. I can get an exact match for pedal speed and power, but the exercise bike shows me using nearly 4 times a many calories as my unit calculates. At this point I’m not asking for a code fix, I’m asking for a sanity check on my understanding of energy and power and the relationship between them. Is the principle of what I’m doing about right?

The calorie figures the exercise bike displays do seem to approximately match what I see on other bikes when I do a similar training session at the gym, so I don’t think there’s a problem with it. But I know my power matches the power the bike shows, and the relationship between power and calories should be so simple that I can’t figure where I can have gone wrong.

Fulliautomatix:
The figure for joules seems to be exactly what I expect. 1 watt is one joule per second, so if I pedal at 200watts for 10 seconds I use 2000 joules.

That's mechanical output power/work.

Fulliautomatix:
There’s a simple conversion factor to get calories....

And 'calories' is measuring the 'input' that the driver eats with his meals.

Same thing as with a combustion engine. There is more energy in the fuel then you get as mechanical energy from the crank shaft. The rest is dissipated as heat and not delivered as mechanical work.

The human muscles do not provide 100% efficiency, so not all the calories eaten will become mechanical Joules on the pedal.

Efficiency of the human muscles is about 20% to 25%.

So each 4 or 5 calories (Joules) eaten from food can becom 1 calorie (Joule) mechanical output power at the pedal.

So you will not only need a factor to convert units from Joules to calories, you will need also another factor to take into consideration the efficiency of the human body while creating mechanical power from food calories.

Efficiency of the human muscles is about 20% to 25%.

So are you saying that the exercise bike is displaying the calories consumed by the cyclist, rather than the simple mechanical power produced at the pedals?

That would be a guess. For several measurements, plot "calories" versus "actual work done" from the original display to determine the relationship between the two variables.

Fulliautomatix:
So are you saying that the exercise bike is displaying the calories consumed by the cyclist, rather than the simple mechanical power produced at the pedals?

Yes exactly, I’d say the bike is displaying the “extra calories from food” that are burnt during the workout because of generating mechanical power.

So if mechanical power is created while the human muscle efficiency is 20% to 25%, the burnt calories are in the range
food calories burnt = (mechanically served calories)/0.2
to
food calories burnt = (mechanically served calories)/0.25

Bugger! I've spent ages trying to work out what's wrong with my calculations. Having done a bit more research it seems that many exercise bikes attempt to 'guestimate' the amount of calories actually burned during an exercise session, rather the actual crank power.

Judging by some posts on sports/training websites it seems the general rule of thumb is about 1kiloJoule = 1 kilo-calorie, which happens to almost exactly match the data I was seeing!

Being an engineer, I expect machines to give me (or at least attempt to give me) accurate and measurable figures based on physical constants, not to produce a number based on crude estimates of the efficiency of a human body!

Oh well, live and learn!

Thanks for everyone's input!