Nathan S. Build Log

Hello to the Contextual Electronics Community. My name is Nathan and I graduated with a degree in Electrical Engineering in 2018 with about 2 years of cumulative experience in a coop in industrial controls. My current job involves third party repair for medical imaging equipment. This includes developing repair procedures, reverse engineering the equipment and developing test equipment.

I have recently been evaluating where I want to take my career and found that I really love electronics design especially in embedded systems. I found Contextual Electronics listening to the Amp Hour podcast and decided to sign up in order to build the design side of my skills since my undergraduate classes and work experience has mostly been with base theory and circuit analysis. Eventually I would like to focus more on hardware development whether at my current employer or, if not possible there, at a future job.

For projects I am working on an interface controller for a coffee roaster that I use regularly that will allow me to attach additional thermocouples, and interact with the roaster via a web browser/USB to run pre-configured roast profiles and monitor the status of the roast more completely.

2 Likes

Over the last week or so I completed both the Shine on You Crazy Kicad and Getting to Blinky courses. I didn’t order the boards and assemble at this point because I was mostly using these to get a feel for how Contextual Electronics courses work and how to use Kicad. I have done PCB design a little bit before but I was using my current boss’s preferred ancient copy of CIRCAD '98.

I did take a shot at laying out both of these boards before watching the corresponding videos all the way through. I definitely need to get a bit more experience laying out PCBs. I wasn’t thinking through the design as a whole enough which lead to a lot of time spent deleting traces and moving the components until I was happy with the final result. I also suffer from a desire to want any PCBs I design to be somewhat aesthetically pleasing which was the cause of much of my re-dos. On that front though the 3D viewer is awesome. Below are the results.

From here I am planning on working through the Current Sink or Swim course. I’m interested in the analog side of electronics which this course seems to touch on a little bit. I also can think of at least a couple times where a current sink like this would have been useful in previous projects.

Nice to see @Naxian, we are in a simillar path here at CE. I had some hard time to understand the flow of CSOS project, probably, because Blinky and Shine are very organized and straight forward to follow…
Then, I opted out to follow along with Full Charge Ahead project, it is not listed on the courses section, but i found it on “My Progress” section… Also, take a look on it.

The Full Charge Ahead project is in the process of being migrated over from our legacy site, that’s why it’s not listed. There won’t be any associated forum posts with it yet, so I recommend waiting for that to be listed before moving to it.

Great job on the board, @Naxian!

Thank you for the input! @Gustavo, I will admit that it has taken a little bit to get the hang of the difference between CSOS and Getting to Blinky or Shine On. It has required me to take a bit more time to work through each of the videos and make sure that I followed on.

I will have to take a look at the Full Charge Ahead project once it has been fully migrated.

Current Progress: I’ve now worked through the point of finding the Op Amp and the LDO for CSOS.
The biggest challenge in this part of the project was that it looks like the project may be a couple of years old and the parts.io website has now become findchips.com which has a bit of different interface. This made it a bit hard to follow along. At this point I have gone through the process of searching for these two parts 3-4 times trying to get a handle on the methodology behind choosing a part.

Overview of the Project: I struggled a little bit in the first couple of videos to get a handle on what the end goal of the project was. The videos seemed to be referencing it as a part of a larger project. Once I got a handle on the fact that we were attempting to test battery cells it started making more sense and reviewing the Reload schematic definitely helped too.

I’m still a little confused as to what parameters we are testing on the batteries. Is it to determine run time, the voltage drop-off, or current capacity of the batteries?

Picking the Parts: The first time I did this was after the intro video and I used only the Digikey search tools. My biggest problem here was that I wasn’t sure what type of batteries or what configurations. I arbitrarily picked an 18650 cell setting the safe discharge voltage at 3.2V (The minimum discharge voltage was actually 3.0V but I left some safety factor because I don’t know much about lithium batteries). With this I landed on a TI TPS79330 voltage regulator and an MCP6241 Op-Amp. These would have worked fine with the 3.0V supply voltage but that would have made it hard to test most batteries.

After watching the video I ended up finding the findchips.com website and after jumping around through the video a few more times picked out what some of the key parameters were. Findchips works well but is a bit tricky to get results out of. You have to be careful what filters you use because some of them aren’t populated for every part and you can cut out a lot of potential choices by choosing one of these. Once I figured that out I got much better results.

For the LDO I ended up choosing a MIC5205 with a 2.5V fixed output. At this current it has a max dropout voltage of only 50mV. It also had a wide input range and potential to supply up to 150mA output current so if I order a few extras they will likely be usable in future projects.

For the Op-Amp I ended up going with the MCP6002. Which I realized later was the same one from the Reload project. It was widely available, capable of operating with a 2.5V supply. Part of this pick for me was again to choose something that I could order some extras of to use in future projects as well.

Next up choosing the rest of the components!

Hi Nathan,

I worked through most of the CE projects last year, and had some of the same issues that you’re reporting. I ended up mostly just searching for parts on Mouser, which is less convenient for parametric searches than something like parts.io, but it works if you’re patient.

My build log is here: Ian's Build Log and there’s a more detailed write-up of what I ended up doing for the CSOS project here: https://skybluetrades.net/projects/teensy-load/ – I don’t know if that will be any use to you, but I’m happy to answer questions about the experience (if I can remember what I did!).

Cheers,

Ian.

Current Sink or Swim Update

It’s been a while since my last update on my progress through the Contextual Electronics courses. As I’m sure everyone is familiar with life got a bit busier than expected for a couple of weeks and I had to step away from the project. Since then I have completed the schematic layout and the PCB design. I sent the boards off to OSHPark and have placed an order on Digi-Key for the components.

Intro

For now I decided to keep the overall project scope more or less the same as the original project. I ended up going through the overall process of schematic design, component selection and PCB layout probably 3-4 times as I learned a bit more each time and did a lot of independent research.

In hindsight I probably should have taken the results from the first or second iterations and gone ahead with the build and gone back for a second iteration that built on the first one. As well as posting updates more regularly to avoid getting too far down the rabbit hole trying to figure everything out on my own.

Key Components

It’s worth noting that I choose to alter the design for a 2.5V supply when self powered by a single cell battery which did pose some challenges with the component selection especially with the Mosfet and the voltage regulator.

Mosfet: STP60NF06L

This series of FETs from STM was one of the only parts that I could find in a TO-220 package that would turn on with 2.5V at the gate and be able to handle a significant amount of current at the drain. It seemed like most of the Id/Vgs curves dropped sharply as Vgs dropped below 3.0-3.5V. Admittedly I haven’t had much experience reading Mosfet datasheets and may be missing something or mis-interpreting them.

Op-Amp: MCP6002T-I/SN

While I was researching this looked to be a really common and readily available general purpose Op-Amp and it meet the specs so it looked to be a pretty easy choice.

LDO: TPS7A2401DBVR

I struggled finding an appropriate voltage regulator for the project. I think I created most of this problem for myself because I was hoping to incorporate an MCU for logging and the ability to monitor voltages and currents without requiring a multimeter or two while still keeping the device self powered. This probably would have been possible without going to a regulator with this much current capacity but I neglected to do much research on an appropriate MCU and likely power usage before speccing this component. Since I ended up not going this far for the first iteration it is definitely overkill. Next time I need to spec the rest of the key components for the project and do the power requirement estimations before trying to spec the power supply solution!

Potentiometers: P160KN-0QD15B10K

Using Digi-Key primarily there weren’t many potentiometers coming up in my search that bridged the gap between expensive audio centered models and simple trim pots. I knew I wanted something that I could use without a screwdriver for frequent adjustment so the trim pots were out of the question. I didn’t spend too much more time on this selection and just went with one of the cheapest options that fit the resistance range and no screwdriver requirement.

Heatsink: 529802B02500G

The heatsink was choosen solely on the price and ability to dissipate a minimum of 10 watts at ambient.

Current Sense Resistor: 0.1ohm 2512 SMD

I did end up going with an SMD component for the current sense resistor because it seemed to have a bit of smaller overall footprint than a comparable through hole component.

Schematic Design

The schematic seemed to go fairly smoothly. My main edits as I went through this process was how I named a few of the Nets as I realized that some of my original naming choices made things a little bit confusing during the PCB layout process. I did use the hierarchical sheets for the opportunity to learn how they worked in KiCad.

PCB Design

This was where I spent a lot of my time. I spent a lot time trying to understand some of the best practices for routing traces, making multiple connections, and sizing both tracks and vias. I tore up and re-did the PCB layout a couple of times and each one of them got a little bit better than the last.

One of the things that helped everything click was maintaining a consistent orientation on the components. On my first attempt and a half I had the Op-Amp positioned with the leads on the top and bottom and the majority of the other components running horizontally on the top layer. This made routing a lot of the traces particularly challenging. It came together much easier once I rotated the Op-Amp to also be horizontal. The other key piece was making sure that my power inputs, power supply and the necessary input on the Op-Amp were somewhat in line which cleaned up and shortened the power routing significantly.

Overall I’m pretty happy with the final product. I would appreciate any feedback anyone has to offer I should probably start setting deadlines for myself on these personal projects otherwise I’m likely to never finish most of them as it’s never quite the way I want it.

Next Steps

Overall the project has been a lot of fun to work on so far and I’m excited to get the boards and the components in soon to start the build and test phases. I’m looking forward to continuing with the other projects in CE and starting to apply what I’ve learned to my own projects. I’m still considering another iteration of this project to add in logging of the discharge time and potentially a charge cycle to create a tool capable of characterizing battery performance.

3 Likes

The Build and Test

Since my last post I have received the components and the boards for the CSOS project and completed testing. Overall I’m happy with the outcome as a first revision. The boards from OSHpark turned out great. This was my first experience using any of the low-cost board houses. My previous builds have involved hand-wiring perfboard or CNC milling the PCB. I love the aesthetic of the milled PCB but unless I have a project with more of a display element I’ll probably stick with having the board made from now on.

Actually building the board went smoothly. I do a fair bit of soldering/desoldering of SMD components at my job so I had the benefit of practice. I almost avoided any footprint mishaps and it wasn’t until the very end of the build process that I noticed the one I didn’t check closely enough. As you can see from the pictures I used a footprint for a 1.27mm header instead of the 2.54mm header and jumper that I ordered. Soldering a jumper made from a through-hole component lead to the self-powered selection allowed me to test most of the devices capability.

Testing Methods and Results

The testing was completed using an adjustable power supply. The supply was set to 5V for most testing to stay above the LDO’s dropout voltage and below it’s 20V max rating. This supply still displays the voltage and current so I didn’t have to go Chris’s route using the DMM for monitoring the outputs. This allowed me to keep my DMM free to test voltages through out the circuit for troubleshooting.

First Power On - Orientation Problems

In preparation the current limit potentiometer was set at roughly 250mA and the voltage limiting potentiometer at max. As I excitedly switched on the power supply and started to slowly ramp up the current limit the inevitable moment of dissapointment hit as the current readout remained at 0.0A. A quick check showed that I wasn’t getting the 2.5V out of the LDO.

Time for a little troubleshooting.

  1. We have voltage at the input terminals.
  2. I’m wired into the right terminals for my hard-wired jumper.
  3. The voltage is present at the LDO input.
  4. Check the datasheet for the LDO and yep the EN is supposed to be high.
  5. Turn it off and check the impedance to ground on the 2.5V rail. No problems there.
  6. Ok let’s take another look at the PCB layout drawing and start tracing the rail through again.

I soldered the Op-Amp in backwards! The positive rail of the Op-Amp was 0V and the negative was

Round Two - Pay Attention to +/-

After replacing the Op-Amp I set it all back up again and got ready to hit the power switch again. It has to work now! Hit the switch. Start to turn up the current limit on the supply. The display moves! Then stops way below the set 250mA draw.

Back to troubleshooting.

  1. The current limit set point is where it should be.
  2. The voltage limit set point is where it should be.
  3. There is no gate voltage on the FET. Well that’s why the current draw is so low.
  4. Turn it off and check the diode polarity again. That’s good.
  5. Turn it back on and check the output of the voltage limiting Op-Amp. That’s not there. We’re getting closer.
  6. Review the schematic.

I connected up the Op-Amp backwards. I’d connected the set point to the inverting input and the input voltage level feedback to the non-inverting input. The Op-Amp was going to try and drive the output negative.

Well that’s a bit less easy a fix than the first problem. I was able to cut the traces and mod up the connections.

Round Three - Potentiometer Woes

This time I hooked everything back up, turned on the power supply and turned up the current limit. Going up… Past where we stopped last time… At about 250mA… and it’s stabilized! It Works!!

I then did a bit more testing of the current limit settings, the voltage limiting, and the drop-out on the regulator. They did seem to work mostly as expected but the <1 turn potientometers I picked made it really hard to set them reliably. I also realized earlier on that the potentiometers don’t travel the full 10K range on both sides of the pot and I unfortunately picked the lower of the two ranges. This left me with only about a 6K max on both of them.

A thermocouple meter or IR thermometer aren’t in my collection of tools yet so I wasn’t able to do any stress testing or characterization of the thermals.

Conclusion and Next Steps

The design was overall a success! A couple of mods were required and a few mis-steps along the way but it looks like it meets the design requirements. I’m very happy with how the power supply performed. With the board running the dropout was less than 100mV in it’s current state. That number is perfectly sufficient to test most lithium batteries. Without testing the thermals on the Mosfet it is hard to say what the practical limitations are in terms of current. Moving forward a couple of cheap thermocouple meters may be worthwhile.

I really enjoyed the project and I want to do a second revision taking into account the problems I discovered with the design as I was testing and adding a couple of features that I think would make it more usable. My plans for the second revision would also give me a chance to work on incorporating a simple MCU into the design and some simple firmware. These bullet points are what I would like to address in this second revision.

  • Fix the Op-Amp configuration for the voltage limit
  • Replace the potientometers to allow for finer adjustment of the settings
  • Incorporate test points on the PCB for the key readings making it a little easier to troubleshoot
  • Integrate a microcontroller to handle the following
    • Measure the current draw and voltage of the battery
    • Run a display to report the set points, current draw on the device and voltage of the battery.
    • Potentially measure the temperature of the FET to avoid damage

I’m also open to any feedback on the original design or ideas on where to go with the project. I’ve also started watching the ABC videos and am enjoying those

Fantastic build log! I really appreciate the amount of detail you put into this. Were you keeping notes the entire time or was this log a post build assessment?

I like that your troubleshooting was gradual. I find that sometimes I can’t help myself and I just “go for it”, but that’s almost always the wrong way of doing things. That’s when the magic smoke comes out. Your incremental testing seemed to serve you well.

If I were to put a micro onto this project today, I’d probably have it output a serial terminal to a USB to serial chip, or possibly a direct USB output (like on the SAMD21). Having a terminal interface would remove the need for a display, but still could get significant ADC readings back off of the op amps and other control voltages throughout the system. There are a couple other build logs on the forum where people put in micros, so maybe check those out for inspiration.

Great job!

Thanks for the feedback Chris!

I was taking notes during the process. I’ve found that especially during troubleshooting it helps me to stay on that gradual path. Having to stop the process after each step to record the results gives a great break in the process that keeps me from jumping to conclusions. I got into the habit at my current job. We repair medical ultrasound devices and the PCB assemblies for them are pretty expensive and some of the components are really hard to come by. It broke the habit of “shotgunning” the troubleshooting pretty quickly.

A terminal over USB is a great idea! I always like having test equipment that can be connected to other devices in some way. The ability to attach it to a Raspberry pi or other computer and use Python scripts for data logging, automated testing procedures, and data analysis can be extremely useful. I’ll have to take a look at some of the other build logs and see what other people have done. Balancing making test fixtures flexible enough to be useful in multiple scenarios without becoming too complicated in their configuration to be friendly for people to use is a fun challenge.

Are there any significant differences beyond the added complexity and a couple of extra parts on the BOM to using a discrete USB to serial chip vs. choosing a micro with it built in?

Depending on which uC with USB you’re contemplating… if you’re using a separate usb-serial chip it always works, and not only if your software initializes the USB soft-device correctly, also, with a reset you don’t get any usb re-enumeration crap. On the flip side, usb-serial is just that and can’t present a mounted filesystem or other protocols.

If you are putting a microcontroller in your design and you want to use USB to communicate with it, you are better off using a micro with built in USB, It will be less complex, cheaper and easier to build.

But, you might want to consider just using something like a Nano or a Pico. Cost is low, integration is very easy.

Tve, the “always works” aspects of the usb-serial device would be nice. I also see what you’re saying about the potential capabilities of the micro with integrated USB. It sounds like I may want to do some research and figure out exactly what I would like to get out of the device before making that decision.

I considered just building an expansion on an existing dev board platform like that. It would definitely save on the work and probably cost in the end. However, my primary goal in continuing the project is to learn a little about the process of designing in a micro and the required supporting hardware as well as the firmware development beyond the Arduino IDE so I had decided against that for this project. If I was just trying to reach the end product than I would probably go that route though!