JulianHartline.com Rotating Header Image

January, 2014:

3D Bodies View

For previous boards, I’ve never had a need for it, but Altium provides a neat feature for modeling the 3D bodies of your components. While many hobby boards will have plenty of space and components with a very simple vertical presence, certain projects and components may be a little more complicated. In my case, a few components, would stand off from the board allowing space to place certain components underneath them. Often this would be enough space for a microcontroller or flat parts but not enough space for headers, connectors, and larger capacitors.

When designing a component in Altium, you have the option of specifying a number of “3D bodies” in addition to the pads and silk screens that you are probably already familiar with. These 3D bodies give you the ability to specify in a fairly simple way the vertical component of the part. While nowhere nearly as sophisticated as a 3D modeling program, this is quite sufficient for describing the basic shape of a component in 3D including overhangs, shaped extrusions, cylindrical buttons, and even spherical bodies.

The most basic benefit of using this feature is that you get access to a much more powerful component placement rule check that takes into consideration the 3D bodies, when available. The other benefit is that you can now get a better feeling for what your board looks like in 3D view.



Last, but certainly not least, this 3D PCB can be exported in a format that is compatible with 3D modeling software so that you can better model either multiple circuit boards or the PCB’s participation in an enclosure.

Tinkering Update: Reflow Project

After the first taste of reflow soldering, Eric and I, as good engineers are wont to do, decided that the task was begging for automation. In particular, we decided that it was sorta silly that the cheapest commercially available reflow oven goes for $500 driving most hobbyists to resorting to a mundane toaster oven. A thermocouple ordered on Ebay, a simple relay, and about 30 minutes later we managed to hack together a simple reflow toaster oven with a soldering profile hard coded to the paste that we are using.

The exercise, and the fact that the breadboard solution was rather unwieldy and inelegant got us thinking that it might be worth building a more integrated solution to what seemed like a fairly common problem with no particularly easy solution. A little bit of market research did reveal some previous projects that people had done to the same basic effect, but none of them were particularly convenient or streamlined.

The reflow controller that we were planning would consist of a relay to control the power to the toaster, a thermocouple to measure the temperature of the oven, and a simple interface. The interface would be comprised of a 3 digit 7-segment display, a knob, a button, and some LED indicators. All of this should fit into an AC wall plug enclosure from Polycase that we will eventually be able to customize to our needs. The idea is that you plug this unit into the wall and then use the receptacle on the back to plug in your toaster oven.

The first part of this project is the relay and power supply. The goal here is to create a module that can both transform and control a standard AC 120V wall outlet. Normally our electronics projects utilize an external AC adaptor that brings us 5V DC power directly to our board. In this project, because we want to keep everything self contained and because we’ll be controlling the outlet, we want to avoid the inconvenience of plugging in multiple devices and combine these two items into one.

To do this, we connect a transformer in parallel with the relay and the outlet in series with the relay. This will make sure that the microcontroller receives power even when the relay is cutting power to the outlet. The power supply half of the board consists of a transformer to bring the voltage down to 5V, a bridge rectifier to flatten the AC signal out into DC, and a collection of voltage regulators and capacitors to generate a consistent output. We ended up providing both a 3V and a 5V output. For the relay part of the board, we used a relay driver and a power relay. Many other solutions use a solid state relay, but our initial experiences indicate that it may not be necessary and would be significantly more expensive. It remains to be seen whether the power relay will be sufficient.

Here is the PCB that we ended up designing. Notice that there are mounting holes and a cut-out on the right side for the outlet pins that protrude up into the inside of the case.



Polycase very nicely provides 3D models of all of their cases for download. It was a bit of a trick to get the CAD file transformed into a format that SketchUp could recognize, but once done, the model proved an extremely useful tool for both visualizing the product and ironing out details such as PCB size and shap, hole location, and header location as well as part clearance.

Here is a view in SketchUp of one of our earlier versions of this. Because this 3D model is only used for planning purposes, many of the pieces that I used are simply approximations of how the part would look. Most of these components were build in SketchUp using their respective datasheets as a guide.



The upper layer PCB shown in the image above is where the controller itself lives. This board will contain the microcontroller, the controls, and the connectors. We decided to build this board “upside down” by placing almost all of the parts facing down (away from the front panel). The exception, of course are the pieces that actually do need to face the front panel such as the 7-segment display, the buttons, the encoder, and LEDs. We did this to provide a little more breathing room for all of the parts that we needed to fit on there as the PCB was getting pretty tight. Here is the current version of the PCB as of writing this.




One of the most exciting things about this project so far has simply been all of the designing that has gone into the 3D aspect of working within the case. In the past it has simply been a matter of getting all the parts on the board and hoping for the best, but now there are real world space constraints and physical requirements such as mounting holes and clearance is something that matters much more now that we’re working in multiple layers on multiple boards with large components.

Look for the Kickstarter when this gets off the ground and I’ll hopefully post again with an update when we start getting these boards printed.

Tinkering Update: LED Strip Project

At the same as working on the nRF24L01+ PCB,  I’ve been progressing on another project. I picked up a 30/m addressable LED strip from Macetech. These LED strips are comprised of the WS2812 tricolor LED and controller package.

The WS2812 contains a red, green, and blue LED and a controller complete with a single line data interface and 3 PWM modules for running each of the LEDs individually at independent brightnesses. Furthermore, the controller is set up so that it can transmit signals to the next WS2812 in the strip so that these modules can be daisy chained.

When put together into an LED strip, a microcontroller can simply provide power, ground, and a single line of data to control the entire strip. To populate the LED strip, a series of  bytes is sent to the first LED. Once 3 bytes are sent (the color definition for one LED) the next byte causes the first color to be “pushed” on to the next LED. When the entire strip is populated, sending a reset signal causes each LED to display the color that it ends up with.

Sending a byte to the WS2812 requires 8 transitions on the data line each spanning 1.25 microseconds for a total of 10 microseconds per byte. Unfortunately, using a PIC18F25k80, this timing requirement allows for about 20 processor cycles for each bit transition. This is is a pretty tight requirement and I was unable to make it with my C compiler. Instead I ended up writing a method in assembly to get the timing I needed. It took awhile to get it right and it still has some minor bugs, but it was an interesting exercise.

After getting the code working on the nRF board that I previously blogged about, I designed a new PCB to better fit my requirements in a smaller package. This time I used primarily surface mount parts in significantly smaller packages. Here is the final PCB design and the populated board.



Remarkably, this board seemed to work flawlessly the first time around. Both the nRF module and the LEDs worked exactly as expected.

One additional piece of progress made with this board was our first successful use of reflow soldering to populate the board. Reflow soldering uses solder paste instead of traditional solder which is viscous at room temperature. To solder a board, solder paste is applied to all of the pads and then components are placed in the sticky paste. Once prepared, the board is simply baked to just over 180° C which causes the paste to fuse to the contacts and turn into solder, thus soldering your entire board in moments.

I’ve continued writing code for this board and have a simple proof of concept that lights the strip in some demo patterns during until it receives a packet on the wireless module. At that point, the LED strip is under remote control. Packets consist of an starting index, a length, and the payload that is copied into the LED buffer and then displayed to the LED strip.

The next step in this project is to design a new board, probably using an Atmega microcontroller that will fit into a case sold by Polycase. Getting a PCB and components to fit into a case is a new hurdle that has involved a significant amount of 3D modeling in SketchUp as well as extra spacial considerations such as switching to a flatter power jack.