Archive for the ‘Circuits’ Category

BatchPCB

Sunday, June 17th, 2012

My academic background is in mathematics and computer science and I’ve picked up electronics as a hobby along the way, primarily self-taught through excellent books by Forrest Mims, the easy crossovers from math and CS to digital logic and digital design (still my strongest area of electronics), a stubborn willingness to read datasheets, and a constant desire to learn.

For the last two years, I’ve been supplementing that with a formal background from my university’s EE department, taking first one and recently two classes per semester. The education is interesting and enlightening, but it does take its toll — at least forty hours a week of work, six hours of classes, and (say) twenty hours of study and homework, plus some volunteer work unrelated to those, doesn’t leave me with a lot of free time; and you can see it by the decline in my hobby activity.

I don’t want to lose sight of what I love, though; and I hope to make a small business of electronics and make a few products available for sale. So this summer I’m devoting every spare moment to get some projects off the ground. And my ally in that plan is BatchPCB.

Why Have Boards Manufactured?

In the past, I’ve done a lot of circuit prototyping on breadboards. For some types of circuits, though, the needed prototyping has more to do with physical form factor and less to do with circuit validation. (I hope to show some examples in the coming weeks.) I’ve etched my own circuit boards; I’ve imposed on friends to mill prototype boards for me; and I’ve hoped to build my own milling machine to prototype my own boards at home.

The drawback of all of these methods is the lack of plated through-holes. I’ve heard of DIY hole-plating methods, but I found them to require a prohibitive setup for chemical processing. I’ve asked everyone I know whether they can think of any source for 1.5-ish mm (60 mil) OD copper or silver tubing, thinking of making a small riveting press to flare tubing onto the PCB surface both top and bottom — and even found very small silver crimp tubes used in beadwork and jewely-making, but none as small as 1.5 mm OD, nor in a consistently appropriate length.

I’ve worked around the lack of plated through holes by laying out boards that don’t require them, always carrying a signal from top to bottom using a component lead that can be soldered on both sides. But this means no vias (soldering pins top and bottom just to change layers is a pain) and only crossing layers at resistors and diodes. It means always routing connections to electrolytic capacitors on the bottom, ’cause you can’t get to the top side of the board to solder unless you stand the capacitors way up on their leads. It means routing traces to headers only on the bottom, or sliding the plastic guide up on the pins to solder the top side and then sliding it back down. It means a dozen little design compromises for a prototype board that don’t need to be made for a board I’m going to have commercially manufactured later. It means not only extra effort to accommodate my prototyping methods but also extra effort to undo that work before going to manufacturing.

SparkFun Electronics created BatchPCB as an offshoot of their own PCB prototyping contract. They aggregate orders from multiple users, tile them together onto standard-sized panels, upload the panels to Gold Phoenix, get the boards manufactured, receive the shipment from Gold Phoenix, sort out the boards, and send them back. They charge $2.50 per square inch, which is higher than you’d pay if you were ordering 100 square inches — but far less than you can pay anywhere else if you only want a few square inches of prototype. And they charge a flat $10 handling fee per order, regardless of how many designs you include in your order.

They suggest it’ll take about three weeks to get your order. My experience has been two weeks. It sounds like a long wait, but as they say:

As we develop projects, we always get at least one PCB design onto the week’s batch panel. While one design is being fabbed, we have new PCBs for another design already arriving from a previous batch – we always have new PCBs to play with!

My Summer with BatchPCB

I’m trying to place an order every two weeks and to order boards for multiple projects each time. I’ve received two batches so far and I submitted a third this weekend.

Circuit boards from BatchPCB

I’ll say more about these designs as I work on the projects, but starting at the top and progressing in reading order:

  • Logic gate boards to help bridge the huge gap between what happens in the digital design lecture and lab. My classmates with no prior experience did not gain much academic value from poking opaque ICs into breadboards.
  • A Freeduino-derived board for my personal use, manufactured as a proof-of-concept that I have the right components and schematic to embed an Arduino-compatible core into projects of my own. (I will of course publish all source files for designs that I distribute to anyone other than myself.)
  • The first half of a pair of boards to breakout a headphone cable and jack for breadboarding, to plug an iPod’s headphone output into op-amp filter circuits and listen to the results.
  • A board for testing component lead fit against through-hole sizes. To date, I’ve used calipers for measuring lead sizes for PCB design. I’m curious whether testing against a physical board gives me any different expenditure of time or quality of results.

The logic gate boards were my first batch. I ordered four each of two variants of the boards, assembled a few, and discovered that I don’t like soldering 0603 SMT as much as I thought I did; so if I make more, I’ll be changing the boards to use 0805 components.

Lesson learned: Order only one of your first prototype, regardless of how sure you think you are that you’ve finalized the design.

So why so many of the other boards? I did order only one of each … but SparkFun, bless their hearts, appears to fill wasted space in each panel with small customer boards that they give back to their customers as a bonus; and I happened to have small designs in this batch.

Solar Charging and Switching Circuit for Outdoor Sculpture Installation

Sunday, May 29th, 2011

Over the winter, my friend Steve Atwood got a commission for a sculpture to be installed in the Wichita Falls, TX Kemp Center for the Arts “Art on the Green” sculpture garden from May 2011 – 2012.

Lure 22 V2.0 by Stephen Atwood at Kemp Center for the Arts, Wichita Falls, TX

He had in mind to continue a series of his sculptures based on the form of a fishing lure but wanted to enhance this sculpture with one or more LEDs, preferably that would come on only at night. We discussed a wide variety of options that we hope to develop for another installation in the future; but in the end, in the interest of time for this project, Steve found control modules that flash up to five LEDs at random and installed them behind a set of cones protruding from a recessed panel.

He asked how to make the LEDs turn on at night and also wondered whether he could power them for a year from a primary battery or whether he should use rechargeables.

Lure 22 V2.0 by Stephen Atwood at Kemp Center for the Arts, Wichita Falls, TX

About seven years ago, I had come into possession of some discarded solar yard lights, and out of curiosity had reverse-engineered their charging and control circuits. Since yard lights accomplish both functions — charging and switching — I figured the circuit would be perfect for the sculpture. I was able to find one and instruct Steve how to modify it for his needs.

Solar yard light schematic

The circuit is very simple and I find it rather elegant. During the day, the solar panel assembly (left — for want of a proper schematic symbol, I just drew another battery) charges two AA cells through a diode that prevents the battery from damaging the panel with reverse voltage at night. Additionally, through the R1 – R2 voltage divider, the solar panel pulls up the base of Q1, switching it off and allowing R3 to pull up the base of Q2, switching it off and switching off the load LED1.

At night, the panel’s output approaches 0V and R2 pulls down Q1‘s base, causing Q1 to conduct and pull down Q2‘s base (in a Darlington-like arrangement — I don’t know whether it’s still considered a proper Darlington with R3 pulling up the Q1 emitter – Q2 base connection), switching on Q2 and LED1. In fact, depending on the panel’s exact voltage, the load may switch on even before full darkness, and R1 – R2 can be tweaked to tune the turn-on point.

Control board from solar yard light, modified

Steve removed the LED from the control board and replaced it and the fly wires for the solar panel and battery with screw-terminal connectors for ease of installation inside the sculpture. He bought a new solar panel with a higher output voltage to charge the higher-voltage battery for the white LEDs he wanted to use (the yellow LEDs in my yard lights didn’t require as high a forward voltage) and milled a Lexan cover for it to protect the panel from hail, with an O-ring groove to protect it from rain as well.

With higher battery and solar panel voltages, Steve indicated the load was turning on before the ambient light got as dark as he wanted, so I told him how to locate R1 and replace it with fly wires to a 100K pot. After the swap, he said he was able to tune it perfectly and he was delighted.

Lure 22 V2.0 by Stephen Atwood at Kemp Center for the Arts, Wichita Falls, TX, night view

I’ve not had a chance to visit the sculpture garden and probably won’t while Lure 22 is installed. If anyone’s in the area, I’d love to hear from you how well it’s working and how well the electronics hold up over the course of a year outdoors.

Modifying a Car USB Adapter to (Finally) Charge My Cell Phone

Saturday, May 28th, 2011

A couple of years ago, I received this automotive USB-connector power adapter as a promotion at a conference. I use it to keep my iPod nano charged in the car, but I’ve noticed it doesn’t charge my Blackberry well. To be precise, it doesn’t charge my Blackberry. In fact, I’ve never been clear whether it even slows the rate of discharge, and sometimes it seems like it speeds it. The Blackberry shows the lightning bolt charging symbol (The charging symbol is a lightning bolt, srsly? Ben Franklin is personally charging my phone?) but nobody’s home.

Note that I don’t blame the vendor whose logo happens to be on it — I’m sure they didn’t manufacture it.

Automotive USB power adapter

After driving two and a half hours a week ago starting with a half charge on my BlackBerry, plugging it in midway through the trip, and arriving to have the BlackBerry finally shut off its radio due to depleted charge; and due to being in the presence of Cort; I decided it was time to see why the adapter couldn’t provide enough charge for the BlackBerry.

Inside the Power Adapter

Sample step-down circuit using RT34063APS DC-DC converter

(more…)

Monitoring Battery Voltage

Saturday, February 12th, 2011

Battery and voltage regulator schematic

Hey, real EE types out there, is there any reason I can’t monitor 12V battery voltage using a simple voltage divider into an A/D input of a microcontroller that’s powered by a voltage regulator on that same battery?

This seems straightforward, but I ask because there seem to be a lot of fancy circuits and devices out there for monitoring supply voltage. It seems to me they all revolve around monitoring the device’s own VCC and where to get a reliable AREF when you don’t trust your own supply.

In the case of monitoring a battery voltage that will always be much higher than the dropout of the voltage regulator powering the microcontroller which generates its own AREF, I can’t think of any reason to get fancier than this.

I would Just Do It but I don’t have a good test setup for this and I’m getting ready to commit it to a board layout.

Temperature Deviation Alarm Board for PID Crockpot Controller

Friday, February 11th, 2011

After assembling my PID crockpot controller, I successfully cooked a couple of medium KC strips at 60°C. When I tried to cook medium-rare at 55°C, though, I kept finding the temperature at 59°C. Not believing that I’m destined to eat medium steaks for the rest of my life, I want to fix this.

My first guess about what’s happening is that the crockpot is well-enough insulated that the controller’s longest delay for how often it turns on the heat is still too short. If so, I may get better control using the crockpot on its (dumb) low heat setting, which could be activated more frequently without driving the temperature as high.

PID crockpot controller with temperature deviation alarm LEDs

Regardless, if I can’t trust the controller to control, I need a monitor external to the controller to let me know when the temperature has gone out of range so I know I don’t yet have a satisfactory system. Although the immediate problem was overheating, I should also like to know about undertemperature problems as well. Happily, the controller has temperature deviation alarms; but less happily, they are momentary and only show when the temperature is currently out of range. Enter the alarm latch.

(more…)

Transistor-Based Variable Current Drive for LED Calculator

Monday, September 6th, 2010

I’ve put off working on my LED calculator project for far too long, at first trying to find the right handheld case to put it in and then later hoping to be able to manufacture a case myself. I’m not having any luck with that right now and if I keep waiting I’ll wait forever; so I’m resurrecting the project with the intention of selling it as a kit sans case.

The idea is to expand on a simple LED tester by allowing the user to plug in an LED, dial in the LED brightness, and then read information on an LCD showing the LED voltage drop, the current current, and the value of current-limiting resistor to use in a target circuit.

A microcontroller determines this information by measuring the voltage drop across a series current-sense resistor to calculate the current and measuring the voltage drop across the LED to calculate how much voltage will drop across the current-limiting resistor in the target circuit and what that resistor value should be.

Variable Resistor Drive

LED calculator drive circuit

Until now, all of my prototyping has used a variable resistor in series with the LED to set the current. After subtracting the LED’s forward voltage drop from the supply voltage, the variable resistor dominates the resistance of the remaining series chain (which includes the current-sense resistor), thereby setting the series current.

LED calculator prototype with direct potentiometer drive

This does give control over the LED current and brightness, but the problems with this method are:

  • A small-valued potentiometer doesn’t provide enough resistance to dial down to low enough LED currents. For example, a 1K pot with the circuit running on 9V won’t deliver less than 6mA, depending on the LED color (and voltage drop); and modern, high-efficiency LEDs are surprisingly bright at 6mA.
  • A large-valued potentiometer has an extremely non-linear current response, with all the “action” at the very end of its rotation.

Here’s the response of two different LEDs with a 10K potentiometer:

Position Green LED Current Blue LED Current
0 1mA 1mA
1 1mA 1mA
2 1mA 1mA
3 1mA 1mA
4 1mA 1mA
5 2mA 2mA
6 3mA 2mA
7 4mA 3mA
8 5mA 6mA
9 34mA 21mA
10 100mA 89mA

Very slow response until near the end of the potentiometer’s rotation, at which point the response is so rapid that it’s very difficult to control
And of course this makes sense, as it’s the hyperbolic curve of I = V/R.

Transistor Drive

Last week I started looking at improving the range and linearity of the LED current. I’m not looking for a perfectly flat response curve nor for a true constant-current drive; I just want a somewhat better response. What came to mind was this simple PNP transistor circuit — actually an even simpler version without R1 and R3, but I’ll explain their purposes in a bit.

Transistor LED current control circuit

The theory is that R2 (or R1 + R2 + R3) acts as a voltage divider across the power supply, linearly setting a drive voltage. R4 (nearly) linearly turns this voltage into a current sink across the PNP transistor’s emitter-base junction; and because R4 >> R2, R2 presents a “stiff” voltage source to R4, meaning we can largely ignore R4′s effects on the voltage division.

Thus R2 provides (nearly) linear control of the emitter-base current. In the common-emitter configuration, the PNP transistor amplifies the current by the transistor’s β (about 150-200 for a small, general-purpose PNP like the 3906) for a correspondingly higher emitter-collector current

IEC = β IEB

which goes through the LED and the sense resistor, providing (nearly) linear control of the LED brightness by turning R2.

Well, that’s the theory, anyway. This weekend I dug out the prototype and built up the transistor control to test it in practice.

LED calculator prototype with transistor current drive

(70s decor courtesy Radio Shack.)

The first thing I noticed was a section at the CCW end of R2′s travel in which nothing happened, because R2 wasn’t providing more than the transistor’s cut-in voltage — that is, although VB was less than VE, it wasn’t enough less to overcome to emitter-base forward voltage drop and bias the transistor down into the active region.

I tried installing a small-signal diode “above” the potentiometer so that VB would always be at least .6V below VE and eliminate R2′s dead region, but the diode’s forward voltage drop was a little too high (it did too good a job) and the resulting minimum LED current was a little higher than I liked. I settled on adding R3 in that position, selecting 68Ω as a value that worked well with both traditional and high-power / high-efficiency LEDs and with both 9V and 7.2V supplies.

With a 9V supply and R3 = 68Ω, I tried three different values of the base resistor R4.

R2 Position R4 = 10kΩ R4 = 22kΩ R4 = 47kΩ
Green Blue Green Blue Green Blue
7:00 0mA 0mA 0mA 0mA 0mA 0mA
8:00 0mA 0mA 0mA 0mA 0mA 0mA
9:00 8mA 7mA 3mA 2mA 1mA 1mA
10:00 30mA 30mA 15mA 13mA 7mA 6mA
11:00 46mA 42mA 24mA 22mA 13mA 11mA
12:00 56mA 47mA 34mA 32mA 17mA 17mA
1:00 60mA 48mA 42mA 40mA 24mA 22mA
2:00 62mA 49mA 49mA 44mA 29mA 26mA
3:00 62mA 49mA 53mA 46mA 32mA 30mA
4:00 63mA 49mA 55mA 47mA 34mA 31mA
5:00 63mA 49mA 55mA 47mA 34mA 32mA

The table shows a similar effect at the other end of R2′s travel in which the LED current was pretty well maxed out and not increasing any further. I think I was hitting the knee between the transistor’s linear region and saturation, meaning increasing IEB was no longer increasing IEC. Experimentation gave me R1 of 200Ω keeps the transistor pretty well out of saturation and gives a satisfyingly more-linear response than what I measured here.

The 0mA readings at the beginning of the table, by the way, are a bit deceptive — some of my test LEDs are actually lit in that region. I’ve updated the Arduino code to show tenths of a milliamp when the reading is below 10mA, and I can see LEDs glowing with as little as .1mA. Probably not a value of interest for most people, but it could be effective for making flickering gas lamps for model railroads.

Choosing Values

R4 = 22kΩ looks like a pretty good compromise between providing a near-linear response and covering the range of LED currents I expect most people would be interested in testing, so I’ve tentatively settled on it.

I’m still fiddling with values to give good performance at both 9V (alkaline battery) and 7.2V (NiMH), because I use rechargeables almost exclusively and want to make this work well on rechargeables to encourage other people to do the same. The problem is,

Vsupply = 7.2V
VEC ≈ .8V
Vblue LED ≈ 3.5V

VR5 = Vsupply – VEC – VLED = 7.2V – .8V – 3.5V = 2.9V

ILED = IR5 = VR5 / R5 = 2.9V / 100Ω = 29mA

In other words, running on a 7.2V battery, with the transistor saturated, a blue LED with a 3.5V forward drop maxes out at 29mA; and it gets worse with a battery that’s not straight out of the charger and some white LEDs with a higher forward voltage drop. I’d like to enable people to test up to 50mA, to cover high-brightness LEDs, so I’d like to push this maximum current a little higher.

R5 = 68Ω gives ILED up to about 42mA, which isn’t as high as I like; but the tradeoff is that a smaller R5 gives me a smaller voltage range to sample in the A/D converter, hence lower resolution for the display. 68Ω seems like a good compromise. And I’m already thinking about a DPDT switch to change the resistor and alert the microcontroller about battery chemistry.

Gold Phoenix for EasyBright PCB Manufacturing

Monday, May 24th, 2010

Two and a half weeks ago, I finished up the CAM files for my first set of EasyBright LED driver PC boards and sent them off to have boards made.

PC board order from Gold Phoenix

While shopping around for board houses, I had narrowed my choices to two. Here’s how I made the final selection of Gold Phoenix — not, as it turns out, whom I thought at first I was going to pick.

(more…)

VGA Dongles for Mac Mini Headless Booting

Sunday, August 23rd, 2009

At work we’re placing Mac Minis as network appliances into backbone wiring closets, in part to decentralize DHCP and DNS services so they survive partial failures (or scheduled outages) of the network any time the local backbone drop also survives, in part to run local proxy service for WCCP because our backbone doesn’t support GRE.

We reinstall the Minis with OpenBSD; and whether this would be true with OS X on them or not, at least with OBSD, they don’t like to boot without a monitor connected. A few weeks ago I made a batch of VGA “dongles” to trick the Minis into thinking a monitor was present.

VGA dongles, sloped pyramid

(more…)

Constant-Current LED String Driver

Saturday, August 1st, 2009

As mentioned previously, I was contacted this spring by Amanda McClellan of Coordinate It about an LED design project. Amanda is a civil engineer turned wedding planner and needs about a hundred lighted paper lanterns for a large reception on Labor Day weekend.

There don’t seem to be (m)any LED lighting solutions for paper lanterns, and Amanda was interested in the lower power consumption of LEDs without having to go around to each lantern to e.g. hook up LED throwies. She also indicated a willingness to advise me on packaging the system/solution to sell to other event planners out there, which sounds pretty good to me.

LED string driver, all LEDs on

Between distractions, I’ve been working on a design for her. The prototype looks okay, and I think it’s about ready to send out to have boards manufactured.

Specifications

  • Make LED drivers to power 10 lanterns with 2-3 white or warm white LEDs each, with some combination of parallel-series wiring.
  • Cost should be not more than $2.50 per lantern, or possibly somewhat more if the system is completely reusable.
  • Use constant-current drive, for the initial application in the 20mA range but ideally expandable to as high as 100mA.
  • Ideally make the string(s) dimmable through optional analog and/or PWM input — but full-brightness when no dimming input is present.
  • For Amanda’s use, pack 100 lanterns’ worth of drivers into a monolithic case for the sake of aesthetics and convenience.
  • If easily done, make the same driver boards fit into fob-sized cases for smaller applications — Jeremy’s basement, interior lighting for CNC plastic-extrusion machines, etc.
  • LEDs supplied separately. I don’t want to be in the business of soldering and testing LED strings that are going to get used by other people. It’s up to the customer to determine and meet their own LED requirements.
  • If possible, run from 48VDC source, as I have several hundred 48VDC .38A power supplies I’d love to get rid of for the right price.

Driver Selection

I looked over a lot of LED string drivers before making my selection. Here are some drivers I considered and application notes I looked through:

Given that Amanda wants 100 lanterns with 2 or 3 LEDs each, the 3-channel MAX16823 really leaped out at me. Even though some of the other drivers could support higher drive voltages hence more LEDs per string, the 16823′s three strings trump the higher voltages in the “power more LEDs per driver” category, hence providing a lower overall cost to drive large numbers of LEDs.

Because so many of the drivers have a maximum input of 40V, I gave up on using my 48V power supplies and looked for power supplies in the 24-36V range. I’m having a hard time finding power supplies in that voltage range whose price I consider reasonable, and it’s much worse for anything other than 24V, so it looks like that’s what it’ll be. I’d welcome suggestions on sources for inexpensive 24-40V ~1A power supplies, if you know of any.

With a white LED forward voltage drop at 3.4-3.6V and the MAX16823′s dropout voltage of .3-.7V, a 24V power supply could comfortably run 6 LEDs per string or 18 LEDs per driver. With 2 LEDs per lantern, that’s 9 lanterns; with 3 per lantern, it’s 6 lanterns per driver. It’d be nice to have an even 10 lanterns per driver, but I can live with this.

One nice thing about the MAX16823′s circuit is that it doesn’t require a fixed supply voltage or number of LEDs. Just leave a little headroom between your LED string series forward voltage and your supply voltage and you’re good to go. This means I can set it up for Amanda on 24V with 6 white LEDs per string, but Jeremy could use 12V with 3 LEDs per string, and someone with a 40V source wanting to power red LEDs at ~2V each could connect about 20 LEDs per string. That indifference to the details — as long as you don’t make the linear current controller sink way too much current — is really handy.

Circuit Design

MAX16823 LED driver board schematic

The schematic is pretty straightforward — some decoupling capacitors, current-sense resistors for the LED strings, and inputs for PWM dimming. Because I’d like the same board to work in a fob or plugged into a backplane in a larger case, I included dual power supply and PWM dimming inputs.

I figure if you have a large case of these (at least one I make), you’re more likely to want to dim all of the LEDs at the same time than to dim individual strings, so I used resistor-diode logic to tie the three dimming inputs together to a single dimming input pin on the backplane connector.

I also ran the “LEDGOOD” indicator output to the backplane, to invert and provide “LEDBAD” indicators on the monolithic case to show which strings are disconnected or having trouble. Having discussed it extensively with Jeremy (my first fob presale), I didn’t bother to provide LEDGOOD/LEDBAD indication on the board itself for the fob version — if you’re using the fob to power one to three strings, you can just look to see whether the LED strings are working or not.

Circuit Board

After laying out the circuit board, I tried my usual iron-on toner transfer to set up PCB etch resist, but I had much worse luck than usual and gave up. Tom McGuire graciously agreed to mill me a couple of boards at work and even provided pictures of their awesome commercial PCB mill doing its thing.

PCB mill, wide

PCB mill, table

PCB mill, cutterhead

Here are my sad iron-on attempts shown next to Tom’s awesome milled boards.

Circuit boards: Iron-on transfer attempts, milled

Tom “peeled” the waste copper from the top side of one of the boards, because he’s CRAZY.
Two milled circuit boards, one peeled

With Tinnit, verra nice.

Completed Prototype

LED string driver

I assembled this a while back and actually don’t remember for sure whether I used the hotplate or hand-soldered and used braid to soak up solder bridges. Given the lack of waste flux around the driver IC, I think I did it on the hotplate.

I intend to use standard 1206 (or smaller) SMT diodes; but these cute round SMT diodes were on hand (salvaged from something) and they fit well enough. Sadly, I couldn’t find any .203V sense voltage / 20mA target current ≈ 10Ω current-sense SMT resistors in my bin; so as you can see, I improvised.

For now, I’ve populated only the connectors I need to test the prototype, and not even with the type of connectors to be used in the production versions. I bodged this together to work on a breadboard; but the real thing will have right-angle male headers for all the connectors.

LED string driver, all LEDs on

The LEDs stay exactly the same brightness with a supply of 12-19V (as high as my slightly broken bench power supply will go),

LED string driver with LEDs shorted

and also stay the same brightness with several of the LEDs shorted out to simulate a string of fewer LEDs. Looks like pretty good current regulation to me.

Next Steps

Right now I need to get boards built quickly for Amanda, so I’ll probably order a batch of 20 boards (enough for 120 or 180 lanterns) just like this, plus silkscreen labels for the connectors. But for the fob version, I want to include a power switch; so I already know there’ll be revisions coming.

I think when the time comes, I’ll print the fob cases using my CupCake.

Availability

I’d like to sell these to anyone who wants them, and I think they’re going to come to $20-25 each by the time I have the PCB, driver, passives, and connectors. (That feels like a lot to me; but in batches of 100, I think that’s about what it’s going to be.) I’m by no means ready to take orders, but I’d take a straw poll. If you think you might be interested, drop me a comment indicating

  • likely quantity
  • PC board only, fob version, or case with lots of boards
  • configured for 20mA drive, something else, or you want to supply your own current-sense resistor
  • or “$20-25 is just way too darn much for an LED string driver”

I promise I won’t hold you to it, unless you give me answer #4. :-)

Simple LED Brightness Tester

Monday, May 25th, 2009

Back in March, I was contacted by Amanda McClellan of Coordinate It wedding planning. She’s interested in LED lighting for paper party lanterns; and although she has an engineering degree, electronics is not specifically her forte. She wondered whether I help her figure out how to drive the LEDs, and, well, you know how I feel about LEDs. :-) So of course I was interested.

The challenge, of course, is that LEDs need a constant-current drive; and it’s not easy to drive a string of LEDs at a constant current (hence constant brightness) using a simple current-limiting resistor. I’ve looking at constant-current LED driver ICs, and am close to putting together a simple but useful LED driver circuit, with intention to both open-source the design and offer the hardware for sale. More on that soon.

LED Tester

Meanwhile, as I’ve researched driver chips, Amanda and I have been talking about how many LEDs (and indirectly how many mA) it takes to light a paper lantern. She wants the lanterns for decoration, not illumination — Last weekend I assembled and shipped her a simple LED tester to allow her to try some LEDs inside lanterns and see how many LEDs and how much current she’s going to want.

My idea was to make something that could:

  • run off a 9V battery (enough to power a series string of two white LEDs at ~3.4V each)
  • allow her to vary the LED brightness for testing
  • allow her to measure the LED current without having to stick an ammeter in the circuit

LED tester schematic

Regarding that last point — ammeters have to be connected in series with the circuit under test, so the LEDs would go dark when the meter wasn’t connected. Instead, I used a 1.0Ω current-sensing resistor in series with the LED string. Across the 1Ω resistor one can measure 1mV for each 1mA of LED current; and removing the voltmeter from the circuit has no effect on the LED operation.

R1 (20Ω) is there to save things if the potentiometer is turned to its minimum value of (theoretically) 0Ω. With two 3.4V LEDs in series, the combined LED voltage drop is 6.8V and the voltage remaining across the various resistors is 2.2V (or .4V with the NiMH “9V” battery I use at home). 2.2V / 21Ω ≈ 105mA, which is way too high for a normal LED and puts almost a quarter watt across R1. Not great; but it’s a last resort instead of a dead short, not a desired operating mode.

The Board

PC board with iron-on 'silkscreen' layer

I used the laser printer and household iron to do toner transfer for etch resist, and also to transfer the “silkscreen” on the top side. I get best results on the silkscreen side peeling off the paper while everything is still hot, and I was particularly pleased with the transfer quality here. Not perfect, but it’s pretty legible for 70-mil text.

LED tester PC board

Here’s the populated board, sized the same as the battery it runs from. In retrospect, I should have moved the potentiometer further down or the LED connector further up, but I was intending to use a right-angle connector that would lay flat on the board. Couldn’t find any in my parts bin when I went to assemble it.

The test points at the bottom are wire loops sized to friction-fit my voltmeter probes. They’ll also work well for clips or gator wires.

In Use

LED tester

Here it is in action with a couple of amber LEDs plugged in. They don’t look bright enough to me — but letting Amanda determine that is the whole point of this exercise. She’s the expert on event planning; and it’s her assessment that matters, not mine.

Paper lantern with LED lighting

This is two warm white LEDs inside a paper lantern. Under normal room lighting, you can tell there’s light inside, but it doesn’t look dramatically lighted and diffused as I think one would want it to.

Paper lantern with LED lighting in the dark

In evening darkness, the lighting is more noticeable. And in spite of having set white balance carefully before taking the shot, my old camera changes the warm yellowish white light into cold blueish white light. Ach, what can a fellow do. Looks good in person, though — if not necessarily bright enough (to me).