Most of the RC current sensor designs are using a hall effect-based current sensor, like the ACS758. In this project I would like to try something different (more difficult?) and use a conventional high-side current sensor to achieve the following goals:
- Maximum 60A continuous current sensing capability,
- Maximum 5S (18.5V) LiPo battery input,
- Send telemetry data (current, voltage, power and capacity) to my Jeti DS-24 transmitter,
- Lightweight, small (and cheap) design
In the project I used an STM32G431KBU which is a powerful 32bit processor in a small package (LQFP32). It is too much for this job, but I bought them in bulk because I would like to use them in other projects too.
The design based on a high-side current sense amplifier: MAX4081. The current from the battery to the speed controller flows through a precision high power current-sense resistor (CSS2H-3920R-L200FE) which is sensed by the MAX4081. The current-sense resistor dissipates its own I2 × R loss, so for 60A it would be 0,72W which can easily be handled by that resistor. The gain of the current sensor amplifier is 60V/V this sets the maximum load current at the full-scale sense voltage to ±125A (yes, it’s bidirectional!). Theoretically the current-sense resistor could also handle that load, but the XT60 connectors used in the design limits the current to 60A anyway. The voltage output of the MAX4081 corresponds to the sensed current (VOUT = VREF ± RSENSE × ILOAD(MAX) × AV) and is feed to the CPU’s ADC. The reference voltage for the MAX4081 is generated by the DAC of the CPU.
The analog section of the CPU is powered from an MCP1501 reference voltage (3V) to achieve adequate precision for the DAC and ADC.
Using a resistor voltage divider the ADC can also measure the battery voltage. At the moment the divider is set that the maximum voltage can reach 50V. From the current and voltage the power is calculated and with a help of a timer the used capacity can also be calculated reasonably well.
The complete hardware design is on github.
Note: the schematic displayed is rev.3 already which fixes two small issues, but those changes are not incorporated to the PCB design yet:
- The SWDIO and SWCLK is mixed
- The layout for the servo connector pins a bit inconvenient (the signal and positive power pins are swapped)
Anyway, they are small issues so if you want to rebuild the device you can order the PCB from OSH Park. The fully assembled rev.2 PCB as shown here:
Note that the ground connection wire is not soldered yet between the two terminals of the XT60. You really need a beefy wire there, because the PCB is not designed to handle 60A or so.
The software is very simple: after the initialisation of ADC, DAC and serial port of the CPU the ADC automatically reads battery voltage and current. A timer interrupt routine stores those readings in a local variable in every 10 millisecond. In the main loop the serial port scans for Jeti EX bus telemetry request and sends those measured values (current, voltage) along with the calculated ones (power and capacity) in the necessary format.
At the moment the sensor only supports Jeti EX bus protocol, but any other protocol can easily be implemented.
The firmware can be found here: github
The voltage measurement pretty accurate and does not need any calibration. For the current measurement the reference voltage generated by the DAC needs some calibration: set the DAC output to a value that the measured current is 0 with no load (it’s 2031 in my case). I have no electronic load capable to test more then 12A, but in that range the circuit measured the current also very well. Once the weather allows me I’ll test the circuit in my plane.
In terms of weight the device is 14 grams, but half of that weight is from the XT60 connectors. All the components and PCB set you back around €15 per device which is way less than any commercially available product with similar specification. And top on that you can hack it in the way you would like to.