### Abstract

This technical article discusses the application of signal chain, power management, and microcontroller ICs in a practical force-sensing product—a bicycle power meter. The reader will learn the physics underlying the operation of bicycle power meters and the design of the electronics. The solution described in this article has very low power consumption, is able to accurately amplify small, low frequency signals, is low cost, and has small size.

### Introduction

A bicycle power meter is an instrument that measures the power in watts expended by cyclists as they ride their bicycle. These power meters are used as training aids to provide feedback to cyclists on their workload. For example, a cyclist may set a goal of maintaining at least 200 W power output during an uphill climb. If the power drops below this, it can be increased by either pedaling faster or shifting to a higher gear. The power is usually displayed on a head unit attached to the handlebars of the bike. There must be a wireless connection between the power meter and the device that computes and displays the power. To measure the power, it is necessary to measure the mechanical strain applied to some part of the bicycle’s drivetrain. Strain gages connected in a Wheatstone bridge circuit are used for this purpose. The signal generated by the Wheatstone bridge is typically very low frequency and very small; hence, it needs to be amplified by a high precision amplifier with zero-drift input offset voltage. Furthermore, since a power meter is always battery powered, the overall current consumption of the power meter must be minimal.

The MAX41400 is a low power, high precision instrumentation amplifier (in-amp), which operates with a supply voltage range of 1.7 V to 3.6 V. In addition, the device features rail-to-rail inputs and outputs. Eight input-selectable fixed-gain settings are provided. Important for low frequency signal applications, the high 1/f noise typically found in CMOS input amplifiers is eliminated by virtue of the zero-drift typical 1 μV input offset voltage. Typical current consumption is 65 μA with a shutdown mode that reduces the supply current to 0.1 μA. The MAX41400 is available in either a 1.26 mm × 1.23 mm, 9-ball WLP package or a 2.5 mm × 2 mm, 10-lead TDFN package. The small package size is ideal for bike power meters, which usually have severe size constraints.

The other key IC in the bike power meter is the MAX32666 microcontroller unit (MCU). This is an Arm^{®} Cortex^{®}-M4-based MCU with an integrated Bluetooth^{®} low
energy (BLE) radio. The signal from the in-amp is sampled with the MAX11108 successive approximation register (SAR) analog-to-digital converter (ADC), and the digital samples are transmitted wirelessly to an Android device running application software to calculate and plot the power.

### Theory of Operation

The bike power meter discussed in this article measures the bending strain of the bicycle’s crank arm. The crank arm is a bar that has the pedal attached to one end and the other end connected to the bottom bracket. As the cyclist pedals, a force is applied to the crank arm, and the crank arm rotates with a certain angular velocity. Refer to Figure 1. The following discusses the physics upon which the operation of the power meter is based.

Work is the energy transferred by a force. Work is done when a force is applied to a mass that causes the mass to be displaced over some distance. The work, W, done to displace an object a distance, d, by applying a force, F, is given by Equation 1. Only the component of the force vector that is in the direction of displacement does work.

Using SI units, force is measured in Newtons and distance in meters, resulting in the work having units of Newton meters or joules. A joule is the amount of work done by a force of one Newton acting over a distance of one meter.

Power is defined as the rate at which work is done. It is defined by Equation 2.

P is the power in watts, W is the work in joules, and t is the time in seconds.

Considering the relationship between torque and power, if we know the rate of rotational speed, otherwise known as the angular velocity, we can calculate power. Power is (force × distance)/time. Consider a bicycle crank arm that goes through one complete revolution in t seconds. Assume a constant force is applied throughout the revolution. The distance over which the force is applied is simply the circumference of a circle with radius r where r is the length of the crank from the pivot point to the point where the force is applied.

F × r is the torque, denoted by *τ*, and there are 2*π* radians in a complete circle, so 2π/*τ* is the angular velocity, denoted by *τ*. Equation 3 can be rewritten as Equation 4.

Hence, to calculate power, we need two quantities: torque and angular velocity. Since torque is just the product of force and the length of crank arm, which is a constant, we need to measure applied force and angular velocity. Note that only the tangential component of the force vector contributes to the power since it is the only component of the force vector that is doing work.

One simplification made in the derivation is that the applied force is constant throughout the revolution of the crank arm. This is not true in practice. For example, when the crank arm is vertical (that is, in the 6 o’clock or 12 o’clock position if the crank arm was the minute hand of a clock), the tangential component of the force will be zero. The radial component of the force is maximum, but the radial component does no work. The tangential component of the force will be greatest when the crank is horizontal (3 o’clock or 9 o’clock position). This means the torque will vary continuously throughout one complete revolution, so we need to sample the force multiple times throughout the revolution.

The bike power meter discussed in this article is attached to the left-side crank arm. We only measure the power expended by one leg and assume the power expended by the other leg is on average the same. We double the power readings obtained from the power meter to account for the total power output by the cyclist. More sophisticated (and expensive) power meters measure the power of each leg separately.

The force is measured using strain gages and the angular velocity is measured using an inertial measurement unit (IMU) gyroscope. However, as an alternative, for saving power and cost, a technique for deducing the angular velocity by using signal processing of the strain gage signal is discussed later in this article.

### Force Measurement

The loading force causes mechanical deformation of the crank arm, in this case bending. Other components of the drive train such as the spindle that goes through the bottom bracket will be subject to torsional strain, which some models of bike power meter make use of.

The standard way to measure strain is with a type of sensor called a strain gage. A strain gage is a very thin, long metal wire embedded within a flexible material. The strain gage is applied to the surface of the object for which we want to measure the strain. The orientation of the strain gage depends on the type of strain we wish to measure. As the object deforms, it causes the wire in the strain gage to either be stretched or compressed. If the wire is stretched, it gets longer and thinner. Since the resistance of the wire is inversely proportional to the cross-sectional area, and directly proportional to the length, both these deformations of the wire cause the resistance to increase. If the wire is compressed, it gets shorter and thicker resulting in decreased resistance. The undeformed strain gage will have some nominal resistance. Standard values are 120 Ω, 350 Ω, and 1 kΩ. As the strain gage is compressed or stretched, the resistance will change slightly around its nominal value. The bike power meter in this article uses 1 kΩ strain gages to minimize the current flowing through the Wheatstone bridge.

To measure such small changes in resistance, the circuit known as a Wheatstone bridge is commonly used. Refer to Figure 2.

The bridge consists of two voltage dividers in parallel. There is some excitation voltage, V_{EX}, applied between the top and bottom of the bridge. The output voltage is taken as V_{o} shown in the figure. The equation for output voltage is given below.

If the bridge is balanced, meaning R4/R3 = R1/R2, then V_{o} = 0 V. In a so-called quarter-bridge configuration, one of the four resistors is replaced by the strain gage. For example, R4 is replaced by R_{g}. As R4 changes value, the bridge becomes unbalanced, and the differential voltage, V_{o}, becomes nonzero.

In the power meter discussed in this article, a half-bridge configuration is used where R4 and R3 are the strain gages and R1 and R2 are dummy 1 kΩ resistors. Using two strain gages rather than one doubles the amplitude of the signal coming out of the bridge. It also intrinsically provides temperature compensation. Temperature also causes the wire of the strain gage to expand or contract affecting the resistance, so it is indistinguishable from mechanical strain. However, since the two strain gages are in proximity and so at the same temperature, the temperature-dependent resistance changes will cancel out.

### System Description

The complete system comprises a small narrow PCB attached to the left crank arm, the strain gages applied to the crank arm, and an Android device such as a smartphone or tablet that receives the raw data from the PCB via BLE and calculates and displays the power.

Figure 3 shows the block diagram of the PCB.

The whole PCB is powered from one CR2032 coin-cell battery. The nominal 3 V voltage of the battery will vary over the lifetime of the battery but will gradually decrease as the battery capacity is depleted. Since we need stable, precisely controlled voltages for the ADC and in-amp reference and excitation voltage for the bridge, the raw battery voltage is boosted up to 3.8 V using the MAX17227 boost converter. The 3 V excitation voltage for the bridge and ADC reference voltage is generated using the MAX6029 voltage reference off the 3.8 V supply. The 3.0 V supply voltage for all the ICs is generated from a MAX1725 LDO regulator.

The differential voltage output from the bridge is amplified and converted to a single-ended voltage by the MAX41400 in-amp. The voltage divider connected to the in-amp REF input provides a reference voltage of 1.5 V. The amplified strain gage signal is sampled with the MAX11108 ADC. This is a 12-bit SAR ADC with a serial peripheral interface (SPI). The angular velocity is measured using the gyroscope in the microelectromechanical system (MEMS)-based IMU. The IMU is controlled by the MCU via the I^{2}C interface.

The MAX32666 MCU runs firmware that controls the power cycling of the circuitry, collects ADC and IMU samples, and puts this data into BLE packets, which are periodically transmitted.

### Power Consumption Minimization

The circuitry on the PCB is heavily duty-cycled to minimize the average power consumption. The sampling rate used for the force-sensing is 25 Hz. Once every 40 ms, the MCU awakens from deep sleep mode where most of its internal circuitry is powered off or in a low power state. The firmware then awakens various analog components from their low power state. For example, there is a MOSFET transistor in series with the excitation voltage to the strain gage bridge acting as a switch. This transistor cuts off DC flow through the bridge when the bridge is not being used. The bridge is equivalent to a 1 kΩ resistor between 3 V and GND, so a DC of 3 mA flows through the bridge when the switch is closed. This current flowing all the time would greatly increase the total average power consumption. The in-amp has a shutdown input pin, which is controlled via a general-purpose input/output (GPIO) of the MCU. The in-amp is in shutdown state except for the brief interval when the force signal is sampled. Similarly, the ADC is kept in its low power state until just before and just after the force signal is sampled and the value read out. Transitioning the ADC between low power and active states requires writing SPI commands. Finally, the IMU current consumption is minimized. Only the gyroscope is used and not the accelerometer, so the accelerometer is permanently kept in low power mode. The gyroscope is only active for the minimum time required to capture the sample and read it out, and the rest of the time is in a low power state. Furthermore, the angular velocity is only sampled at a rate of 1.6 Hz. Later in this article, it is shown that the IMU can be dispensed with entirely, saving additional power. Once the force and possibly angular velocity have been sampled and the samples stored, the MCU goes back to deep sleep mode. Once a certain number of samples have been accumulated, the MCU packs them into a BLE packet, which is transmitted. When the board is not in use, a slide switch in series with the battery disconnects the battery from the rest of the circuitry.

When the IMU is being used, and the board is operational, the measured average current consumption from a 3 V power supply is 760 μA giving an average power consumption of 2.3 mW. This is for the whole system including the Wheatstone bridge. With the typical 225 mAh energy capacity of the CR2032 battery, this would give an operating lifetime of about 296 hours. If the IMU is removed, the current drops to 640 μA from a 3 V supply for an average power consumption of 1.9 mW, giving a 352 hour operating lifetime from the CR2032 battery.

### Angular Velocity Estimation

Figure 4 shows the tangential component of force in Newtons applied to the crank arm of a bicycle measured over a complete revolution. When the crank arm is rotating, the tangential component of the applied force varies periodically.

In principle, it is possible to calculate the angular velocity by performing signal processing on the force signal. The signal processing algorithms were coded using MATLAB^{®}. The basic approach was to take a vector of consecutive force samples and fit a sinusoid having the form given in Equation 6.

A is the amplitude, ω is the angular velocity, ɸ is the phase, and B is the offset.

The optimization cost function is given by Equation 7. This is a least squares cost function where ŷ is the vector of measured data points and y is the output of Equation 6.

The MATLAB minimum search nonlinear programming solver was used to find values for A, ω, ɸ, and B, which minimizes the value of C in Equation 7. The resulting value of ω was taken and the other values are not used. After estimating ω for the current vector of samples, the next contiguous set of samples is collected and the process repeated. In rare cases, the minimization search fails to converge and the cost is much higher than normal. In this case, the calculated value of ω is discarded, and the previous value used.

To prove the concept, a BLE sniffer was used to capture a series of packets that were transmitted during operation of the bike. The packets contain both angular velocity and force samples. The contents of the packets were extracted and postprocessed using MATLAB scripts. The estimated cadence in revolutions per minute is plotted along with the cadence indicated by the gyroscope in Figure 5.

### Energy Measurement

Since the mechanical work done by the cyclist is simply the integral of the power over time, sufficient data exists to calculate the energy expended by the cyclist. The application software numerically integrates the power over time, which gives the mechanical work done in joules. This is scaled by the conversion factor to convert joules to kilocalories. The assumption made is that the body consumes four joules of chemical energy to do one joule of work, so an additional scaling factor of four is used to estimate the kilocalories expended by the cyclist.

### Demonstration Video

The solution described in this article was implemented on a stationary exercise bicycle, as shown in the Bicycle Power Meter video. Two strain gages were applied to the left crank arm of the bicycle and a small PCB containing the electronics was attached to the crank arm and wired to the strain gages.

### Conclusion

This article describes the use of the low power, high precision MAX41400 instrumentation amplifier in a force-sensing application, specifically a bicycle power meter. Combined with the low power MAX32666 MCU and a handful of Analog Devices’ power management ICs, a solution that consumes only 2.3 mW average power is described.