Long post incoming!
I ordered the boards shortly after the last post. Finally got them in the mail yesterday and built of one them up! The yellow looks a little weird (especially because you can see the internal layers a little), but ah well.
It mostly works (which is a relief), but I need a better way of loading it for full testing. Any guesses what the next project is?
I have a few things I should note and one question for you all about the circuit.
The build went fairly well, I used InteractiveBOM and that was pretty nice. I need to update it though as I think there is now a progress bar. I did run into some issues though. I didn’t check the footprint of the USB connector that I purchased and I had to improvise a little. But it works good and seems to still have good enough strain relief. I also put the terminal block on backwards and I will have to bring the board to work so I can use the hot air station to remove it and flip it around.
I took some scope shots of the output at a few different cases. I’m pretty happy with the levels although I might add some more capacitance to the output. Not sure.
5V Output with no load:
5V Peak to peak with 400mA Load:
Rise Time with no Load:
Rise Time with 400mA Load:
I used an older phone and charged it with the board. Kinda… not great, not sure what I think about this.
And lastly, onto the issues with the circuit. There are two problems. Potentially related? The first problem is that the currently limiting doesn’t work correctly… Most of the time. What is supposed to happen is that the current is measured with the INA138 and the output is fed to a comparator (without hysteresis) to then control the enable pin. When it works as intended, there is a second issue. But onto that in a bit. The issue that I’m having is that the output of the INA138 doesn’t seem to be working as intended. I initially didn’t have the output gain resistor, but I put in a 100k before making the board. Thinking I didn’t have enough gain, I doubled it, but it still has some issues. The issue presents itself when I try to turn the current limit down to shut off the load. I am required to basically turn it all the way down as if the INA138 output isn’t working. Measuring it with a scope can either make the circuit work, or I measure negative voltage at the pin. After measuring it and it starting to work, it will work for some time afterwards, without the probe connected.
Some quick math, they list 100k as a gain of 20 in the datasheet for the INA138. I have a 0.068R sense resistor. Full scale of 1.5A means an sense voltage of 1.5 * 0.068 = 100mV (also the recommended level). A gain of 20 is a 2V output. I have a 0-4V pot range as the input to the comparator. I doubled the gain to 40 after doing some testing (I should have done this before building the board the first time!). So I should be able to have a pretty 1 to 1 relationship between the pot and the current output.
I currently have a 12 ohm resistor for a load. 5V / 12R = 0.41 mA. Moving on, 0.41 * 0.068 = 27mV. 27mV * 40 (Gain) = 1.1V. When I measure the pot when the circuit is working, I measure around 910mV. There’s some error there, but for the moment, that’s fine.
Away from the math now. Not sure why the circuit isn’t always working. Seems strange.
Lastly the circuit, when working, can get into a weird state, where the comparator is starting to assert, but then the current drops because the voltage drops and it turns back on. See trace below. I’m not sure this is something that I can solve without some more components, but what could I potentially do to solve it?
I’m not super concerned with this, but if there is a simple fix, that would be cool.