On STM32L4 based boards, there are three sources of power, each of which flows through a diode and then goes through a linear 3.3v regulator. The diode tends to drop about half a volt or so, and the regulator drops about 0.2 volts. So if the input voltage is 3.0 volts, what the processor gets is about 2.3 volts. The STM32L4 processor runs just fine on 2.3 volts, so that’s not really a problem. And when the saber is on, the booster runs, which provides 5 volts to the regulator, and in that case we have a stable 3.3v source.
The ESP32S3 is far pickier about input voltages. (At least from what it says on the data sheet.) It wants 3.0 volts or higher to run properly. That either means that we need to run the booster all the time, or we need to come up with a better solution for providing 3.3 volts to the processor.
It would be nice if there was one chip that just provides everything, but so far I have not found that chip…
I found a clever little circuit that helps with dropout from the battery, here:
(See top left corner)
Basically it uses a FET instead of a Diode for the battery power, and the FET is controlled by VBUS. VBUS still goes through a diode, since dropout isn’t a concern when we have 5 volts.
It still means some things might not work properly once the battery falls betlow 3.2 volts, but it’s better than having it stop working at 3.7 volts…
It has I2C, automatic power path management, switch-based charging (less heat), and maintains a minimum system voltage (3.52V) even when the battery is depleted. It can handle 3.5A of output current (when boosting the voltage) and 3A of charging current. Also, it is only $2.61.
Have you considered an ideal diode? Similar concept, just in a nice package with some extra protections and features. Something like this: NID5100
I’ve have been looking at this very IC actually. It’s quite nice, but it also has some drawbacks:
size, it’s 4x4mm, plus a handful of external circuitry, including a coil which tends to be somewhat large as well. There is a BGA version of this chip, but BGA is more costly to assemble. (And a real pain when building prototypes by hand.)
I really wish the booster could produce 5 volts, that way I could just hook it up to the amplifier and avoid having a 5v booster.
Having the circuit produce a minimum voltage might be helpful, but I really wish it would just produce a specified voltage instead. If it could produce 3.3v or 5v directly, a lot of external components could be skipped. As it is, the chip has to produce 3.5 volt, and then the LDO will have to burn off 0.2 volts (or more, if the battery is charged.)
On the pro side:
this chip eliminates the need for diodes for different power sources, the chip manages all that.
the chip can monitor battery voltage and other things over I2C, saving a pin on the MCU
the chip is efficient and should not heat up much even when charging at full speed
charge speed can be controlled from the cpu, allowing for both usb-safe options (500mA) and higher speeds.
This particular ideal diode seems like it’s just a fet with more steps and external parts.
So, I was looking into the 5v tolerant problem, and I think I found a simple and easy solution:
A resistor and a diode.
The resistor would work exactly like the 470k resistor that is already present on V3 boards.
The diode would be connected between the chip pin and 3.3v. If the voltage goes up, the diode will start to conduct. The more the voltage goes up, the more the diode conducts, and as long as the voltage stays below VDD + 0.3 volts, everything should be safe.
The diode should have little or no effect when the voltage is 3.3v or lower.
Just a small heads-up: ESP32 has a much weaker bluetooth signal than the separate BT909 bluetooth module we use. I compared Golden Harvest V4 board that uses ESP32 with the Proffieboard + BT909 module both enclosed inside aluminum sabers, and Golden Harvest V4 bluetooth signal was very weak, disconnecting from the app much closer to the saber comparing to the Proffieboard + BT909 module, which works much further away.
I think the plan is to just put an u.fl connector on the board and punt the problem of signal strength to the installer. There are a million u.fl antennas available, surely one of them will work.
Also, the Proffieboard will still have an USB connector. (But I don’t know if there will be SD card access through the USB connector yet.)
It’s also possible that signal strength can be adjusted in the driver. I will investigate when I get to that part of the software.
BQ25628 has an interesting pin called QON, which could…
it could be wired directly to a button (in parallel with the main cpu) Then the cpu can tell the BQ25628 to go into “ship mode”, which would mean the power would be cut until the power button is pressed. Instant deep sleep.
It could also be wired to a switch, and the chip could be told to only power on when QON is low. Instant ultra-low power switch.
It could be wired to directly to GND if power to the saber is controlled through other means, such as a kill key or kill switch. (Although, that might not be required, a define might be enough.)
I’ll have to experiment with it once I get the eval board though to verify if these things works the way I think they do.
If it works the way I hope it does, I’m thinking that QON should be exposed as a pad, close to BTN1 and GND pads to make it easy to bridge.
The chip also has a “shutdown mode” where it draws almost no power and will not take up for any reason other than plugging in a charger, which seems like a nice feature for shipping sabers to customers.
So it turns out that QON might not be as helpful as I first thought.
For one thing, it has a function that resets the power if you hold it for 10 seconds.
That could be useful in some situations, but it might be a major limitation if you’re trying to program a prop where holding the button for a long time does something interesting. (Like lockup in the basic scaber prop.)
Also, it means that QON cannot be used with a sliding switch, since that will reset the power after 10 seconds.
Finally, in order to exit from ship mode, QON has to be held for ~0.5 seconds. That may be fine, but it might not feel very responsive.