Resources

Software

Autodesk Eagle
Adobe Illustrator
Adobe Photoshop
Mods

Equipment

Roland SRM-20

Project Files

Board Schematic
Board Traces (with Signature)
Board Outline
Eagle Schematic File
Eagle Board File


Creating the Custom Hello-World Board

Context

The project for this week was deceivingly simple: recreate Neil's echo hello-world board from scratch, and modify it to include an input and an output, such as a button and an LED. I'm planning to use RGB LEDs in my final project, so I opted to try my hand at incorporating one of the stock RGB LEDs from the fablab inventory, which is quite literally three LEDs in one.

Neil's board has six components: an ATTiny44 chip (the brains of the operation), a resonator (to tell the chip how frequently to execute commands), a decoupling capacitor (to reduce high frequency signal noise between the chip and the power supply), an ISP header (to program the chip), an FTDI header (to talk to a computer once programmed), and a pull-up resistor (to allow the ISP programmer to toggle the ATTiny44's reset pin so it can be programmed).

Planning Out
New Components

Once I decided I wanted to add an RGB LED and a tactile button, I was faced with the challenge of figuring out how to do so. The first step was to find out some additional information about the chip itself - namely, which of the open pins can I use to control/sense my new additions, and how much current is acceptable at each pin.

The ATTiny44 datasheet made it pretty clear that any pin, aside from VCC and GND, may be used as an I/O pin with source and sink capability. Used in this capacity, these pins can be programmed to utilize internal pull-up resistors within the chip. This means my button could be connected between any open pin and ground.

More or less the same held true for the LEDs as well; any pin could turn any color of my RGB LED on or off, but I wanted to experiment with gradual color changes as well. Two pins on the chip, PB2 and PA7, offer pulse-width modulation (PWM) capability which would allow two of my three colors to fade in and out (I think), identified with OC0A and OC0B. I'll need to dive into this more deeply when I go to program the chip, but for now it makes sense to attach two of my three RGB LED colors to these two pins with the promise of some additional functionality down the line.

An electrical engineering friend of mine suggested I check the maximum current ratings for the pins of the chip to determine whether I'd need to control my LEDs using a transistor, or if I could connect them to the IC directly. Page 173 of the datasheet lists the chip's electrical characteristics, and states that its pins are rated for 40mA each. Now to figure out the current draw from my LEDs.

The RGB LED datasheet lists a maximum current rating of about 25mA per color, with recommended current at 20mA. It also lists "amusement" as a primary application of this technology, which I found amusing. Regardless, it looks like I'll be able to hook up each LED directly to a pin on the chip.

The graphs provided on the datasheet show the relationship between voltage and current flow. I plugged in the values from these graphs at the 20mA mark into an online LED resistor calculator to determine the amount of resistance needed. I've heard a rule of thumb for LEDs is a 500ohm resistor, though in this case the calculator suggested I could get away with less, around 100ohms for the blue and green LEDs, and 150ohms for the red, both of which were rounded up to the nearest 50. Staying this low makes me a little nervous about reducing the lifespan of my LEDs, though I'll see how it goes once they're fully powered.

Designing the Board

I decided to use Autodesk Eagle to design my board, mainly because I already use Autodesk Fusion and because a number of my classmates were using Eagle as well.

Victoria's board design Victoria's schematic Victoria's parts list

One of my classmates Victoria Shen happened to leave some of her work around the lab which proved to be a helpful starting point, if for nothing more than to see how these parts are named in the fablab Eagle library.

I was able to find the parts in the fablab library without too much trouble. Along the way I referenced some online tutorials on how to label and name components and net stubs in order to make connections between parts and to keep the document looking clean (see helpful links section up top).

Connecting everything together wasn't too challenging, though it's tricky to spatially plan at this stage. While this net would work, I ended up needing to switch around some of the pin connections between my new components since these initial positions didn't lend themselves to optimal physical placement.

Routing everything was the most time consuming part of the design phase. I used Neil's board as a starting point for my own, and did my best to plan around what already existed. I ended up using my button as a bridge to help cross signals from the right side of the chip to the left side of the board.

Unfortunately my traces were too close together, and ended up getting merged when I was about to mill my board. Through some trial and error I found that giving my traces a clearance of about 17.5 or 18 mils was enough to ensure adequate separation. It's possible to set this up using the Net Classes options dialog, at which point the display will visually signal when traces are too close together.

Finally the board was ready, and I was able to mill it out. For kicks, I added a personal touch in some open space in the upper left corner, using a personal logo I'd previously made in Illustrator. It was easy to incorporate once I exported the traces from Eagle.

I should note, however, that exporting images for production from Eagle is non-trivial. All other non-printing layers need to be hidden. After some searching online, I found the command display none top, which first hides all layers, then selectively shows the top traces. I was able to get everything back by typing display last.

Soldering

Soldering the board was also labor-intensive. I tried to take extra care when soldering to create nice, smooth, shiny connections instead of the tiny granite mountains I made the last time around. Seemed to come out well enough.


Programming

I'll admit, I felt a bit out of my depth when it came to programming the board with Neil's echo hello-world program. Thankfully, Julia Ebert did a phenomenal job of documenting this process last year, and by following her guidance I was able to make short order of programming my board.

Once programmed, my board was able to communicate with the computer by echoing back any characters I sent its way. It even remembered what characters I'd previously sent after I closed and reopened the python script.