AuxPower1U: Mistakes were made

This is a post 11 in the series (previous: Main Controller PCB).

This post is sponsored by PCBWay.


With AuxPower1U being an actual physical object, I can see there were some mistakes. Most of them I worked around for and they’re already fixed in the repository for potential future version. But some of them will remain as a design choice.

First one has nothing to do with electronics but with my aluminium plate (aka “heat sink”). I planned for tapping holes so I can screw power supplies directly. Unfortunately, my model actually swapped diameter and radius and thus I got holes much bigger than I wanted. Classic error. So I used just screws and washers to get over that. But that actually made me think - do I really want to make all those tapping holes? Answer is no - longer screw and nut are good enough.

With that out of way, next portion are the PCB errors that were fixed courtesy of PCBWay respinning my desing. While the first revision board could be fixed using bodge wires, and I did so for firmware development, errors were big enough that I really needed a new PCB.

Current monitoring was the bigest miss here. I used my trusty ZXCT1009 - something I used many times ago. So, of course, I forgot to include ground resistor which made its readings go wild. Connecting resistor via bodge wire fixed that error. But, only when testing at 30V released the magic smoke, I checked the data sheet more closely. Yes, ZXCT1009 is limited to 20V. This never came up as most of my designs stick to 12V at most. But it became problem now.

However, finding a chip that goes up to 60V proved to be a difficult task. There actually are not too many simple chips that go that high and I didn’t want something that has more than 3 pins. Well, I think I found my new favorite current monitor - HV7801.

While HV7801 has more than 3 pins, it still comes in SOT-23 package and requires no external components. It actually occupies less PCB realestate than ZXCT1009. Downside is that its gain is fixed to 5x thus requiring me to use 1.024V ADC range. With ZXCT1009 it’s much easier to get resistor dividers than are nicely “rounded” for ADC and fit almost any range. With HV7801 you get what you get. Despite all of this, if I need current measurement that doesn’t need to be precise and I have 12-bit ADC, this chip is awesome.

Speaking of current measurement, I used 0.1Ω 3W resistor at first. It’s the same resistor I used in many other projects and it was always an overkill. What I temporarily forgot is that my low voltage ranges (e.g., 15V) will need to pass a lot of current. Thus, my trusty 0.1Ω resistor was getting way more heat than appropriate. After actually running the numbers, I decided to go with 0.025Ω 3W. Still gives nice figures for microcontroller calculations while producing way less heat.

Unfortunately, since my MCP9701A temperature sensor outputs around 800 mA at the room temperature, usage of HV7801 also meant I have to switch ADC ranges every time I measure the current. MCP9701A at 1.024V ADC range would only allow measurement up to 32°C. Even its 9700A brother (that I didn’t have in stock) would only allow up to 62°C. Switching to 2.048V just for temperature measurement is not the end of the world but it does mean slower measurement and it probably has implications for precision too.

One other case of “the forgotten resistor” is a pull-up for output MOSFETs. Early in the design phase I decided that resetting the board should not bring outputs down. Idea behind it is that, even if my board misbehaves, current will flow. There are merits on starting the system with all devices off but, since this would control power to my wireless, I decided it should fail-closed. And for that you need pull-ups. That I have forgotten.

Since we’re talking about resistors, I also had to increased ones used for LEDs. Those things were just too bright. While this means absolutely nothing once box it closed, it meant a lot during debugging since I could actually look at the PCB without burning my retinas. See, high-efficiency LEDs are not always good. :)

Speaking of debugging, I originally had my ICSP (i.e., debugging) lines shared with UART. This was necessary as I didn’t have enough pins and had to make some share functionality. Later in the project I added an I²C extender and thus aleviated the issue. However, I forgot to decouple UART lines from ICSP thus making the debugging of UART communication impossible. Solution was simple enough - just move those lines.

With all these errors, you can see why revision B was needed. While many of errors could be sorted by bodging wire here and there, and indeed they were for the purpose of firmware development, it was just too many to ever trust that board. Revision B saved the day.