Low Voltage Warning for CC3D

Preamble

Following on from CC3D, I need a low voltage cutoff on my quad, for the 3S LiPo, as I am constantly running my batteries down to 3% of the batteries capacity.

The Problem

My problem is the same as this: Can a cc3d runnibg cleanflight run low voltage leds or buzzer?, except that I am running, the now defunct, OpenPilot.

Possible solutions

Some of these solutions are from the link above, as well as other solutions that I have put together, for completeness:

  • This is not a solution, but is neat anyway: CC3D Buzzer / Missing Alarm – Adding a missing alarm buzzer to a CC3D that you can control from your radio (PPM) for when you crash and cannot find the quad;
  • Build your own circuit, independent of the CC3D – see Build your own circuit below;
  • There is the functionality built in to the CC3D, if you are running CleanFlight, see CleanFlight Option below.
  • Use the SONAR/POWER port of the CC3D, which is supported by OpenPilot – see Power Sensor/Sonar – SWD Port below;
  • Use a Naze32, which has this functionality – not a useful suggestion
  • Use a timer on the Transmitter to warn you when you have use sufficient flying time
  • Get the HK e-OSD – Forget the wiring diagrams, they are unnecessarily complicated. All you need is a Y-adapter servo cable and a power source from the battery with a JST connector. The OSD provides voltage and flight time.
    Its not a buzzer but another handy alternative.
  • Use a separate LiPo voltage tester/buzzer (low voltage alarm), $1 on eBay, plugged into the balance port of the LiPo battery, or via a balance Y-cable. The alarm can be as below, with an LED display, or even more efficient, the alarm shown in the feature image for this article, as there is no seven segment LED to drawn current needlessly:

    LiPo voltage tester/alarm
    LiPo voltage tester/alarm

 CleanFlight Option

From Can a CC3D running CleanFlight run low voltage LEDs or buzzer?

  • If you are running CleanFlight

For those that don’t use the CC3D or the functions I’m after, here’s the buzzer part of CleanFlight https://github.com/cleanflight/clean…docs/Buzzer.md but it doesn’t tell me where the hard to solder tab is.

Here is the wiring diagram the CC3D needs to fit a buzzer https://github.com/cleanflight/clean…t.pdf?raw=true but again no explanation of where on the board I’m supposed to be soldering.

Here’s the LED stuff, https://github.com/cleanflight/clean…cs/LedStrip.md initially for RGB LEDs but leads onto LEDs as warnings, follow that to the battery monitor page https://github.com/cleanflight/clean…ocs/Battery.md which is the closest I’ve got but I don’t understand it very well where it starts mentioning voltage dividers etc and there’s no circuit explaining where and how to connect. It does at least explain where the pin to solder is a bit more but as they say, a picture speaks a thousand words.

I should have said I’m using SBUS.

From CleanFlight – Buzzer – CC3D:

CC3D

Buzzer support on the CC3D requires that a buzzer circuit be created to which the input is PA15. PA15 is unused and not connected according to the CC3D Revision A schematic. Connecting to PA15 requires careful soldering.

See the CC3D – buzzer circuit.pdf for details.

CC3D - buzzer circuit
CC3D – buzzer circuit

and

It says that the transistor circuit should be connected to the GPIO pin called PA15. It even tells you that this is pin 38 on the STM32 microcontroller

STM32F103xB
STM32F103xB
  • Again, if you are running CleanFlight, an alternative explanation

If you are running Cleanflight on the CC3D, then the Cleanflight documentation tells you where to connect to. See:https://github.com/cleanflight/clean…attery.md#cc3d
Also, you can’t just connect battery power to this, you’ll blow up the board! You must use a voltage divider made from a couple of resistors. See:http://www.ohmslawcalculator.com/vol…der-calculator

The buzzer should be connected to 5V, for example from one of the free power pins on the servo connectors. The resistor is connected from pin 38 on the MCU to the base of the 2N3906 transistor. The transitor’s collector is connected to ground. The emitter of the transistor is connected to the negative terminal of the buzzer.

Here’s the pins on the transistor:

From CleanFlight – Battery – CC3D:

CC3D

The CC3D has no battery divider. To use voltage monitoring, you must create a divider that gives a 3.3v MAXIMUM output when the main battery is fully charged. Connect the divider output to S5_IN/PA0/RC5.

Notes:

  • S5_IN/PA0/RC5 is Pin 7 on the 8 pin connector, second to last pin, on the opposite end from the GND/+5/PPM signal input.
  • When battery monitoring is enabled on the CC3D, RC5 can no-longer be used for PWM input.

So, to summarise, the two bullet points (pieces of information) above:

  • the voltage divider is connected to the Flexi-IO Port (see image of CC3D Revolution below), and;
  • the buzzer is connected to the PA15 pin

Power Sensor/Sonar – SWD Port

OpenPilot/LibrePilot supports use of the Power Sensor/Sonar port. This image, is for the Revo, which may not be the same as the standard CC3D (for example my USB port is on the bottom between the Flexi and Main ports, not the left hand side), but it shows the Sonar port:

CC3D Revolution
CC3D Revolution

From Docs » LibrePilot/OpenPilot User Manual » Revolution Board Setup, see Revo – Current/Voltage Sensor Setup, there are two options:

Basic voltage sensor

A basic voltage divider can be used, two resistors connected between ground and plus from battery.

../../_images/voltage_divider.png ../../_images/basic_voltagesensor_connection_revo.png

For a 4S battery (16.8Volts) the following values can be used:

  • R1: 2,2 KOhms
  • R2: 10 KOhms

With Vbattery = 16.8V, Vout = (16.8 * 2.2) / (10 + 2.2) = 3,03V

 

Current/Voltage sensor

../../_images/CurrentVoltagesensor_connection_revo.png

Here is a list of common Attopilot sensors that can be used:

Module Type Sensitivity VoltageFactor CurrentFactor VoltageZero CurrentZero
Attopilot 13.6V/45A 242.3mV/V, 73.20mV/A 4.127 13.661 0 0
Attopilot 50V/90A [1] 63.69mV/V, 36.60mV/A 15.701 27.322 0 0
Attopilot 50V/180A 63.69mV/V, 18.30mV/A 15.701 54.645 0 0

[1] Same as RCTIMER 90A current sensor

One has to be careful with these sensor cables, see Drones Flight Controllers blog, under the ArduPilotMega – Additional Required Extras – Power Module section, or this Instructables article Safetly use CLONE APM Power Modules – Instructables. They should not be used to power the flight controller, only for the voltage and current sensor. As we already power the CC3D via the onboard BEC of the PDB, this is not a concern, and the cheap eBay device will be fine.

On eBay, 90A APM2.5 APM2.52 AttoPilot Voltage Current Sensor Module APM Flight Controller, £2.94, normally £3.13

Build your own circuit

To build your own from discrete components, see Stack Exchange – Adding voltage cutoff to a circuit?, four resistors, an op-amp, a p-channel FET, and a TLV431 1.25 V reference,< 100 μA minimum regulation current compared to about 500μA for the 2.5 V TL431, R2/R3 divide Vmin to = 1.25V:

LiPo low voltage protection - No hysterisis
LiPo low voltage protection – No hysterisis

From This discussion page, here R6 adds hysteresis:

LiPo low voltage protection
LiPo low voltage protection

See also

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s