Graeme's Build Log

Hi all,

My electronics journey has taken many twists and turns over the years. It all started, like so many others, with an electronics kit in the mid 80’s. I gradually progressed to University and completed two years of E&EE but, like so many others, it didn’t click for me. I drifted between various IT jobs and then worked as a hydro-acoustic engineer for several years. I then became a technical training instructor for offshore process control, safety and automation systems (I found the Meta-Learning podcast particularly interesting). I am now handle special projects for a company in the hydro-acoustics domain again. This involves some PCB design work, mostly interfacing various systems using microcontrollers.

A reasonably complex, successful, project last year paid for my nice new (if small) lab. Everything I know about PCB design has been learnt from a vast array of different sources, along with a lot of trial and error. I figured it was time to try and consolidate this into one source and also brush up my electronics knowledge at the same time, so that is why I am here.

My last personal build was a ESP32 connected to a 4" Touchscreen TFT. I use it as my light switch and energy monitor for my lab. It works well, or at least it does after I figured out I had the auto-reset transistor pads back to front. Flipping the transistors upside down fixed that, but it’s that type of silly mistake I want to avoid, and by having to think less about design basics should increase the time I can spend checking and double checking everything. At least that’s what I’m hoping.

All my PCB design up to this point has been in Eagle. I’m keen to get to grips with KiCad since Eagle is effectively dead, and I don’t see the transition to Fusion being completely usable for some time yet.

I am currently awaiting delivery of my Getting to Blinky PCB and also another slightly more complex PCB (which had to be rushed for various reasons beyond my control). I’m fairly confident Getting to Blinky will work out of the box, the other one I think has a 30% chance of all sections of it working first time.

I have several projects in mind to complete hopefully before the year end, but I think the one I would like to complete at the end of the Contextual Electronics course is a breakout for my recently acquired GPSDO.



Welcome Graeme!

This sounds like a wonderful early project. It’s amazing the chips that are available these days and the projects they enable.

Update (Part 1)

Purpose: Follow CE video to create first PCB in KiCad.

First impression when I received the PCB was that it looked like expected and checking under the microscope didn’t reveal any obvious deviations from the original design.

Construction was straightforward and upon inserting the CR2030 the PCB worked as intended. No other testing was carried out,

Since this was a simple board to construct, with several different footprints to deal with, my partner constructed the second PCB (on the left). She had only ever added a few 0805 resistors to an old PCB, and has no other soldering experience. It took her slightly longer, but she got there in the end and did a remarkably good job. The most important part - the board worked first time.

All in all a successful first KiCad project.

1 Like

Update (Part 2)

Purpose: Multi-application project.
Application 1: Read remote NTC thermistor, output temperature over RS232 and USB. Temperature to be displayed on OLED. Ability to compensate for cable resistance in software. Powered via USB.
Application 2: Handheld device to read sensor battery status over RS232. The sensor islocated in extremely harsh environment, so utilises wireless charging in order to allow sealed enclosure to reduce the likelihood of damage to the electronics.

First STM32 based PCB.
Using MAX3250 for isolated RS232 communication
Not using a FT232/FT231 for USB communication
Using a rotary encoder in a real project
Wireless Charging
Using the TPS63020 for 3.3V boost/buck regulation
Using the MCP73833 for charging
Using MAX6682 to read NTC

First build of this PCB. Due to various reasons beyond my control the PCB was pushed to manufacture before a full validation of the schematic and layout. A case of how much is going to work, rather than expecting everything to be perfectly working.

Summary of Testing
Prior to delivery of the PCB, when I was ordering the rotary encoder, it became evident that I had two of the pins (B&C) reversed. Mistake #1.

Initial inspection, under the microscope, of the PCB showed no obvious deviations from intended design. Other than the holes for the OLED do not line up with PCB. Normally I 3D print the PCB to check fit but alas I relied on the datasheet. Mistake #2.

Power was connected to USB. No magic smoke. Output from voltage regulator showed, steady, clean 3.40V.

Programming STM32 was successful. PLL frequency set to 48MHz and master clock output enabled. Checking clock output on frequency counter showed 48000000.17Hz. Crystal loading circuitry would appear to be correct.

OLED added. Worked as expected.

MCP73833 Status pins read successfully.

Added battery with multimeter in series to read current. Battery charging at ~200mA as per design. No excess heat on PCB. TPS63020 showing no deviation in output under load.

Internal Battery ADC tested. Required increasing STM32 ADC samples but otherwise reading accurately.

USB communication failed to work. On checking data sheet for STM32 a 1.5K resistor should have been added to pull up the D+ to 3.3V. After adding a resistor USB communication worked as expected. Mistake #3.

Battery No. 1 fully charged and MCP73833 shutdown as expected.

Wireless charging coil connected. Wireless charging worked as expected.

Disaster #1: now unable to program STM32 (device not found). Regulator now showing 6.3V output.

Components added to PCB No.2 - completed above testing with same result. Did not connect wireless charging coil this time.

Low voltage shutdown (3V) detection working as expected.

MAX3250 RS232 transmit and receive tested OK up to 115200. Not expected to be used above 9600.

MAX3250 Shutdown and fault detection tested OK.

Checked isolation - extremely high resistance between VCC’s and GND’s as expected.

Button input - not connected to 3.3V plane as per design. Eagle has done something weird here. Connecting wire between button and 3.3V leads to expected behaviour. Mistake #4.

Checked communication with MAX6682. All tested OK. Checked linearity of reading using precision variable resistor. Calculated 7.1C offset correction needed. Excellent linearity between expected usage range of 0C and 10C. 1.2C drift at 25C. May add LUT of corrections.

Standby current measured. Unable to get current lower than 14mA. Checked by disconnecting various components and discovered that by measuring the state of the MAX3250 shutdown pin with the oscilloscope the current usage would drop to 230uA (without OLED). Connected 10K resistor between shutdown pin and gnd. Standby current now 230uA, and MAX3250 still working correctly in normal usage. Guessing that there is a very small amount of current leaking from the STM32 in standby mode therefore the signal needs to be actively pulled low. Mistake #5.

Rotary encoder hardwired to correct mistake #1. Works as expected.

Tested with actual real world sensors. Works as intended.

Application #2:


Overall I am happy with where I got to with this attempt. Apart from disaster #1 I have been able to test all the significant parts of the board and shown that it will meet the needs for both applications (and others). I still need to investigate what happened with the first PCB, however the second one has been working perfectly for the last almost two weeks. It may be that I add a second USB connector for the wireless coil to attach to with a zener diode to protect against transient spikes (my guess as to what happened) In the next revision other than the obvious mistakes to be fixed I think I’m going to add a FT232 or FT231. I’m not convinced by the STM32 VCP and would prefer to go with what I know. I need to add test points. I may look to add a FET to shutdown the MCP73833 in standby mode which has shown it would save another 30uA. I may remove the programming header in order to save space and use a pogo pin jig to program the board instead.

Comments welcome.

1 Like

This is a great mindset to have. “perfect is the enemy of the good” is a common hangup for people getting started in electronics. Heck, I still deal with that.

Bold move in the times of the chip shortage! :smiley: (STM32 are notoriously hard to find right now)

That display looks awesome! Amazing what a bit of graphics does to increase the look and feel of a project.

Sometimes I find it easier to give a part its own linear regulator and implement a shutdown via the “EN” pin. YMMV. Overall, I think it’s a great exercise to think about what you can turn on or off in super low power mode.

Thanks for your kind comments Chris - they are much appreciated.

There’s a shortage of STM32’s?

I estimate I have enough STM32’s for one year. I have equivalent quantity of all the other IC’s as well.

I like the linear regulator idea - a very simple and elegant way to control a device - a great little bit of knowledge for the toolbox. Thanks again!