Monday, May 7, 2012

DIY: Custom Graduation Photo Cards

Card in envelope
The final result of my DIY photo card adventure
Since I'm graduating this May, I decided to send out a special graduation thank you note to my friends and family. I started using the photo card creator on the Walgreens website but quickly got frustrated with the lack of customization tools. Specifically, I wanted custom fonts and also to change font colors within a text box. Being an incurable DIYer, I thought to myself: "I can make this myself in GIMP and customize it all I want!"

Wednesday, May 2, 2012

Interesting Infrastructure: Caltrans and Music Notes

These photos are from Cotati, CA in the northern bay area. As you can see, Caltrans incorporated a music note motif into their new overpass project. Since Cotati is sort of a hippie town, and also home of an annual Accordian Festival, it fits the local vibe. The motif has a treble clef sequence and a bass clef sequence, and they appear on the sound walls, the retaining walls and on the actual overpass. I alternate between thinking this is really cool and thinking it is a huge waste of money, but here are the pics anyway:
Sound wall in final stages of project
Overpass with alternating design

Friday, March 30, 2012

GIMP: Adding New .gpl Palette

Palettes are very useful if you want to have a consistent color scheme. I find that having good colors readily available helps in the creative process as well. You can find great user-created palettes for free at kuler.com (link) and colourlovers.com (link); using these palettes can give your project a very professional look.

Wednesday, March 21, 2012

Arduino: Sending Hex Bytes to Serial Devices

I have been working on a project which involves an Arduino communicating serially with an LCD display device. Through a lot of trial and error, I finally figured out that when you want to send a HEX-encoded byte from the Arduino, you need to use the Serial.write() command rather than the Serial.print() command. The Serial.print() command works find when you are sending an ASCII byte but it will not work when you try to send a HEX byte. The right and wrong ways are below:
//Serial.print('U');  <----right (ASCII)
//Serial.write('U');  <----also fine (ASCII)
//Serial.print(0x55); <----WRONG! (HEX)
//Serial.write(0x55); <----right (HEX)

LINKS:
Similar problem and solution: http://www.arduino.cc/playground/Learning/SparkFunSerLCD

Thursday, March 1, 2012

STK 200: First Program (LED Blink)

For this program, you should already have AVR Studio 5 and AVRISP-U installed on your computer. If you don't, visit my previous post Getting Started Programming Guide (link). This is a simple program which simply makes the built-in LEDs to blink. I'm going to use C for this program because the code looks really simple. The assembly version is not really difficult either but we'll keep it simple for now. Note that AVR Studio 5 has a built-in C compiler. You might remember for AVR Studio 4, you had to download AVR GCC and integrate it. If you downloaded AVR Studio 5, you already have the C compiler.

What will the program do? If you look at the STK 200, there is a row of 10 LEDs numbered from 0 to 7 then "ISP" and "ON." These are the built-in LEDs. Our program will make the LEDs numbered from 0 to 7 blink on and off at a rate perceptible to the human eye. In microcontroller terms, this means physically connecting the LEDs to PORTB and sending alternating HIGH/LOW signals to PORTB. Note that is all output - no input. If you don't know what PORTB is, check my Basic Layout Guide (link).

Step 1 - Create a new project: Go ahead and open AVR Studio 5. From the startup screen, go to File>New>Project... and you should see a New Project dialog box. At the top left of the dialog box, select the C templates and then choose "C Executable Project" in the middle of the screen. At the bottom, fill in "blink" as the name and this should automatically fill the solution name field with the same text. Also, make sure that the "Create directory for solution" box is checked. This checkbox will not affect your code at all, but it will keep your AVRStudio folder better organized. Look at the picture below and make sure your screen looks the same:
STK 200: New Project Dialog Box

Friday, February 17, 2012

STK 200: Getting Started Programming Guide

To start programming the STK 200, you need to download some software. Namely, you need AVR Studio and AVRISP-U. I talked about the basic layout of the board in a previous post (link), so check that out if some of the terms I am using are unfamiliar. I broke the process into three steps below.

Step 1 - Download AVR Studio 5: I started programming with AVR Studio 4, but if you are starting today, you might as well start with the new AVR Studio 5 release. The program is built using the Microsoft Visual Studio Shell (VSS) so the user interface is very similar to Visual Studio. I suppose this can be a good thing for those who like Visual Studio and a bad thing for those who don't. Overall, it seems to have a lot of convenient features such as IntelliSense and debugging interface.

So to get the software, go to the AVR Studio 5 page (link) from Atmel and download the software package you need. I recommend downloading the package that includes VSS and .NET 4.0. The software is completely free but you do have to fill out a registration form. The installer is pretty big (the one including VSS and .NET is over 600 MB).
STK 200: AVR Studio 5

Tuesday, February 7, 2012

Interesting Infrastructure: Mouse shaped wetland

Check out this satellite imagery from Petaluma, California, a city of about 60,000 people in the northern bay area. The city completed construction of a new wastewater treatment plant, the Ellis Creek Water Recycling Facility, in 2009 and they included some polishing ponds which had a very interesting shape. Environmental artist Patricia Johnson worked with the city and their consultants to make this wetland park a unique piece of artwork. The shape is a reference to the harvest field mouse, an indigenous species in the area near the Petaluma River. You can see the actual treatment facility towards the top right of the image.
Mouse shaped wetland: Raw image
Mouse shaped wetland: Mouse outlined

Wednesday, February 1, 2012

STK 200: Basic Layout Guide

The Kanda STK 200 has a lot of really cool features. But when I first got the board, I didn't even know where to begin. This post goes over the board's basic layout and the main features that it includes.

I/O: Really, the core function of a microcontroller is Input/Output. In fact, out of the ATmega32's 40 pins, 32 pins are set aside for I/O. They are organized into four 8-pin ports named PORTA, PORTB, PORTC, and PORTD. The STK 200 makes it really easy to access these ports by giving them each headers. The board even labels the headers using the standard naming convention established by the AVR family (PORTA, etc.). Each header includes it's own VCC and GND, which devices almost always require. LEDs and switches are probably the most common form of I/O; conveniently, the STK 200 has 8 LEDs and 8 switches built into the board. You can dedicate ports to the LEDs, the switches or both using a 10-pin ribbon cable provided with the board and pictured below. PORTB is lined up with the LED input header and PORTD is lined up with the switches output header for an easy connection.
STK 200: I/O

Friday, January 20, 2012

STK 200: Switching Microcontrollers

When I bought my Kanda STK 200, it was shipped with an ATmega8515 microcontroller. While the 8515 is a fine microcontroller, I wanted to replace it with an ATmega32 due to the latter's more robust features.  Namely, the ATmega32 has 32KB of flash memory compared to the 8515's 8KB. Also, the 8515 has no built-in analog to digital or digital to analog conversion while the 32 does. If you are also interested in switching the microcontroller on the STK 200, here is a quick guide:

Sockets on the development board: When you look at the board, you can see various sockets. Check out the following image to see the available sockets and what their name is:
STK 200: Sockets on the Development Board

Wednesday, January 18, 2012

Fundamentals of Engineering/EIT Exam Strategy

I wrote some general tips for the Fundamentals of Engineering Exam in a previous post (link). Here are test taking strategies to go along with those.

exam answer bubbles
FE Exam: Multiple Choice
Overall strategy: Become an expert in the subject areas that you are most familiar with and know the basics of all other subjects. There is a reason the engineering profession is split into specialties (civil, mechanical, etc); there is so much to know that it is almost impossible to be an expert in everything. Furthermore, we all have our own ways to solve problems. Those thought processes might work especially well on certain subjects and not so well on other subjects. I found that it is much more productive to focus on the subjects that I have a background in rather than try to learn an unfamiliar subject from scratch.

Guessing: The entire test is multiple choice with four possible answers. This means that if you completely guess, theoretically you have a 25% chance to get the correct answer. Further, if you are able to eliminate one of the possible answers, you now have a 33.3% chance to pick the right answer. Eliminating two possible answers leaves you with a 50% chance and, according to my study manual, a passing score on the FE Exam is a bit less than 50%. So, theoretically, if you were able to eliminate two possible answers for every question on the test, you should pass. Of course, this is not practical. In reality, there are some questions where you absolutely know the answer and some questions where you have no idea, but this does highlight the effectiveness of strategic guessing.