Saturday, February 19, 2011

LED Visor, MSP430 (Final Build into Visor)

This post is the fourth in a multi-post set: 

After working out the bugs in my software and PCB, I build the PCB into a visor.

I mounted the switched on the back of my PCB. You can see them sticking out of the left side of the visor below. The top switch changes the speed that the pattern is run with, and the bottom switch changes to a new pattern.
The PCB was mounted in the headband, along with a 9V battery.  The regulator can run from about 3.5V up to 18V, so switching from a 6V system (4 x 1.5V AA) to a 9V was not a problem.

 As you can see here, my sewing leaves a lot to be desired. I also ended up using hot glue to attached a 100uF Cap when I ran out of the correct package size ones I'd designed with.
 This was before I'd discovered conductive thread, so I wired up the LEDs individually with a stiff thin wire.  I then sewed the wire back to the visor to keep it from moving around.

Thanks for looking!

Saturday, February 12, 2011

LED Visor, MSP430 (Software)

This post is the third in a multi-post set: 

For this project I decided to use the Free version of Code Composer Studio, provided by TI. I have been working with version 4.1.

CCS provides a nice Eclipse based editor with a integrated complier and debugger. It installed without issues on my windows 7 64 bit machine.

I broke my software up into several pieces:
  • Main: The section which pulls everything together.
  • Standard.h: A section for constants, macros, typdefs, etc. which are shared across the entire project.
  • Button driver : This code de-bounces button presses, and sends back button press and button released events.
  • Led Driver: This is really a serial driver. It sends out data to the CAT4008 LED driver device.
  • Led Patterns: Code which generates different patterns for the LED. Some patterns are hard coded, and others are functions.
In order to save power, I designed the software to only drive 1 LED at a time. In order to make it look like more then 1 LED is on at a time, we use persistence of vision.

The software can be downloaded from a google code repository found here. The Source file are:
  • Main.c
  • Standard.h
  • buttons.h
  • buttons.c
  • LedDriver.h
  • LedDriver.c
  • LedPattern.h
  • LedPattern.c
The other files are the Code Composer Studio project files.

When running, the code :
  • scans for button presses
    • If SW2 is pressed, the code will change the pattern being run.
    • If SW1 is pressed, the speed at which the code is run is changed.
  • One the LED pattern is determined, it is clocked out to the LED driver.
  • The MSP430 goes into a sleep mode until the next clock interrupt starts the cycle again.

Wednesday, February 9, 2011

LED Visor, MSP430 (Schematic Capture, Layout)

This post is the second in a multi-post set: 

Having decided on a schematic, I then went ahead and installed KiCad. While it's outside the scope of this write up, I needed to create a few custom parts in order to get this to work. If you want to do this, I'd suggest following the write up on the found  here.

I had now gone from this:

To This:

Parts List is as follows (with links to digitkey):
With Schematic capture complete, I moved onto layout. I wanted to try and keep my PCB small, so it would fit in a hat, tie or visor. I decided on about 2 inches by 1.5 inches.

The layout took me about two days, though a good part of that time was getting used to the tool. I had used professional layout software before, so the process was familiar. 
One of the cool features of KiCad is the ability to render a PCB in 3D. In order to do this, I had to install Wings3D.

The last step was packaging up the data for BatchPCB. I found some info in the sparkFun form, which I used to setup my own file.

My settings were as follows:
  • Drill Units: Inches
  • Decimal Format: Suppress Leading Zeros
  • Precision: 2:4      
  • Drill Origin: Absolute
  • Drill Sheet: None
  • Drill Report: None
  • HPGL Plotter Options: 20cm/s - Pen Number 1
  • Mirror Y Access: Unchecked
  • Minimal Header: Checked
I then created the collection of files need (copper layer top, copper layer bottom, silkscreen top, mask top, mask bottom, components) as documented by batchPCB and uploaded them.

In a few hours, I got an e-mail back that I'd passes the automated test, and I ordered 3 PCBs. 16 days later I received my PCBs!

Sunday, February 6, 2011

LED Visor, MSP430 (Concept)

This post is the first in a multi-post set: 

This project actually came before the LED jacket. It also was an experiment to try and see what the process would be like to work with the MSP430 development system at home. I've developed several professional products for the MSP430, but all of them used big expensive compilers with the pcb layout done by our layout team.


 First off, I decided I wanted to put some LEDs on a hat or visor. This made for a nice, trivial project.

I had a ez430-F2013 which I'd picked up from work . It wasn't quite what we needed at work, however it was just fine for a small home project. If your interested, you can pick one up from digikey for about $20.
ez430-F2013 Programmer & dev board.
I also was interested in trying out two new tools.
  • One was a PCB EDA tool, KiCad. While I know that a lot of folks like Eagle,  I wanted something that was open source. After looking at gEDA, I decided I would rater use something a little more integrated.
  • I wanted to try out BatchPCB, a service which fabricates custom circuit boards. While the wait times can be long, the price was right. I wanted to see if I could take a circuit idea from schematic capture, to layout, to reality. 
For my PCB I need to :
  • Provide a power source (e.g. power regulation)
  • Provide a circuit for driving the LEDs.
  • Provide a way to connect up the ez430 development board.
  • Provide a way to control the LEDs.
After some browsing around on digikey, I found the CAT4008 LED driver. It was a nice, low cost, simple to use LED driver so I picked it.

The TI MSP430F2013 can run from 1.8V to 3.6V. For this project, I decided I wanted a 3.5V regulator. After some looking, I picked a small 3.5V 600mA regulator.

I drew up a circuit by hand in my lab notebook, using the reference information in the datasheets for parts I'd selected.
Notebook pre-plan for circuit.

Next: PCB Schematic Capture and Layout.