Friday, September 3, 2010

Eagle Tips: Pour Regions

I draft all my circuits and board designs using Eagle from CadSoft. I've now drawn dozens of circuits and created several PCBs using this software. I picked up some tricks along the way.

Today's trick is: using ground pour polygons to simplify PCB routing

When designing PCBs, I find it easiest to hand route most of my designs to ensure the traces are exactly where I want them.

One way to simplify the routing task is to use a ground pour, or polygons, in Eagle. Basically what this means is filling in all the blank spots on the PCB with copper, and tying all the ground pins to this swath of copper.

Using a ground pour region also saves you time and etchant if you're doing your own PCBs at home, because there's less copper to remove.

Here's how.

Walk Through Example

I created a PCB, below, to interface Pokey with serial adapters; a BlueSMiRF Bluetooth modem and a Sparkfun FTDI serial to usb adapter.

Serial adapter with ground pour region
Notice that there are large regions of the board colored blue, just like the other bottom traces. These regions are all part of the ground pour.

Let's rewind the clock and look at the serial board prior to laying it out.  It looks like this. The components aren't yet placed on the board, outlined in white. No traces exist, only thin yellow lines representing the ratsnest.
Components not yet laid out on the board to the right
Before you do anything else, create a polygon surrounding the board. Select the polygon tool (below left), draw a box around the outline of the board (below right). Make sure you're drawing the polygon on the Bottom (blue) layer.


Then right click the polygon outline, select Name from the contextual menu, and rename the polygon to GND which will connect it with the ground network in Eagle.

Right click the polygon, select Name
Enter GND as the polgyon's name
After you've created your ground pour, you can now move your components into place. If you click the ratsnest icon, the pour region will fill in and will connect any pin on the GND network to this pour region.

After clicking ratsnest, notice ground pins are connected.
Isolate Pour and Traces

When doing my own PCBs at home, I find it helpful to put some space between the pour region and the traces. This is done with the Isolate parameter of the polygon. At home I find trace widths of about 0.024" to 0.032" are reasonable so this is the isolation setting I use.

Without isolation between pour and traces
Select the polygon, select properties, and choose 0.024" in the Isolation drop down menu.

With 0.024" isolation between traces and pour

NOTE: if a fabrication company is making your PCB, you may not be able to set isolation between the pour and the traces. Check with the vendor.

Use Orphans to Reduce Blank Spots

Sometimes there will be blank spots on the PCB that aren't contiguous with the ground pour, as in the example picture above. To minimize the blank areas on the board for home etching, you can have the ground pour create orphans, or islands of pour unconnected with anything else.

Kenneth, one of our readers, suggests we keep in mind that ungrounded blobs of copper can cause problems for high frequency signals. For home etching and low frequency it should be ok.

Select the polygon, select properties, and click the Orhpans checkbox. The default setting turns Orphans off.

Orphans enabled; note fill in between the two traces

Use Thermals for Easy Soldering

Thermal traces
I've found it much easier to solder pins to the ground pour region when Thermals are used.

Instead of connecting the pin to a huge chunk of copper, which acts as a heat sink, and makes for blobby, cruddy solder joints, up to four thin traces connect the pin's pad to the larger region. The traces are easier to solder, I've found.

Select the polygon, select properties, and click the Thermals checkbox. This is the default.

Use Top Layer To Connect Grounds

Sometimes two ground pour regions are separated by a single trace, leaving the two regions disconnected. When you're etching single layer boards, you can still use top layer traces, implemented with wires, to fix the problem.

In the example below the vertical trace on the left that is marked by a white line is preventing the ground pour region from being contiguous. The unrouted line shows that the Ardweeny and bottom pin header ground aren't connected electrically.

The ground pour region is split. See the unrouted line?
You can convert part of a trace to reside on the top layer allowing the ground pour region to 'flow' underneath the jumper and connect the two regions.

Below, the vertical trace is converted to a top layer. The ground pour is now contiguous.

The left vertical jumper fixes the ground pour split

If your board will be two layer, no problem. If it's a one-layer board just use hookup or bus wire to implement the top layer.

Friday, August 20, 2010

IR LED Flame Detection

Welcome new readers! Watch for articles to appear every 1-2 weeks, as if by magic. Podcasts appear... whenever I get around to it. On with the article:

While refitting Pokey the firefighting robot, I revisited the topic of candle flame detection with infrared LEDs, phototransistors, etc.

Originally, I'd used a pair of infrared (IR) light emitting diodes (LEDs) housed in a flashlight reflector housing. It was an inexpensive solution that seemed to have promise. It improved the sensitivity to distant/faint signals and reduced sensitivity to signals outside the regulation 15-20cm flame height.

I wasn't able to perfect the sensor and abandoned it in favor of a custom camera and software solution. Here's a summary of some information I collected along the way. perhaps it will help someone and inspire further investigation and experimentation.

Information originally collected from various Wikipedia articles.

Here's an excellent source of information.

Photodiode: Make use of the fact that LEDs have inherent capacitance. Charge the LED with the MCU interface pin set to output mode high.  Then set the MCU interface pin to high impedance CMOS mode, and measure the time it takes for the LED to discharge. The rate of current leakage from the LED is proportional to the ambient light.

Photovoltaic mode: This is the mode I used for Pokey's sensor. Same concept as solar cells which, in fact, are just large photodiodes. Ambient light causes voltage to build up in the device.  More voltage means more ambient light.  I amplified the voltage with an operational amplifier and read it with an analog to digital converter.


Photoconductive mode: reverse bias the diode, decreasing inherent capacitance. Benefit is faster response times with the tradeoff of increased noise.

Avalanche photodiodes: similar to regular photodiodes but operated with higher reverse bias. Internal gain in the device comes from multiplication by avalanche breakdown.

Phototransistors: basically bipolar junction transistors with clear packaging such that photons reach the base-collector junction. The b-c junction acts as a photodiode whose current is amplified by the transistor's current gain (hfe). No better at detecting low light levels but more input-output gain (responsivity).

Friday, August 6, 2010

Eagle Tips: Jumper Wires

I draft all my circuits and board designs using Eagle from CadSoft. Having drawn a couple dozen of circuits and PCB layouts using this software. I picked up some tricks along the way.

Today's trick is: using jumper wires when single sided routing won't work

For the home DIYer, single-sided PCB fabrication is well within reach. Double-sided, not so much. I find it easiest to hand route most of my designs to ensure the traces are exactly where I want them.

Occasionally, there is just no easy way to route every trace on the bottom. Using jumper wires on the top side of the board is a simple way to complete the single-sided design.

Here's how.

Walk Through Example

In upgrading Pokey my firefighting robot, I created a board to interface a Solarbotics Ardweeny (ATMega328P with a backpack board) to a GameBoy camera to detect flames.

I'd laid out the entire board but pin 12 and pin 26 on the ATMega328P still needed to be connected (see pink arrows below). There was no convenient way to do this on the bottom layer. Notice pin 12 has a trace going up to pin 8 of the top pin header, which is the camera interface.

Please ignore the vertical red trace on the left of the board. Its purpose will be discussed in another article.
How to connect pin 12 and 26? With a jumper...
The first step is to go ahead and draw a trace between pin 26 and the trace between pin 12 and the top pin header. See below. We're going to convert part of this new trace to a top layer jumper. Draw the trace so that there's a horizontal section separate from the rest of the trace.

Draw trace. Ensure there's a horizontal section.
Notice this new trace features a vertical section coming off pin 26, then a right angle and a long horizontal part. That horizontal section of the trace will become the jumper. If we didn't have the vertical part of the trace, the jumper would land on top of pin 26 and that just won't work.

Once you've drawn the trace and connected the pins, right click the horizontal section of the trace, and select Properties from the contextual menu.

Right click the trace and select Properties
Select the Top layer from the Layer pull down menu and click Ok.

Select Top from the Layer menu to move the trace.
The trace is now converted to the top layer and is colored red. Vias are added automatically. When you print your PCB design artwork for transfer, simply turn off visibility of the top layer. The resulting printout will include the vias for this trace, but not the top layer trace itself.

Implement the top layer traces as jumper wires.
After etching your board, you can simply run a bus wire or hookup wire as a jumper between the two vias. This approach of using bus wire jumpers was common in a lot of 90's audio gear I've disassembled.

You can increase the size of the vias to something more normal like 0.039" or 0.031" diameter holes by right clicking each via, and choosing Properties from the contextual menu.
Select Properties for each via
Then select the appropriate drill diameter from the Drill pull down menu for each.

Select the via's drill size from the pull down menu.
Examples

Here are a couple more examples of my use of jumper wires on boards I've designed.

Serial board with jumper for handshaking
Vertical jumper between V+ input and 555 timer IC's Vcc pin.