LED Sign has a purpose!

The single character LED sign I had been playing with now has a purpose! Shortly after discarding several ideas of having it as a serial display for PC/Server status, or hooking it up to the internet and a webcam, I came up with an actual useful purpose. The sign can be a clock! I have two ‘modes’ planned; traditional numbers and binary. All geeks love binary clocks, but most of us are lazy and would rather read regular ‘ol numbers.

To facilitate the role as an clock, I had to redesign the circuit quite a bit. Two new ICs were added, allowing the LED Sign to keep time, and providing some much needed storage.

led matrix sign clock rtc microcontroller schematic

The first of the new ICs is a Real Time Clock. Because I’m cheap, I chose the M41T80 from ST Micro. It’s an inexpensive clock, similar to the Dallas DS1307 but lacking a few minor features. First, the clock has no power-on reset detection. It just starts up as soon as power is supplied. The Dall 1307 has a stop bit which gets set if the clock experiences a POR, so the firmware can test if the clock needs to be initialized or not. The T80 datasheet mentions some registers may get set to default values on power up, so I’ll have to read it a few more times to see if there is a way I can check for a POR. Second, the T80 has no support for a separate backup battery. Instead, ST recommends you place a diode in series with the clock, and use a large capacitor to provide backup power. Last, there is no automatic leap year / leap second correction, oh well!

The second IC is a 16 kilobit serial eeprom, similar to the Microchip 24C16, I chose one from Catalyst semiconductor due to lower costs. The eeprom is arranged as eight banks of 256 bytes each. The chip contains a 16 byte write-buffer, I’m not sure if it can cross a bank boundary or not, I’ll program my firmware assuming it can not. The eeprom will be storing character strings related to operation of the LED Sign as a clock, as well as user programmed messages and possibly simple graphics.

I’ve also added some micro switches for adjusting the clock and changing settings, also a 32.768kHz crystal was added to providing the timing source for the RTC.

pcb layout led sign clock

At this point, the layout of the printed circuit board has become pretty complex. I tried making one of these at home, but didn’t have the patience to exactly align the top and bottom layers of my press and peel sandwich. So, I decided to try a pcb prototyping house. There are a lot of board houses to choose from, many of which cost an arm and a leg. All of the domestic board houses are ruled out, I’m sure they do a fine job, but they cost too darn much. I settled on Spark Fun’s BatchPCB service. They’re not the cheapest board house out there, but their cost is fair. They include a lot of features most other board houses charge extra for, like double sided silkscreen and solder mask, 8 mil pitch and spacing, 20 mil holes, etc. I placed my order on the 6th, and had the PCBs by the 22nd. All the time in between, by mind set to wandering, and I made some POV toys. Once the pcbs showed up, I incurred another delay. Turns out I hadn’t ordered my RTC chips yet! So, another few days wait brought goodies from Mouser (man they are quick, and inexpensive!)

batchpcb led clock circuit board

The boards from batchpcb look awesome. Nice bright green solder mask, tinned pads and holes, smooth clean edges. This is the ‘top’ side of my led sign. There are a few passives on this side, along with the two new ICs. This side is covered by the LED matrix once the board is fully assembled. Don’t mind the flux smeared everywhere – I did clean it off before soldering the matrix down.

led clock circuit board

The bottom of the board contains the PIC processor, mosfet column drivers, a crystal for the clock and some microswitches. Pin headers for power and programming the microcontroller have also been installed. The module is a bit thick at this point, thanks to the socketed IC and the pin headers. On the finished version, I’ll solder the IC straight to the circuit board, and probably use wires instead of a header to supply power.

led sign clock done

The firmware is in the early stages right now, so my next post on this subject will try to cover whatever features I’ve decided on. Right now I know I want a few things:

1. Scroll the time
2. Occasionally scroll the date
3. Occasionally scroll short messages, either randomly or programmaticlly
4. Support some sort of software brightness control

I’ve made some revisions to the design since I had these boards fabricated. One big oops I made was forgetting the pull-up resistors for the i2c bus! Luckily there’s plenty of room on the board, and both i2c lines ran near the Vcc rail. So a little quick scraping action to peel back the solder mask and presto, new lands for 0603 sides resistors. I’ve also added a diode and big capacitor for the RTC’s backup power.

I hope to work on the firmware more this week, so I should have more details about how the clock works next time!

EDIT: Added a quick video of the time scrolling

LED Matrix Backpack

I had purchased some huge (2″) 5×7 matrix a while ago, as part of my led sensor research. They’ve basically been banging around the lab since, getting pins bent and such. So this past weekend, I decided to put them to some other use. Their pin layout is sort of weird, it doesn’t match up with a breadboard at all (one of the reasons they never made it into the led research). So, I decided to make up some back-packs for them, or is it a carrier board? Anyway, the board features one 5×7 matrix, one pic 16f737, a few transistors and some data connectors. The board provides two means of serial communication; asynchronous rs232 at 19200 bps, or synchronous i2c at 100kbps. A second connector provides power and ICSP pins.

5x7 led matrix backpack

This project has no practical application as of yet. The main reason I made it was to improve on my double-sided pcb fab techniques. This time I found using point to point traces instead of a large “pour” made things work a lot smoother. I used the ‘sandwich’ method with press ‘n’ peel blue. Roughly 1.5 min per side.

5x7 serial led matrix backpack

One thing I had to keep in mind while doing this layout was accessibility to solder both sides, since I can’t through plate my own vias. So things had to be laid down in specific order. I soldered the vias first, using some cheap resistors with very fine leads as my conductors. The method involved sticking the resistor into the via, with just a bit poking out the other side, then bending the resistor 90 degrees and holding it to the board. Then a quick dab of solder onto each joint set them in place. Next, straighten out the resistor leads, and trim them off. Another quick few dabs with the soldering iron and each one was fully connected. Next came the smt parts. The switches were rather easy, but those blasted little 0603 capacitors always give me grief. I tin both pads, then apply a bit more flux as “glue”, then try to reheat one of the pads, to reflow the solder onto the part. It works great with 0805 and larger parts, but the little 0603 usually gets sucked onto the tip of the iron by the surface tension of the solder.

One hard choice I had to make was whether to solder the chip straight into the board, or use a socket. I opted for a socket, which meant a harder time soldering the “top” layer. Luckily, I was able to dig up some 14 pin machine pin sockets, and thanks to the machine pin itself, they stand proud of the board a little, just enough to sneak in with the soldering iron.

For whatever reason, I decided to solder the led display next, leaving the connectors for last. I partly wanted to see which side of the board the connectors would look better on… I think next revision, they’re going on the bottom. During assembly of the connectors, I nicked the display a couple times with the iron, oh well!

Right now, the display is flashing my initials. Oh, here is the schematic, nothing exciting really!

quick video:

Big Ugly SMPS

Usually my designs strive to create tiny boards, and I often obsess for days fine-tuning, shaving a fractions of an inch at a time. However, this design goal was get it done, get it working, then make it pretty.

I’ve been trying to build a switcher to provide a portable power source for PDA’s, cell-phones, etc. Not just enough to trickle charge said gizmo for hours, but to charge it as fast as possible, like the cradle or wall plug would do. This requires quite a bit of power. Packaging portable power is proving very tricky. There’s two main design goals I’m trying to meet. My primary goal the past week has been recharging the power-source, and the easiest way to do this is parallel cells. There’s oodles of charge management chips out there designed to handle charging of single lithium-ion cells (or parallel cells). The complexity knob gets turned WAY up once you start talking series cells. So rather than spin my wheels on this problem, I chose to move forward with goal number two. My secondary design goal is to get the power out. Putting the cells in series opens a wide door for easy to use switchmode converters and controllers. I’ve got a bin full of samples from all the big names, and I’m close to settling on a chip. First to prototype is the TPS5430 from Texas Instruments. This chip claims to have a three-amp switch on board, and it’s pretty easy to use. The switcher is internally compensated, eliminating an RC network often needed to compensate high frequency switchers. The 5430 comes in fixed voltage models, but I went with adjustable this time.


tps5430 schematic

Using TI’s SwiftDesigner to generate a reference design, I drew that up in Eagle. Their reference design specified solid tantalum capacitors, which have properties that lend themselves well to switchmode applications. However, having priced 100+ uF tantalum caps, I’ve decided to use aluminum electrolytic instead. To offset some of the short-comings of aluminum caps, I have connected several in parallel. The main disadvantage is ESR, and wiring caps in parallel cuts the ESR dramatically.

tps5430 printed circuit board

Loosely following TI’s reference layout, I came up with this design. I drew the design using the top layer, and ended up flipping it over when I assembled it. It doesn’t really make a big difference, just as long I remember to solder everything in a mirror image of what’s shown on the screen. For example, the screen shows the input stage on the right, but on the prototype, the input stage is on the left. The reference design called for a single 100uF solid tantalum capacitor rated at 25 volts (I spec’d 14v as VinMax). It also called for a 47uF tant as a bypass cap for the IC. So instead, I went with two 100uF 25v electrolytic caps and one 47uF 16v cap. I realize 16v is cutting it a bit close, but it’s all I could come up with, and this is only a first pass. The output stage called for a single 220uF 10v tant, instead, I drew room for three 100uF caps but only installed two for now. The chip needs a bootstrap cap to help it start-up with low input voltages. The datasheet called for 10nF, so thats what I used. The voltage divider is a 10k resistor coupled with a 10k pot. A resistor and LED were added to show “power on”. The three pin terminal at the bottom is tied to the enable line. Enable should float for normal operation and be pulled low for shutdown. I used a big ‘ol coil I had laying in the parts bin, it was labeled 22uH but the actual inductor is not marked. Looking at the size of the bobbin and heft of the wire, I’d say this inductor can handle some serious current. A three amp schottky diode completes this bit of kit.

With one set of fingers crossed, I hooked the switcher up to a wimpy 200mA 12v wall-wart, used for charging a screwdriver. To my relief the LED came on, nothing started smoking, and the ammeter read 10mA on the 10a scale (later I re-read 13.59mA on the 20mA scale). The datasheet claims 3-4mA of quiescent current, so the switcher is taking 10mA at 12v to supply 20mA at 5v. Although I haven’t done the algebra in the datasheet, comparing watts in to watts out puts the efficiency in the not-bad to pretty good range. (100mw / 120mw = 83%). Better still, when I connected my Dell PDA to the switcher, it was able to supply as much current as the Dell could ask for, without raising above ambient temperature. With a low internal battery, cpu set to 400mhz, external wifi card inserted, backlight full-on, the Dell peaked at 1.1 amps. I left it laying on the bench and watched a movie for a few hours. Coming back, the dell was completely charged, and the output had dropped to about 170mA.

My next goal will be to miniaturize this circuit as best I can, hopefully to fit it into an altoids tin which holds my lithium cells so very nicely.

Switchmode LED Driver

This is the second incarnation of my tps61040 based LED driver (here and here). As I wrote just a few posts ago, I’m trying out a new layout strategy to make my gizmos more breadboard friendly.

The 300 mil (thanks Dave) DIP16 package proves to be very small, so small I had trouble trimming it completely while depanelizing.

tps61040 dip16 boost switchmode led driver

Another problem I ran into is a high voltage output cap. Seeing that this circuit generates upwards of 28 volts, the typical inexpensive ceramic or tantalum capacitors just don’t have the dielectric strength to work well. So, that leaves few options. Option one involves parallel smaller value high voltage caps. I ordered a bunch of 50v 1uF 0603 caps, so we’ll see how that goes. Second option is electrolytic. Sure I’ll incur some losses in the capacitor, dipping the efficiency a bit, but hey, it’s not a perfect world. I found some 10uf 4.3mm x 4mm caps that should do nicely. Third option is expensive ceramic … weighing in at $1 to $5 ea, these caps must be made of lunar rock. I have not ordered any of these, but I will look into harvesting some from dead / old electronics.

Notice the cute little inductor. That baby is 10uH, 1 amp, shielded and only 6mm square. Designed for high power applications, it has a generous saturation current, and rather low resistance. Even better, it’s only like 2mm tall, and to top it off is the cost; 59 cents each at quantity 10. In case you’re looking for an easy to use and flexible inductor, the digi-key catalog number is 587-1707-1-ND.

This time, in order to have a simple board layout, I chose to permanently enable the chip, so they’re be no dimming on this version. I’m not sure if the chip supports a hot load disconnect, I did manage to kill my earlier prototype somehow, one of the output leads broke off the pcb while I was holding it, in a dark room. After repairing the damage, I only get a very low output. Perhaps my capacitor or diode was fried.

tps61040 dip16 boost switchmode led driver

Here are the breadboard compatible pins. The three pins are the output area, with the one inboard pin being the led sink, where the current sensing resistor is attached. This layout required two ground pins, and an external jumper to connect them. I’ll remedy that in the next iteration.

This is the little critter doing it’s thing. Do you like that battery brand? SHAZZAM – it just screams power. I bought a BUNCH of these at a traveling tool sale show, 99 cents for 16. They’re not half bad for light loads, this little switcher sucks ’em dry in a mater of hours however!

Fun new pcb layouts.

Testing SMD devices on a breadboard requires some sort of carrier. You can use the dead-bug method, affixing the smd to something, and using bits of wire to solder its tiny pins to larger ones that fit into a breadboard. Another method is using SMD converters, which is fine, but really limits what you can do with the chip, it’s not very portable, and it takes up a LOT of room for very little gain. So, I decided to try re-drawing some of my designs to fit in the footprint of a DIP style package, but be more or less self contained. These self contained modules will work on a breadboard, protoboard or where-ever.

Today’s theme is switchmode power supplies. To start, here is a ‘single cell’ to +5v boost regulator, based on National LM2698. This circuit should accept as little as 2.2 volts and provide a solid five volt output. With 3.6 volts in, it should provide over one amp of current. Thanks to the large capacitors, this module resembles a 28 pin ‘wide’ dip, approximately 600 mil across.

This module is also a ‘single cell’ to +5v boost regulator, based on the petite TPS61040 from Texas Instruments. The chip claims to support voltages as low as 0.9v, but I plan to use it with a single 1.5v AA. The amount of current it will provide is somewhere around 100mA. It can provide up to 500mA using a higher input voltage. This module resembles a 20 pin ‘narrow’ dip, or approximately 300 mil across.

Lastly, this is the smallest design yet. This module resembles a 16 pin ‘narrow’ dip. Also based on TI’s tps61040, this switcher is configured in constant current mode. My prototype design sources 50mA at 23 volts into a string of white LEDs, powered by two AA batteries.

Breakout Board

As part of my mintlite project, I need to deal with an SO8 package battery charger. So I whipped up a breadboard adapter aka “breakout board” that converts the tiny chip into a 600 mil DIP package. Another battery charger I have is even smaller, packaged as an SOT23-5 part. The breakout converts that tiny grain of rice into a 300 mil DIP package.

Here’s a snapshot:

Cadsoft Eagle BRD files:

SO8 to DIP8

SOT23 to DIP6

Preassembled, these adapters can cost upwards of $6 ea… as “kits”, they’re $1-2 … so here ya go, it’s like printing money!

DIY PCB Fab Pictures

As sort of a follow-up to my Inket Photolithography article, I have some more pictures of the process, from start to finish.

paint shop pro pcb panelize

Using paintshop pro, I take individual PCB layouts and combine them into a composite panel, which is the exact size of the PCB I’m going to expose. Often I’ll repeat the same design a few times, in case there’s some glitch in one of them, or the board is damaged during the depanelizing process. I like to start with a black background for the panel, to mask out any unused sections of copper… this helps cut etching times and helps save the etchant life.

The inkjet transparency comes with a sheet of white paper attached, to protect the transparency and give the printer something extra to grab onto with the feed rolls. It takes about 30 min for the ink to fully dry.

This is my darkroom which also doubles as my house’s furance room. The exposure system is two cheap-o under cabinet lights, with “daylight” bulbs loaded in them. The timing is completely manual and is just an extension cord I unplug when time’s up.

After exposure, the PCB takes a bath in a sodium hydroxide solution to develop the resist layer. Within a few minutes resist that was softened from exposure to light is dissolved away. I rinse the board in hot water (per manuf. spec) to check for complete removal of the resist – sometimes a thin film remains and another dip in developer is required. After all is well, a rinse in cold water sets the resist and halts the developing process.

pcb inket transparency

Here is the transparency used to expose the photosenstive printed circuit board. It is actually laying on top of the board which as already been etched.

diy pcb fabrication

The resist is a blue color when it’s “active” and turns green after it has cured, and is no longer photosensitive.

diy pcb fab protective equipment

Protecting eyes, ears and lungs is a very important step.

diy pcb fab drill dremel carbide

My drilling station is a basic dremel mototool (single speed) mounted in a drill mini-press. I have two 20 watt halogen lamps to illuminate the panel, one is a flood/fill light, the other a tight focus spot right on the cutting head. Using expensive aluminum titanium oxide coated solid carbide drill bits (designed for drilling fiberglass and non ferrous metals like titanium), the dremel easily pierces the board, spinning at 35000 RPM.

diy pcb fab drilling

Lots of holes!

diy pcb fab protective equipment

Make sure your safety gear is still on!

diy pcb fab depanelize

A visit to the impromptu depanelizing saw aka a Skill Jigsaw turned upside down and secured in a bench vice. With the blade installed backward, the foot of the saw provides a nice table for resting the panel on. This arrangment will gladly take a finger or at least mess you up, so make sure you have no distractions and always know where your fingers are while the blade is moving. Sometimes you’ll end up with pieces that are pretty small, but it’s not worth the risk of serious injury trying to do them on the saw… scoring both sides of the pcb with a drywall knife should let them snap cleanly… also I’ve heard large sheer-type paper cutters work.

diy pcb fab depanelized

The end result, a pile of little PCBs.

Sometimes the saw doesn’t leave the cleanest edge or your line is a bit wavey – a visit to mr belt-sander will clean things up nicely.

editors note: some of the pictures for this article didn’t come out as well as I had hoped, or have yet to be taken, so the [image missing] tag is a place holder to remind me to reshoot.

TPS61040 Constant Current Driver

I’m already up past my bedtime, so just a few pictures for now. Write-up coming soon!

Specs: Input 2v to 6v DC … Output constant current 50mA up to 28v DC
Efficiency: Initial measurements, somewhere around 75%
Chip Texas Instruments TPS61040

tps61040 boost converter constant current led driver
size comparison, american quarter dollar piece


circuit detail – design is one-sided PCB with two through-hole jumper wires and the diode, everything else is smt



twin 1uF tantalum capacitors … the output capacitor I had originally selected was limited to 16v, so this was the best I could come up with on a Sunday. Note the top of the coil is missing – these things are fragile!

PCB Photolithography and Inkjet Printers

I may be easily amused, but I’m not easily impressed.

Everything I have read about pcb prototyping using photolithography claims I needed to use a laser printer and some sort of transparent or translucent medium. Armed with this knowledge, I used acetate, or overhead projector transparencies. The film claims to be designed for laser printers and copiers, but it still distorts some when printed on. Anyway, the problem with my laser printer is toner pin-holes. For whatever reason, the output would have these little holes everywhere, and these little holes would swiss-cheese my traces and ground plane pours. This forced me to use thick traces, which would still get swiss cheesed, but generally retained enough composure to be electrically conductive. The pin hole problem seems to be getting worse … the last test I performed on my printer as an exposure test of varying width lines and different sized holes and pay layouts. In general, the performance was pretty bad and was not acceptable for more advanced designed I wanted to make, involving very small SMT components.

So, I tried printing the same exposure test, on paper, to my inkjet printer. The results were stunning. The lines were sharper, the holes clearer, the pads better defined. What a difference it makes going from a 600 dpi laser to a 4800(?) dpi inkjet. So, I felt it worth the risk, and decided to run my exposure test with the inkjet. Using some inkjet transparencies (they’re kinda coated with some type of fiber?), I printed my patterns. I exposed my board, and then developed it… the results were WOW! Of course, I messed up a few things with this first run, mostly I let the light cook for too long. So in the best un-scientific manner possible, I changed a bunch of variables at the same time, and tried another pass.

photolithography inkjet pcb

That is the result! … Please ignore the greasy thumbprint on the left side of the board – that was acquired after etching, and has no effect on anything aside from mild embarrassment on my part. My setup was fairly simple. I printed my design at best quality, monochrome mode onto a transparency. Next, in my darkroom that doubles as a furnace room, I laid down my PCB, emulsion up, then the transparency, then a sheet of 1/4″ plate glass. About 4″ above that, I have two 15 watt under cabinet lights, each loaded with a GE Daylight bulb. The lights are connected to an extension cord, so I can turn them on and off together. After making sure everything is lined up, I start my stopwatch and plug in the lights. After letting it cook for eight minutes, I turned off the lights and slid the pcb into a waiting bath of developer. The developer had been sitting for about a day, so it was a little slow. I left the board sit for about 2 min, before turning on the room lights. As the emulsion started to dissolve, I could see the results were good, real good! With the room lights on, I stirred the developer and lightly brushed the pcb using a foam brush (as recommended by the manuf.) My image grew sharper and sharper.

After I was sure all the emulsion that needed to be gone was gone, I rinsed the board and slid it into a waiting bath of ferric chloride etchant. A few min later, I pulled the pcb out, to make sure all the copper had turned pink. If the copper is not pink, it means some emulsion remains, and its time for another trip to the developer. Fortunately all the copper was pink, no problems here. I let the pcb soak for about 30 min while I had some lunch. After lunch, and without washing my hands i might add, I extracted the PCB from the etchant and rinsed it off. The results are excellent.

So, no longer will I shy away from tiny SMTs, since I can now lay down traces as thin as 8 mils without issue (determined by the earlier exposure test). Granted there were three flaws I had to fix on this board, I suspect they were caused by either dust on the transparency or those fibers that are embedded in the plastic. A quick touch-up with the sharpie solved them without a hitch.

Next stop, de-panelize with the PCB “suicide” saw.

pcb saw depanelize