uBMS: The Mysterious ESP32 Reset

Some pretty ~annoying~ oscillations

When bringing up a new hardware product and testing its functionality, you really start to get to know the “personality” of the hardware, including some of the unexpected bugs that come along with new hardware. Such is the case with my new uBMS board and the ESP32 driving the whole project.

The background

The other day, I set about finally testing out the balancing functionality of my board,in order to confirm that it works, and to collect data to allow me to estimate my current draw for a given PWM duty cycle. That way I could save on sensors, but also have reasonably accurate current measurements for each cell being balanced. This meant that for varying duty cycles, until I reached my current limit, I began collecting data of current for a given duty cycle. The funny thing I started to notice when I was collecting my data, however, is an error that would present itself as:
rst:0x8 (TG1WDT_SYS_RESET),boot:0x13

…and then my ESP would then promptly reset.


Read More

uBMS: All Soldered Up

μBMS Glamour Photo ❤️

The Timeline

  • Saturday: DigiKey Parts
    • After failing to deliver on Friday due to undetermined reasons, I adventured up to Albany, NY and waited for a couple of hours for the kind FedEx employees to locate and give me my package so I was able to start soldering this weekend
  • Sunday: Soldering Starts
    • The real fun began today. I got the main power rails of the μBMS working first. There are 2 main rails on the μBMS: a 5V rail from a high-voltage tolerant buck-converter and a 3.3v rail from an LDO attached to the 5v rail. This caused some issues to begin with, but more on that later…
    • After confirming I had my required power rails, I worked on inserting the brain into μBMS. The chip making up its brain is an ESP32 and after attaching this module and surrounding programming circuitry I was ready for my first test: UART communication with the “Hello World” programme. Luckily, the μBMS has a functioning brain, but still has some weird quirks booting up… more on this later
  • Monday: Stress!… but then Exciting Results
    • Today was a super busy day! I set the goal of completing all of the soldering for all of the parts. There are about 200 parts on the board and I still had about 150 more to do. This went fairly smoothly until I ran into my 1 board design flaw (I’m sure I’ll find more 😅).
    • I made a pinout error on an IC and ran around with red herrings with my 5v rail was shorted until I had the foresight to do a “Louis Rossmann” and use a current limited supply and a temp probe to find the offending location / parts on the board. It’s fixed now, and the chip seems to have survived the abuse
    • Anyway, I managed to finish the board, even with 3 0201 thermistors, at around 7pm and now we’re here, onto testing and firmware, but first more about μBMS and why it’s the coolest project I’ve ever embarked on…

So why is μBMS cool?

Read More


My uBMS PCBs Finally Arrived!

uBMS Frontside Unpopulated

After weeks of planning, designing, researching, testing, and then routing, my first ever 4-layer PCBs for my uBMS project have arrived from JLCPCB! I was really impressed at the speed of shipping, especially considering the ongoing pandemic. It only took 4 days from the day it shipped to the day it arrived at my doorstep!

The uBMS project is really exciting because I’ve taken all that I have learned over the past few years working on my independent electric vehicle projects and my college’s electric vehicle project and have been able to put that knowledge into a package that is only slightly bigger than a credit card. 😃

Read More

Project Statuses: Past & Present

Electric Longboard Project

What’s New?

Currently, I’m physically on my second electric longboard, electrically I would say it’s more like my 4th electric longboard. Last summer, I replaced my LiPo cells in a 6S4P (6 in series & 4 in parallel) configuration that was surrounded in by a sheet metal frame with an 8S4P 18650 cell setup surrounded by a custom 3D-printed enclosure in ABS. This gave me a much lighter and thinner board which was great for carrying the board and also gave me additional speed (at top speed of around 20-25 MPH or so) at a range of about 25 miles. In order to do this, I moved away from using a balancing charger and started using a Battery Management System (BMS) board. You can find these very inexpensively on eBay or AliExpress and they mostly work as advertised, but you do get what you pay for.

Anyway, this summer I discovered that in 4 of my battery modules, which is all of them, I had at least 1 dead cell. Not ideal. The one thing I noticed that was common in all of them was the placement of the damaged cell. They were all directly beneath the BMS board. The BMS board balances cells by resistively discharging them and converts this electrical potential energy into heat. I don’t think it was a coincidence that this massive heat generator’s location and the bad cells’ locations was a coincidence. The BMS, if it generates a lot of heat, should not be adjacent to any cell.

So, currently the battery modules are in an disassembled state as I work on my own custom BMS solution.

What’s to do?

First, I have to get my BMS system up and running. That way I can reassemble the battery backs and have a reliable way to keep data on the packs and keep them healthier. I’m also working on an accompanying board to the BMS boards that will supply the board with further statistics. It will also be a receiver for a controller and I hope to have a controller which displays important information about the board such as speed and miles (or kilometres!) remaining. Let’s make a Tesla of smaller electric vehicles, it’d be fun.

Electric Bicycle Project

Read More

Finally Secure with HTTPS & Cloudflare


With a restart to my personal blog on the new (to me) Hexo platform, I figured it was time to start hosting the website properly as well. The previous blog was running from using a simple python command meant for debugging and screen to keep it running in the background. This time I’m writing posts, testing to make sure they will display properly, and then publishing them to static files which are served to the client via an Apache 2 server.

In addition to properly hosting my blog, I wanted to have it more secure than just HTTP. Luckily, Apache easily supports HTTPS and is pretty easy to setup, but using a personally signed certificate is a problem. A modern browser such as Firefox will present the user with a warning such as “This Connection is Untrusted” or “Your connection is not secure” and requires 2 clicks to proceed to the website. This issue is obviously not ideal and would cause a massive loss in viewership. To solve this problem, I decided to put my site behind Cloudflare.

I was a slightly nervous about using Cloudflare since I had never used their services before, but man was it a great decision. It was incredibly painless to setup from changing the domain servers to generating the public and private keys needed for Apache. I think it was harder to configure Apache to redirect normal HTTP traffic to HTTPS if possible than it was for the whole Cloudflare setup.

Now in addition to having a seamless HTTPS experience for my viewers, I have standard DOS protection and caching so my website (hosted in NY) can have faster speeds in more geographical locations. It also provides me with a super cool web panel to check out many unique visitors I get and from where in the world they are located. I think now I might move my home servers, which have some front facing ports, over to Cloudflare as well :).

See you guys soon with some more exciting updates!

New Blog System

Why Hexo?

My previous blog system, Jekyll, ran on a Python backend and provided a decent experience, but over time I felt it lacked polish. After a bunch of research, and input from my Computer Science friends, I decided Medium was not the move and ended up with Hero!

It has a huge, albeit non-English speaking, community, so I have faith it will have continued development into the future. This also means there is a large theme and plugin catalogue available which I plan to explore in the near future.

I hope you enjoy the future content on this blog! I’ll try to make sure it is kept more up to date than the previous blog, and also more in sync with my Electrical Engineering instragram: @clements_eensta :)