Author Archives: admin

Tools of the Trade – Solder Paste Dispensing

Posted by admin in Hackaday - (Comments Off)

The general process of circuit board assembly goes like this: You order your PCBs. You also order your components. For surface mount components, you apply solder paste to the pads, put the components on top, and then heat the board up so the solder paste flows and makes a bond. Then for through hole components you put the leads through the holes, and solder them with an iron or a solder wave or dip. Then you do an inspection for defects, program any microcontrollers, and finally test the completed board to make sure everything runs.

The tricky part is in volumes. If you’re only doing a few boards, it’s usually easiest to assemble them by hand. In the thousands you usually outsource. But new tools, and cheap hacked tools, have made it easier to automate small batches, and scale up into the thousands before outsourcing assembly.

In this new series which we’re calling Tools of the Trade we’ll be covering a variety of tools used for building products, and we’re starting with circuit board assembly. Let’s investigate our tools of the trade: solder paste dispensing.

Read the full article at Hackaday: Tools of the Trade – Solder Paste Dispensing

I’m a writer for Hackaday.com!

Posted by admin in Hackaday - (Comments Off)

I’m now a writer for the popular web site Hackaday.com. I’ll be writing regular pieces about startups and technology and being a badass engineer and hacking stuff together. I’ll be posting links to my articles here as well. I won’t post all my articles here, just the ones that are all me, called Original Content. The other kind of stories we do at Hackaday are called Dailies, and those are articles writing up things that other people do. Here I want to link to the things I do.

PCB Design Guidelines to Minimize RF Transmissions

Posted by admin in Hackaday - (Comments Off)

There are certain design guidelines for PCBs that don’t make a lot of sense, and practices that seem excessive and unnecessary. Often these are motivated by the black magic that is RF transmission. This is either an unfortunate and unintended consequence of electronic circuits, or a magical and useful feature of them, and a lot of design time goes into reducing or removing these effects or tuning them.

You’re wondering how important this is for your projects and whether you should worry about unintentional radiated emissions. On the Baddeley scale of importance:

  • Pffffft – You’re building a one-off project that uses battery power and a single microcontroller with a few GPIO. Basically all your Arduino projects and around-the-house fun.
  • Meh – You’re building a one-off that plugs into a wall or has an intentional radio on board — a run-of-the-mill IoT thingamajig. Or you’re selling a product that is battery powered but doesn’t intentionally transmit anything.
  • Yeeeaaaaahhhhhhh – You’re selling a product that is wall powered.
  • YES – You’re selling a product that is an intentional transmitter, or has a lot of fast signals, or is manufactured in large volumes.
  • SMH – You’re the manufacturer of a neon sign that is taking out all wireless signals within a few blocks.

Read the full article at Hackaday: PCB Design Guidelines to Minimize RF Transmissions

In the world of electronics assembly, parts are really small, quantities are really large, and equipment is really expensive. The process of putting all the components onto circuit boards thousands of times per hour with really high accuracy is challenging, but tools are getting easier and cheaper every day.

At my job (Quietyme), we’re doing our own circuit board assembly. We had to purchase some equipment, like a pick and place, which for $5000 automates the process of taking the small components off of reels and putting the components on the circuit board. We also have a stencil screenprinter and a reflow oven (toaster oven). Total investment so far has been under $6000.

The most recent tool to add to our arsenal is an Automated Optical Inspector. The purpose of the AOI is to examine the circuit board to find defects in the assembly process. Sometimes a component doesn’t solder on correctly, or there is a bridge where there shouldn’t be. These need to be found and fixed before they are programmed and used. We had been doing it manually with just visual inspection, but that was tedious and not very accurate, especially after the 100th board.

I had been reading into OpenCV and decided I’d give it a shot. The idea was to take a regular webcam, point it at the circuit board, do some image analysis to figure out if there were parts that didn’t match a “good” board, and highlight those so that a full inspection by a human wouldn’t be necessary. After a little bit of playing, I realized it could work. I designed a holder and laser cut it out of acrylic, then glued it together. It was pretty slick. With the threaded rod I could raise the camera up until the PCB occupied the entire field of view, so no pixels were wasted. I wanted consistent even bright light, so I added a bunch of white LED strips. I immediately noticed a problem with hot spots, so I added a layer of acrylic with a diffuser (a piece of paper glued to it).  Finally, I glued the bottom of the enclosure to the base. The PCB was designed for the enclosure, so it was a perfect holder that would consistently keep it in the same place.

aoi

The camera is a 720p Microsoft LifeCam that I had laying around. In the next version I’ll upgrade to a better camera. The LED strips are just 12V white LEDs.

Now the software. I used the OpenCV CV2 python library, and ran it both on my main dev computer (Linux Mint), and my test laptop (Win XP (shut up)). The older computer was definitely slower, and setting up OpenCV in windows is a pain, but I made it work.

The first step is to get the video stream from the camera and display it. Fairly simple. Then I experimented with diffing against a known good board. The idea was that by subtracting the video from a good image, only the differences would be visible. This is good in theory, but it didn’t work at all in practice:

diff

This is way too busy to think about and try to analyze to find poorly placed components. It wasn’t going to work.

The next idea was to mask out anything we didn’t care about. There are unpopulated components on this board, and we don’t care about the silkscreen or the outside edges. There’s no point showing them to the user. So I created a black and white mask:

mask

 

This mask is displayed over the top of the video stream, so that the operator only has to look at the unmasked parts to evaluate the board. Like so (note that this is an intentionally sabotaged PCB which has bridges, tombstones, and misaligned components that I put in to test the pattern matching):

output2

Great! Now the work is already a lot simpler. From here I wrote a quick routine that would zoom in on the Zigbee chip to digitally and show a 4x zoomed chip to look for bridges. So no pattern matching yet and we’ve already significantly improved the inspection process and reduced eye strain.

The next step was adding in the pattern matching. The idea is to use the OpenCV template matching feature to identify components that are correctly soldered and use those as a template, then when the video stream sees those templates matched it’ll draw a black box over the component indicating that it doesn’t need to be examined. So the above image after pattern matching should look like this:

output3

Bam! Now we’ve gone from having to inspect a full board to just having to check over a few components! In reality it ends up not matching perfectly so we usually see a few extra components that are just fine, but it’s better than having the threshold too low and accidentally blocking out bad joints.

So how does the setup process work? By drawing boxes! In the python application, just drag a box around the component you want to use as a good template, and it will create an image and store it and use it as a template from then on. I started by first looking over the entire video stream for each template, with the idea that a capacitor in one place might look like a capacitor somewhere else. This was a dumb idea and slowed down the system to unusable. Then I got the idea to save the image coordinates as the filename, and only look within a certain bit of slop within that area for that template. That got me back up to near real time processing of the feed. It also allowed me to have multiple good templates for a single component to bump up the likelihood of matching without sacrificing the threshold of matching.  So it ends up working pretty well. Here are some examples of component templates:

template_example

 

So to summarize, I’ve put a few hours of time (<20), a webcam, and some hardware into this, and I’ve got a functional AOI to add to our assembly line. It’s really only useful for small circuit boards, and a single camera that doesn’t move definitely has limitations, but it’s really a testament to the awesomeness of OpenCV for making this so easy.

It should be noted that a cheap AOI can be had for $20k, and the ones used in some factories sell for over $100k. Mine is by no means competitive with theirs, and couldn’t find nearly as many types of faults on as large a board. They move the camera around and look at solder quality using colored lights and blah blah blah. But for the price of a webcam, some acrylic, an LED strip, and a few hours of time, this is a pretty big step.

Want the code? Here ya go: AOI Python code

Side project – Mallards Fast Pitch

Posted by admin in Building | Personal Projects - (Comments Off)

My hackerspace Sector67 was approached this winter with a problem; the local minor league baseball stadium (Madison Mallards) fast pitch sign was old and no longer working, and they wanted some help fixing it up. In exchange for our expertise, they promised significant advertising and publicity, and they would have us be special guests at a ‘maker’ day during the season.

For the impatient, here’s the finished product:

final_close

We took them up on the offer and had a field trip to the stadium to see what was already there. There are two main parts to this project. First, there’s the sign itself. Second, there’s the press box, where the radar gun and the sign controller sit. The previous method was to have the person running the scoreboard watch the radar gun and type the speed onto a controller. There was no accounting for the angle of the radar gun, and it required a person to act as the middle man. They wanted to automate this part of the process. With the sign, they wanted it to work again. After seeing their existing setup, it didn’t take long for us to decide they needed an upgrade and we would start from scratch.

The sign in right field. Doesn't look very big from this shot, but it's legible from the far side of the stands.

The sign in right field. Doesn’t look very big from this shot, but it’s legible from the far side of the stands.

Up close you can see it's a bunch of incandescent bulbs. They're not even covered! I wouldn't want to run into that sign while catching a ball.

Up close you can see it’s a bunch of incandescent bulbs. They’re not even covered! I wouldn’t want to run into that sign while catching a ball.

The electronics controlling the sign. This is basic and ancient stuff here.

The electronics controlling the sign. This is basic and ancient stuff here.

Up in the press box, this is what controls the sign.

Up in the press box, this is what controls the sign.

This is the radar gun. They have to charge up the battery (the handle) before every game. This is a pain.

This is the radar gun. They have to charge up the battery (the handle) before every game. This is a pain.

The stadium let us borrow the radar gun, the only part of the process we intended to keep. Reverse engineering it wasn’t too bad. We were able to find a manual and figure out that the three pins coming out into the handle were two for the battery and one for a serial signal. Once we connected to this signal, it was trivial to decipher it (9600 baud ASCII text). We designed a 3D printed part that would take the place of the handle and supply power to the radar gun as well as grab the serial signal.

3d_printed

Yes, those are nails. They worked perfect.

After that was the box to replace the controller. This box would read in the serial signal, compensate for the angle, and send out a signal to the sign. At first we played with XBee for a wireless transfer. This ended up being so unreliable and so difficult to get set up that we decided to give up. Besides, long term support is important for this kind of a project, and something wireless is a lot more difficult to diagnose and debug than wired. So we went with RS485, which is perfect for long distances, and there was already a pre-existing cable from the previous sign. I threw in a screen and some buttons for good measure (to let the user adjust the angle), and a switch to turn it all on, and we were good to go. Now the only thing a user has to do is flip the switch to turn it on, then push the power button on the radar gun, and it works.

The view from the press box. The radar gun captures every pitch, the controller box is mounted on the wall, and the previous controller is wrapped up on the desk.

The view from the press box. The radar gun captures every pitch, the controller box is mounted on the wall, and the previous controller is wrapped up on the desk.

The controller box. There's a screen, buttons, and power switch. The cables are for power in, power/serial to the radar gun, and RS485 out to the sign.

The controller box. There’s a screen, buttons, and power switch. The cables are for power in, power/serial to the radar gun, and RS485 out to the sign.

Inside the controller. An arduino with LCD/button shield, a RS485 breakout, and wires.

Inside the controller. An arduino with LCD/button shield, a RS485 breakout, and wires.

Next was coming up with a sign. We’ve used the P10 red LED modules before on the bar bike, so we had some experience. For this one we purchased the outdoor waterproof ones. We also got power supplies and a controller card. There is some code on the web for controlling these guys directly, but it’s a lot of work and I didn’t have the time or inclination to figure it out. So we went with the controller card. I should note that the prices for these parts is ridiculously cheap. The LED modules are $6.50, the power supplies are $8, and the controller card was $50. So we had all the major components for the sign for just a few hundred dollars, and that’s because we ordered extras of everything in case of failures. We designed and cut an enclosure and attached the modules to the frame, then wired everything up. The wiring is simple; power up each column, data across each row. Two power supplies power two columns each.

Behind the sign. Two power supplies, one laptop, a controller card and hub, and a laptop. The sign is 6 rows and 4 columns, giving us a resolution of 128x96

Behind the sign. Two power supplies, one laptop, a controller card and hub, and a laptop. The sign is 6 rows and 4 columns, giving us a resolution of 128×96

Getting the controller card working was tricky, though. There is no documentation on the protocol, so I tried sniffing the packets being sent to it, but couldn’t make sense of them. There was no API, and after repeatedly pressing the Chinese company for resources, they sent some sample code and a dll, but it would only work on windows. We were trying to avoid Windows and go with a cheap (and low power) linux PC or Raspberry Pi, but in the interest of time, we ended up bailing on that and just getting a very old and cheap Windows XP laptop. Fortunately, it had a serial port, so we could hook a RS485 to RS232 converter to it and we were able to communicate quickly with the press box.

The controller card comes with some windows software for setting up the sign and displaying content, but it was difficult to get it to show real time data. What we ended up doing was writing a python script which would monitor the serial port and upon receiving a speed would write that speed to a file. One of the options in the other software for controlling the sign (called LEDSHOWT9), was to display the contents of a file, and update every N seconds. So we picked that option. Now every few seconds LEDSHOWT9 will look at the file, and take the contents (either the speed or a blank), and show that on the sign. Tada! It’s a hack, but it works. If inclined, maybe I’ll write up something better and do animations or something. But probably not.

Here’s the final product.

Clearly visible during the day from the stands. Pretty font, works automatically. Complete success.

Clearly visible during the day from the stands. Pretty font, works automatically. Complete success.

I’m going to China!

Posted by admin in Uncategorized - (Comments Off)

A couple months ago I applied for a program in its first year for hardware startup companies. Called HAXLR8R, the goal of the program is to make manufacturing in China more accessible to startups by providing workspace and tools and mentors and experts to ten teams for three months in Shenzhen. After those three months, the participants spend a week in San Francisco and give a demo to investors.

I found out recently that I was accepted for my project on the Portable Electronic Scoreboard. I’ve been working on this project for a while, and now is a good time to go to China because I need to take it to production, and this is a great way to do it.

Over the next few months I’ll be updating a new blog that I created called Engineer In Shenzhen, which will have personal posts about what I’m going through, and advice and articles for other people who are interested in the process and what it takes to work in China and outsource manufacturing.

If you want a postcard, make sure I have a current address for you. I’ll try to keep everyone updated with progress as I can.

A Kalahari Christmas

Posted by admin in Building | Personal Projects - (Comments Off)

After Erin took me on a ski trip to Salt Lake City for Christmas 2010, I was far behind in the Christmas Karma. For 2011 I planned to take her to a resort in Wisconsin Dells, which is sort of like the Las Vegas of Wisconsin, except with water parks instead of casinos.  Of the many resorts, I decided on Kalahari based on recommendations of others and some research on the web. But just telling her wasn’t a great way to do the presentation. I wanted her to unwrap something.

I’ve been working for a while on a portable electronic scoreboard, so I had all the materials to make a good LED sign with the name. The day before we were to leave for Kansas, I started the project. The idea was to make a big LED sign that said Kalahari on it. It would be battery powered, and a switch would turn it on when the box was opened so that it wasn’t on the entire time and running out of battery. That was as far as I got in planning before I started building.

I borrowed a rechargeable battery from Sector67 to use as the power supply, then laid out the LEDs on a prototyping perf board covered with sticky black nylon paper. It took a couple tries to get it all to fit on the available board with legible letters and decent spacing. Then I found a switch that would work. The circuit was simple. The switch connected the + voltage to the board and the ground went directly to the board. The LEDs were connected with a resistor and two LEDs in series, and all those strings were in parallel. This meant a huge current drain, but I was limited to a power supply with only 6 volts, so I didn’t have much choice. This also meant a LOT of soldering and a lot of current limiting resistors. There was an odd number of LEDs, so I put an extra one on the back side so that the circuits were all the same.

 

With all these LEDs packed into a small space, it was very bright, so I struggled with a few different ways to do the presentation. I ended up taping the board behind a piece of paper so that the paper would diffuse the light a little. It ended up working great. The paper covered everything, including the switch. When the box was closed it was off, and when it was opened the switch was triggered, turning on the sign.

The girlfriend was happy, so the project was a success.

The next time I do something like this I’ll use less LEDs and instead of doing a sign of LEDs I think it would be better to have a piece that had letters cut out and was backlit by only a few LEDs. I also would have spent a lot more time on what was surrounding the sign. Using regular paper and crayon to draw was the best I could do with the limited time and resources I had, but it wasn’t enough for me. Construction took far longer than I expected, and I was a little disappointed with the results. I was working late into the night to solder it all together, and I barely had any time to work on the rest of the package. I can do better.

The Plan

Posted by admin in Uncategorized - (Comments Off)

It occurred to me that a lot of people may be out of the loop with what has been and will be happening over the next while. Here’s a short description of the plan:

Erin is going to graduate school in Madison, WI, and I am moving with her.

On July 31 our apartment lease in Richland expired.  On August 15 our apartment lease in Madison begins. For the two weeks in between, we are house-sitting for a friend and storing our stuff in their garage. On August 15 we pack everything up again and begin our 3 day trek across the nation, putting us in Madison on the 17th. We’ll live there for a couple years while she gets a Masters in GIS (Geographic Information Systems).

In anticipation of this move and change in lifestyle, I’ve made quite a few changes already. A few days ago I sold my car; its useful life had was ending and was getting to a point where it would need more and more maintenance and repairs. Since I work from home, and Erin will be taking public transportation in Madison, and parking is expensive, it made sense to only keep her car. In January, I left my job at PNNL to start my own business. I was subcontracting back to the lab for a few months after that to retain some stable income as I built up my own business. I am currently freelancing a little (and open to new work if you have leads), but also working on the portable electronic scoreboard and an automated dog-sitting application. When we move I’ll continue working on them; in fact changing my location doesn’t change a thing about how I do my work other than that my office will soon have better windows.

The hazop chapter is drawing to a close and the next adventure begins shortly.

Pineapple Upside Down Cake

Posted by admin in Cooking - (Comments Off)
  • 4 Tablespoons butter
  • 1 cup dark brown sugar
  • 1/4 cup pineapple juice
  • 5-7 pineapple rings (or you could use tidbits artfully arranged)
  • 1/2 cup milk
  • 8 Tablespoons butter (they get used for different parts)
  • 1 egg
  • 1 1/2 Cup flour
  • 2 teaspoons baking powder
  • 1 teaspoon salt
  • 1/2 cup sugar

Preheat oven to 400.

Get a cake pan and put it on the stove at medium low heat. Melt the 4 tablespoons of butter inside the pan. Then add the brown sugar until it’s melted. Turn off the burner and then mix in the pineapple juice until it’s an even mixture. Arrange the pineapple rings in the bottom of the pan in one layer.

Melt the 8 tablespoons of butter (about 1 minute in the microwave) in a bowl, stir in the milk and egg, and beat well.

In another bowl, add all the dry ingredients and stir. Combine the two bowls and stir until even.

Pour the mixture in the bowl over the pineapples in the cake pan and spread it evenly in the pan (it’ll be hard to do).

Bake for 35 minutes. Let it cool in the pan for about 10 minutes, maybe even longer. Gently separate the cake from the edges of the pan. The next part is the flipping, which can be tricky. The easiest way is to place a plate upside down on top of the pan. Pick up the two together, and flip it over so the plate is right side up, the cake pan is upside down, and the cake is sitting on the plate with the pineapples facing up.

 

Brownies

Posted by admin in Cooking - (Comments Off)
  • 4 eggs, beaten until fluffy
  • 1 Cup sugar
  • 1 Cup flour, sifted
  • 1 teaspoon baking powder
  • 1/2 teaspoon salt
  • 1 12 oz package of chocolate chips
  • 2/3 cup butter
  • 2 teaspoon vanilla

Melt together chocolate chips and butter (microwave for about 1 1/2 – 2 minutes). Beat eggs and add in everything else. Put in greased 8×12 (or 9×13 works, too) pan and bake at 350 for 25-30 minutes until everything but the center comes out clean with a toothpick (this way the last little bit will cook after you take it out of the oven and it will be soft and moist without being overdone).