Scott's Build Log

That looks great! What kind of part is RV1? Potentiometer? Any concern about the square annular ring around the circular drill?

Yes, RV1 is a 1 turn pot used for the current set. That is if I did the current set circuit correctly.

You know, I hadn’t actually looked at it properly. I thought it was going to be a square hole like it shows in the datasheet for the pot. Here’s the datasheet. Is there a good way of making squarish hole in KiCAD?

I decided to try the JLBPCB / LCSC combo order although I haven’t quite figure out how that exactly works.

Edit:

I decided to change the holes to be slots. That should be okay and I can always file it down by hand if I need to. Just trying to think if I need to update anything else, or if I should be good to send it off. Which is exciting but I don’t want to have to spin another board for a dumb reason.

Did a second revision. I was looking at where I could get the main driver and it wasn’t very easy with me getting parts from LCSC. So I found a new one (two actually since why not have a spare/backup with the same pinout).

The pinout was different and I had to redo it, but I think it’s pretty okay. I also added a new ceramic input cap.

Overall, I think it looks really good. Will likely order them soon.


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 :upside_down_face: 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.

IMG_20190406_141717

IMG_20190406_141725

5V Output with no load:
5V_Out_No_Load

5V Peak to peak with 400mA Load:
5V_Pk-Pk_400mA_Load

Rise Time with no Load:
Rise_Time_No_Load

Rise Time with 400mA Load:
Rise_time_400mA_Load

I used an older phone and charged it with the board. Kinda… not great, not sure what I think about this.
Charging%20phone


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.

Inbetween_Current_limit_issue

Wow, I’m back after over a year! Time sure does fly. 2020 has been a crazy year so far, but at least it’s given me the opportunity to work on my own projects again. At least a little.

I started working on a Current Sink/Source (which was based on the CE course) a while ago and have recently come back to it to make some updates/fixes based on some new thoughts on how I should tackle it. I’ll spare you the long list of things I did/changed, but I’m pretty happy with how it’s turned out (in simulation and PCB design).

In terms of specs:

  • Input voltage: ~2.85 - 18V
  • Output voltage: 0 - 15V (with over voltage protection)
  • Output Current: 0 - 2A (Limited to 1A when powered off of a battery)
  • NTC monitoring of the heatsink to activate a fan when 12V is present

Now the important bits, things I have learned!

  • When using a linear regulator, check the power dissipation specs even for low power applications
  • When putting things in a set enclosure (off the shelf) think about:
    • Where the big items go
    • Mounting hole locations
    • PCB clearance for any internal features of the enclosure
    • Always double check the enclosure / PCB fit!
  • Before starting layout, think about what makes sense for each side of the PCB. What should be “visible” on the top
  • Try to simplify the design from your initial thoughts
  • Label everything!
    • I didn’t do this on my previous board and it’s a bit confusing now looking back at what some of the switches are for.

Question time:

  • The ground pour on the bottom layer, is it needed/worth it since I have a ground pour on top?
  • Maybe with some additional via stitching?
  • Are there any glaring issues/concerns?
  • HOW DO YOU KNOW WHEN TO STOP TWEAKING THE DESIGN???

The money shots:
Top of the PCB

Bottom of the PCB (This is the ground pour I’m curious about)

3D Render with the bottom of the housing

Hi Scott! Looks good!

I’ve been working on a vaguely similar thing (also based on the CE course). Waiting for boards right now.

I hadn’t thought of putting mine in a box. That would definitely look a lot more professional! And I like the heatsink fan idea. But it’s too late to tweak the design (again) once it’s been fabricated and is in the mail…

I don’t have any useful answers to your questions, and I also find the temptation of infinite tinkering hard to resist. It does seem though that you need to have physical boards in your hand to spot the last mistakes in your design, so too much extra tweaking might not help anyway.

Here’s mine (the only slightly innovative thing is that it’s connected to a Teensy, so it’s programmable and you can collect discharge curve data):

Schematics: Ian's Build Log
Layout: Ian's Build Log

Interested to hear how your works once you get it made!

You had some nice ideas with your design. I had thought about breaking out some pins to send to a microcontroller, but decided that I didn’t need to do all of the things on this design.

It does seem though that you need to have physical boards in your hand to spot the last mistakes in your design, so too much extra tweaking might not help anyway.

It’s so true and painful. There were some things on the last board that I was like “Oh I should have done this or that” after I got them. But it’s just small things.

I hadn’t thought of putting mine in a box. That would definitely look a lot more professional! And I like the heatsink fan idea.

Oh don’t worry, it doesn’t -quite- fit in the case. I’m thinking maybe I’ll cut a hole in the top of the case for the heatsink, or I’ll cut down the heatsink to fit in the case since the fan can help with that higher power dissipation. But yes, I thought it might be a fun idea to try to include a case and a fan for that little bit of extra work.

I ordered my components for the CSOS and realized I had an issue I needed to solve: how to store all of these new components. After researching some and asking my wife for her idea, I went with film strip archival sheets (the wife’s idea). I finished it, and while I don’t know exactly how I’ll store it, I really like how much space there is for multiple strips of the same value!

It’s not organized by value or anything, but at least they are in a more easily browse-able format.

Now it’s time to wait for the PCB to show up (it shipped two days ago from JLCPCB)! I’m excited and going to think about what the next project will be!

1 Like

I got my PCBs! I soldered one up and wouldn’t you know??? It doesn’t work!

At least, that’s how I was going to start this post, but actually, after a few silly mistakes (bad job soldering some SOT-23-6 parts, blowing up a TVS, soldering the wrong value resistors in, and misunderstanding what the issue even was) the board works! I still have to do some deeper testing to make sure that there aren’t any issues that I can’t see with the eye. But the output is stable (per a DMM and the current reading on my cheapo PSU) and the features I’ve added all work (fan control based on the heatsink’s temp, switched max currents based on the input voltage). I didn’t make the voltage cutoff adjustable, but I might be able to hack that in pretty easily.

I need to put thermal paste on the FET and my NTC temp gauge to make better contact with the heatsink. In addition, I need to figure out what temps the fan is turning on at and how well it can keep it under control. Initial testing shows that it reaches equalibium for a 20W load at around 11.2V on the fan. I had thought I designed it to be a latching output from the op-amp, but clearly it doesn’t. But that’s actually nice as it means the fan can slowly ramp up in speed if the wattage is lower. The fan is driven straight from the non-battery input (so 12V in my testing). I also need to get scope readings of all of the major points and make sure nothing too bad is happening.

Overall, I’m very, very pleased with myself on being able to follow along with the course materials and also make some interesting modifications to the design… mostly because I could! The other thing I need to do now is to see if I can put it into a case proper. My initial case idea is a little jank and I’ll see if I can’t make one or buy a new one that actually fits the thing inside!

1 Like

Excellent stuff! Well done. Looks pretty serious too, with the big heatsink and the fan…

I got the boards for my current sink thing and soldered one up last weekend, but I’ve not had a chance to test it yet. Maybe later today? (I’m now feeling bad that I’ve not done it, since you managed to assemble and test yours since the last time you posted!)

Anyway, great job! What’s next?

1 Like

I was aiming for a 30W load sustained with the fan with a heatsink temp of around 50-55C. Didn’t want to make it to dangerous to touch. Not sure if I’ve hit that, but I also need to test the temps in general. The heatsink is rated for like 15W or so without active cooling for a relatively cool temp.

The next project is going to be an RGB panel driver board thing that can display some animations. I have the 32x32 display already and want to put it to use. I was reviewing the library that Adafruit wrote for it and am pretty confused by what they are doing. My hope was to dissect it into the bits that I care about and program the things I needed for a custom controller board for it. Something with a higher clock speed than an Arduino typically. But reviewing the code just made my little baby programmer eyes glaze over and is making me rethink my idea. I would still like to write a library from scratch so I could better understand it, but I’m not so sure that’s viable now.

As for your board, I’m surprised that you could solder it up and NOT want to test it right away and get it all working and fancy. But don’t feel bad that you haven’t been able to! It’s there waiting for you, whenever you are ready!

Really great looking build! I love the mods and I’m glad you stuck with it and got it all working. Nothing like that feeling of accomplishment once you have the thing up and running.

Would love any feedback you might have (here or on DM) about how the course material helped or hindered making mods like you did.

1 Like

Not getting to testing was more an issue of time and other obligations than anything else. But testing will happen today!

“Mad my little baby programmer eyes glaze over”… As a not-so-baby programmer, that made me laugh! What is it about this Adafruit library that’s giving you trouble? Which library is it?

1 Like

OK, now I’m totally jealous, because mine doesn’t work! I need to do some more investigation tomorrow, but the current limiting bit… uh… doesn’t limit the current! Not very useful. I have a suspicion that it’s down to trying to be clever clever (rarely a good idea). I used a really small sense resistor to avoid power dissipation there, but that means that the op amp driving the FET ends up comparing really tiny signals (a few mV, and it’s running from a single 3.3V supply). Now I have the thing assembled in front of me, that seems just a little bit silly! There might be something else going on as well, but that seems like the most likely cause of trouble. I’ll work out what’s going on and write it up in my own build log. In any case, I think I’ll have the “opportunity” to do a rev 2 of this one.

So, extra kudos to you for having it work first time!

1 Like

@ChrisGammell Thanks! I worked hard on all of the simulation and thought really deeply about the voltage levels for the Op-Amps and how I wanted to handle the power input.
I’ll have to have a think about feedback for the course more though. For sure what I remember was the math for the power input and how the feedback for the load needs to be relative to that. There wasn’t much that I watched of the layout or testing. Although I should have watched more of Layout since I could certainly learn more there. Last thing off of the top of my head is that the version of KiCAD used was quite old and while most of the core UI/features haven’t changed, it was a bit jarring.

@ian Ooooo How did the testing go? If it’s testing time! I took so long getting around to finishing writing this that I see that yours is having issues! A few mV seems a little dangerous. For reference I designed mine to go up to 100mV at 2A load when being powered from 12V. But shouldn’t you be able to swap out your resistor values though to get the signal levels a bit higher without a re-spin of the board? See my picture below for how I did it / with values to have it make a bit more sense. The issue that I had to debug was wrong resistor values for R302 and R303. I used 51R opposed to 51k (Who needs to read, lol). This meant that I was saturating the Op-Amp’s input extremely quickly. Maybe you have something similar going on!

As for the library, which is here, I was looking for the core functions in terms of what bits are sent for what commands. I wanted to write my own library for what “write a pixel” or “start display” so I could learn more about the hardware requirements before I design the hardware for the overall display driver that I want to make. I probably just need to find the raw datasheet for the display and see if I can make heads of tails of that, but I haven’t gotten that far just yet.

My idea for the hardware was some form of micro or FPGA (if I’m feeling particularly spicy) with some external flash or EEPROM to store the animation images. But since I wanted to know how the data is sent, I wanted to be able to structure the data for the images nicely for myself and write the whole stack from converting the image, storing it on the boards, then display it myself. But yeah, since I can’t quite figure out how the library works, I’m a little stuck.

One of the changes I made to the design was the 12V changeover for the current range that the device will draw. It’s quite the simple modification (parallel resistor values with a FET control), but it was nice to be able to come to that idea and have it work out really well. I know I went lower on the current shunt than Chris did to reduce the power on the little guy, but I’m not sure why I settled on 100mV = 2A. Maybe the math was just easy at that point.

I don’t even know what it is supposed to be doing, but seems like Q301 is just turned on fully and feeds a current into the devider setting the current source level

Normally driving a FET current source like that is difficult to stabilize, needing a cap from the output of the opamp to the invirting input to introduce a zero in the transfer function

You’re absolutely right about trying replacing resistors. I’ll definitely try something like that before doing a respin. I was just being slightly melodramatic “My board doesn’t work! O woe is me! Electronics is too hard!”, etc., etc.

That graphics library has quite a bit going on, and it’s not written in a way that’s particularly accessible. It looks good, and it seems to have been written for the convenience of users rather than being simple to understand. If I was you, I would just get the datasheet for the display and do some minimalist noodling with it connected to an Arduino or something, driving it without any library or anything to see how to make things happen.

Also, the LM358 device is known to have cross over distortion due to the class B output stage and very slow slew rate, so for linear operation it is a poor choice. It even shares the current source for the long tailed pair between opamps, so one opamp operation can propagate noise into another opamp

Interesting… I’ll have to spend some time thinking about what that all really means, haha. Thanks though!

As for Q301, you are right, it’s just switching on a voltage divider to change the current source level. The idea was that if 12V was present, then a fan is available to help cool the FET and therefore can have a higher wattage on the FET and still stay within a human safe temperature.

On a side note, I just blew up the FET and possibly the LM358 last night while trying to run some temperature tests on it. I was running it at 20W (10V, 2A load) and saw that the heatsink was at a stable 58C (I’m assuming it was a little higher than that based on how I was making a connection from HS to thermocouple). So I thought I would see what 30W (15V, 2A) would look like when something shorted. I had gotten to around 14.7/14.8V when it failed. My power supply also ranges at around that voltage and I’m wondering if the ranging induced a spike which killed the FET. There was no black smoke or any visible signs of failure on the board, which makes it even more suspicious to me. Measuring the FET, I’m seeing 0R between it’s pins, so I’m assuming it was that, but I’m not quite sure what would have been the cause. Interestingly, I did just put some silicon grease (which was clear and runny and a surprise to me) onto the FET/heatsink just before it failed.

I’ll have to replace it tonight if I get the chance and see if I can track down any other failures on the board. I’m hopeful it’s just the FET as pulling off an SOIC-8 with just a single iron will be painful for sure!

Had some time to replace the FET and run some more testing, and it’s back alive! It was just the FET that went boom, although I have to say that it didn’t really do much when it went the first time.

I’m thinking that it was the power supply re-ranging that caused the failure now. I have since bodged on one of my 15V TVSs to help take care of any of those spikes in the future should they occur. My plan was to limit it to 15V anyways since I can’t see myself needing over 15V unless I’m doing something very special, which… I have more boards and could always change up how I do my voltage limiting (or even just pull off the voltage limiting in general.

I ran some more testing at 15V, 2A and from what I could tell, the tab was getting up to around 95C. Adding 25 degrees for junction temp and I’m just at the border of what I’m comfortable with. But, that’s at max voltage and current, which I don’t expect to need. The fan is a lovely little addition and I think it’s great.

So I’ll have to do more testing of the various bits still to see, but honestly, it seems really stable! So time to get cracking on testing my power board testing and starting on my next project! Also, need to work on a case for it. But that will come a little later. Still very stoked for sure!

1 Like