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.

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.