Hi, looking for some suggestions on how to measure watts produced on stationary exercise bike.
A little background info: My exercise bike computer recently stopped working, throwing error messages, changing intensity on the fly etc. Out of warranty I checked the pcb but couldn't find any issues so decided to make my own using a nodeMcu I had lying around. I'm currently successfully measuring rpm's using the reed switch (magnet on crankset) and controlling pedal intensity by setting a dumb servo which moves a magnet next to the metal flywheel.
My question: The old computer displayed wattage produced by pedaling, this gave me a handy indication of workout intensity. How does one measure (or estimate) wattage? Wish I had paid a little more attention in physics classes 
PS. Bike internals: Crankset drives a belt which drives a heavy flywheel. A large movable magnet next to the flywheel sets cycling intensity
Power = force X velocity.
Velocity (rpm) is fairly easy.
Force is not. Your problem is likely to be calibration for the magnet position.
Only way i can think would be a strain gauge somewhere , possibly under the foot on the pedal.
Not easy i suspect, with that sensor the magnet position would not be needed either, just used as an adjustable drag.
EDIT
Possibly you could adapt the magnet mount to measure the force there.
It would probably be more accurate than under the pedal where th force varies.
My guess is that the underlying math was to calculate calories from the distance walked.
Something like: Walking Calorie Burn Calculator | SHAPESENSE.COM
Once you know calories, you know Watts and vice-versa.
Ray
Power meters have become fairly common in the professional training area.
They can be rather expensive though.
In my experience with converting a stationary bicycle trainer to output wattage, you can not get there unless you have the calibration equations from the manufacturer.
I think your best option is to treat the trainer as a closed system with the workouts based on magnet position, rpm and time. You can work with these factors to define your training zones and workout routines. You won't be able to brag about wattage with your friends, but you can implement scientific zone based training.
Hi all,
Only way i can think would be a strain gauge somewhere , possibly under the foot on the pedal.
Yes, wikipedia mentions the use of strain gauges in modern cycle power meters, will require a lot of effort to implement.
My guess is that the underlying math was to calculate calories from the distance walked.
I think that's similar to what the old computer was doing, estimate wattage based on a factory calibrated lookup table and converting to calories.
How about this: I attach an ac motor to the crankshaft using a belt and measure amperage and volts at certain rpm intervals and certain intensity settings. Then create a lookup table based on these figures, factoring in roughly the inefficiencies of an ac motor.
Incidentally the old pcb included an eeprom IC I'm guessing contains some lookup table.
fredkadet:
How about this: I attach an ac motor to the crankshaft using a belt and measure amperage and volts at certain rpm intervals and certain intensity settings. Then create a lookup table based on these figures, factoring in roughly the inefficiencies of an ac motor.
Incidentally the old pcb included an eeprom IC I'm guessing contains some lookup table.
That should work , you will need to remove the magnet though.
One question that Boardburner2 brought up initially, but was never really answered - is there some sort of measurement system in place on the magnet next to the flywheel to measure the force (drag) created by the magnet? Do they move the magnet closer to the flywheel to increase the drag or do they move it from in next to the center out towards the edge of the flywheel (holding the same distance from the flywheel) to vary the drag?
Ones i have seen do not bother with the extra expense .
I assume they have a calibrated table related to the position of the magnet or knob.
I think your best option is to treat the trainer as a closed system with the workouts based on magnet position, rpm and time. You can work with these factors to define your training zones and workout routines. You won't be able to brag about wattage with your friends, but you can implement scientific zone based training.
Was afraid of that... Porbably be what I end up doing, not very satisfying though...
That should work , you will need to remove the magnet though.
I'm thinking of leaving the magnet on to gauge the effect on watts needed at certain rpm's / certain resistance settings. Am getting a bit ahead of myself though, as I have no motor, no speed controller, no belt and no pulleys... Been watching a little too much Mathias Wandel... 
One question that Boardburner2 brought up initially, but was never really answered - is there some sort of measurement system in place on the magnet next to the flywheel to measure the force (drag) created by the magnet? Do they move the magnet closer to the flywheel to increase the drag or do they move it from in next to the center out towards the edge of the flywheel (holding the same distance from the flywheel) to vary the drag?
I assume they have a calibrated table related to the position of the magnet or knob.
The hinged magnet faces the 'tire' edge of the flywheel and moves closer to increase drag and vice versa. There is no sensor other than the position feedback form the servo, I also think its factory calibrated as the position of the magnet can be calibrated using a screw.
fredkadet:
I'm thinking of leaving the magnet on to gauge the effect on watts needed at certain rpm's / certain resistance settings. Am getting a bit ahead of myself though, as I have no motor, no speed controller, no belt and no pulleys... Been watching a little too much Mathias Wandel... 
The motor will absorb power and also the magnet.
It may be difficult to work out a linear relationship with that arrangement.
Possibly use a variable resistance to short the windings to give the required resistance.
If you ever had a cycle with a dynamo they impose a definite resistance when pedalling so a big motor is not required.
Mine had a friction band and when it stopped working i was able to use dynamometer equations to approximate using a spring scale.
BTW seems to be a common problem, several at local gym have non working displays.
EDIT
Maybe putting a rubber wheel on a dynamo and pressing it against the wheel would work.
Boardburner2:
Possibly use a variable resistance to short the windings to give the required resistance.
If you ever had a cycle with a dynamo they impose a definite resistance when pedalling so a big motor is not required.
Thanks, trying to understand your suggestion though. Are you suggesting to 1. remove the magnet, 2. place a dynamo on the flywheel, 3. vary the coil resistance of the dynamo to match resistance set by the original magnet position, then 4. measure the output of the dynamo?
Yes pretty much, did not think of 3 though.
Not sure how you would make the force comparison though.
Pedalling a dynamo bike and switching a light on and off makes a noticeable difference.
By having a variable load (resistance) you control the bikes resistance..
Measuring the current and voltage gives a direct readout of power.
If you can find a way of comparing the forces you can derive a calibration table for your magnet position.
If you can wrap a rope around the wheel dropping a weight out of the window might work.
Turning that around, perhaps driving the wheel with a motor , measuring the current draw for different magnet positions could give a direct comparison.
Thinking about how old spedometers worked if you could somehow measure the force on the magnet with a spring balance you could get a calibration point maybe.
EDIT
You mentioned an ac motor.
I think driving a DC motor with a lab supply would be easier.
Not sure how you would make the force comparison though.
Yes, that would have been my next question 
Turning that around, perhaps driving the wheel with a motor , measuring the current draw for different magnet positions could give a direct comparison.
That was what I was originally thinking, driving the crankshaft and calculating wattage based on current, then factor out inefficiencies using some reference table on ac motor losses (if such a thing exists).
Many thanks for all your input guys! As suggested self calibrating an exercise bike is more trouble than its worth really.
Just had a thought. The original bike computer had trouble controlling the servo motor, setting the servo at the wrong position, and throwing intermittent error codes. It was though still able to display speed and watt calculations based on rpm and perceived servo position for a decent length of time. What if I simulate a list of rpms and make a table of the watt readouts!
EDIT. No will not work... I can't be sure of the servo positions the original computer used... Oh well.
One issue with changing the magnetic drag for drag produced by a motor/generator is that the load becomes dependent upon the speed, and without gearing you can't have cadence independent from the resistance.
I think the idea of trying to measure the force on the magnet at different distances with some sort of scale might work as well as driving the system with a motor and measuring the current draw for different magnet positions.
fredkadet:
EDIT. No will not work... I can't be sure of the servo positions the original computer used... Oh well.
Yes it will , just change the units from Watts to whats.
You should get comparative measurements from your performance.
Add a fudge factor .
You can boast i did 100 whats today , they will not know the difference. 