Electronics

Note Regarding Posts Below - The image viewer crops pictures; to see the whole image at full size right click on the image and select the following depending on your web browser:

  • Chrome - "Open image in new tab"

  • Firefox - "View Image"

Arduino Intervalometer – Update - July 17, 2011

Since I first made my arduino intervalometer two years ago, I have used it several times and come to the conclusion that I could make a few improvements to it. The first change I wanted to make had to do with powering the unit. The original design allowed for an external power source and while this allowed for maximum flexibility, it also made the device somewhat unwieldy. Whenever I wanted to setup for a timelapse shot I had to not only bring the intervalometer but also a mintyboost or other power source as well as a power cable. The other major change I wanted to make was to reprogram the timing ranges to something more useful.

In order to power the unit I could have simply placed a mintyboost inside the intervalometer and changed the wiring accordingly, however, I did not want to have to open the device to change batteries. To get around this and still be able to provide the 5V power I needed I decided to use a lithium polymer rechargable battery. This requires both a charging circuit and a voltage booster to convert the battery’s 3.7V to 5V. Luckily Sparkfun Electronics makes just a device that charges the battery via a micro-USB port and is also very compact. Since the intervalometer draws only 28mA while running I chose a 1000mAh battery which not only fits inside the case it should also power the device for over 30 hours, more than enough for a typical timelapse session. Now I have a completely self contained, rechargable intervalometer.

For timing ranges I changed the low range to 1-60 seconds in 1 second steps and the high range to 5-300 seconds in 5 second steps. I think this should end up being much more useful since most of the timing intervals I have used are under a minute in duration and having the capability to more finely tune that interval will be very handy.

Arduino Word Clock - January 9, 2011

I first saw a clock with this type of design on the Make Blog over a year ago. It is an incredibly clever idea, but the $1000 price tag is a bit much for my taste. I had seen a few attempts at a DIY version but most of them were still too complex or expensive to build. Needless to say when I saw this Instuctable I got really excited. It is based off of another Instructable, however, it simplifies the design and construction to the point where I felt confident that I could build it.

I followed the Instructable pretty closely, with the following exceptions:

LEDS: I got my LEDs from Evil Mad Science, which sells packs of superbright 5mm LEDs in various colors. This project requires a pack of 100 white LEDs. For current limiting resistors I used 470 Ohm instead of 1K Ohm. This allowed me more flexibility since I can dim the LEDs as much as I want, but I can never make them brighter. The LEDs I used are very efficient and only draw 4.8mA with a 470 Ohm resistor, so the maximum power draw for the clock will be about 150mA. Consequently power usage is not an issue since I used a repurposed cell phone charger as the power supply and it can provide 700mA at 5V.

Letter Mask: I had to use 4 transparencies stacked in order to get the mask dark enough. I also used a wider border for the letter mask to cover up some imperfections around the edges of my transparencies. For LED diffusion I used some translucent plastic folders that I found at an office supply store. I got a multicolor pack so that I could try different configurations and decided that a combination of one gray and one white folder cut to fit in the frame was the best looking and most functional choice.

LED Holder: Instead of a cardboard LED holder I used foam poster board. This is a much stiffer material and makes the holder much sturdier, however, it is also thicker so I had to make the light baffles 1″ high rather than 1-1/8″.

Circuit Board: Since the wiring on this project is fairly complex I decided early on that I wanted to keep the circuit board as simple as possible. In order to accomplish this I used two Radioshack breadboard matching printed circuit boards. These are great boards since they have power buses running down the sides of each board and they have plenty of room for the 7 chips necessary for this project. This made it very straightforward to scratchbuild an Arduino on one of the boards and then wire it to the other chips. Note: when building an Arduino in this way you need an FTDI cable which plugs into the 6-Pin header on the board in order to program the Arduino.

I mounted the boards side-by-side on a piece of acrylic to make it easier to work with. I also wired the board such that I could add a photoresistor in the future to allow for dynamic LED dimming (its wiring is bundled separately for later use as shown in the photos). Instead of wiring headers I just wired directly from the circuit board to the LEDs using multicolor wire to differentiate which word group I was wiring to (you can see each ULN2003A’s bundle grouped together in the photos).

The size of these boards prevented me from trying to mount them inside the picture frame, however, mounting the boards on the back wasn’t a problem. As shown in the photos I had use some stacked foam board as spacers between the back of the picture frame and the wall to keep the board from rubbing agains the wall. I also changed the power socket mounting from the back of the frame to the bottom by cutting a notch in the wood and gluing it in place.

Conclusion: The biggest problem I had with this project was dealing with a slightly imprecise LED layout. This resulted in some of light baffles partially blocking the wrong letters. After removing the problem baffles, however, I found that my diffusion layers worked well at making up for any discrepancies due to LED placement as well as reducing cross-letter light bleed to an acceptable level. As far as the code goes the only changes I made were done to make use of external pull-down resistors instead of internal and to clean up the code a little bit since some of the comments no longer made sense. I really like this project. It is not only cool looking, but it is useful as well.

Arduino – Parallax RFID Reader - December 19, 2010

A few months ago I saw some Parallax RFID readers at Radio Shack on clearance and decided to pick them up since they were such a good deal.

Here are some pictures of my test setup. As you can see the reader’s LED changes from red to green when it is reading a tag.

Peggy 2 LED Matrix - August 8, 2010

The Peggy 2 is a 25×25 LED matrix kit from Evil Mad Scientist Labs. Ever since I first saw the Peggy kit I thought it was one of the cooler kits available. I finally got around to getting one of these awesome kits and it is a sight to behold. By far the largest kit I have ever built, it is also the best quality kit I have come across. The Peggy 2’s circuit board is probably twice the thickness of a normal printed circuit board, a welcome feature for such a large board since the added thickness makes the board very rigid. You can purchase the Peggy 2 in a variety of kit configurations; I got the so called awesomeness bundle which includes a power supply, extra pushbuttons, and 640 diffused 10mm LEDs in the color of your choosing (white in my case).

The build itself took around 2 hours to assemble the control circuitry and another 4.5 hours to solder all of the LEDs. It’s a bit of an undertaking, but when you’re done it’s a great feeling when all 625 LEDs light up. To program the Peggy you use the Arduino IDE and download the Peggy Library. I haven’t experimented too much with it yet, but I did try out some of the demo programs from the library and you can see what the Peggy can do in the video below. I look forward to playing with this project a lot in the future.

Remote Camera Shutter & Focus Controls - November 23, 2009

In the process of building two intervalometers (analog, Arduino powered), I learned how easy it is to construct a remote trigger for a DSLR’s focus and shutter controls. Both of those units featured manual controls for focusing and taking photos, but I wanted to build another separate project that would only feature that ability. This would allow the device to be much smaller and lighter.

For this build I used a 3″x2″x1″ RadioShack project box, a 3.5mm stereo socket, and two momentary pushbuttons. In accordance with how my Canon Rebel XSi works, I wired the shutter trigger (red pushbutton) to the tip of the socket and the focus trigger (black pushbutton) to the middle contact. Then I wired the other side of both switches to the shield of the socket. I am a big fan of using a socket for a project such as this since I can now use a cable of any length or configuration as long as it has a 3.5mm plug on the end that plugs into the box. This is an incredibly simple build that works great and should come in very handy for all my remote triggering needs.

Arduino Intervalometer for Time-lapse Photography - July 20, 2009

Last fall when I built my first intervalometer and then used it for some time-lapse photography, the limitations of such a design became apparent. With an analog timer the circuit is limited by component values to function in a fixed way. The timing ranges cannot be changed without rebuilding the circuit and there is no way to be truly precise in your timing. A few months ago I came across this design for an Arduino intervalometer which is very basic and requires reprogramming for any timing changes. After some planning I decided to take the best features of my original intervalometer and combine it with an Arduino’s flexibility to make a much more versatile intervalometer.

Key features to keep from the original were:

  • Camera interface isolation

  • Timing range options

  • Battery or AC adapter power options

  • Camera connection flexibility

  • Manual controls

Additional features that I wanted to add were the following:

  • Power supply flexibility

  • LCD readout

  • Start/Stop the timing cycle

In order to maintain what worked best in the original design I simply copied it directly over to the new version. I used the same relay isolation for shutter triggering, as well as hard-wired pushbuttons for manual focus and shutter control. I also used the same 3.5mm jack to connect to the camera as the original. For power I decided to use a coaxial power jack as I had previously but this time I did not place a battery inside the enclosure. Instead, I made an adapter cable with an N style coaxial DC power plug on one end and a USB plug on the other end. With this cable I can power my new intervalometer from any 5V USB power source (PCs, wall adapters, MintyBoost, etc). In order to keep this build as simple and inexpensive as possible I decided to use the Arduino Pro and a basic LCD for a total cost of $36. The Arduino Pro is the same as a standard Arduino, except it uses all surface-mount components and has no USB interface. This keeps the cost down and reduces the board size. The LCD was simple to wire requiring only +5V, ground, 6 data lines and a dimmer potentiometer input. The final features were all implemented in the Arduino code.

I ran into a few problems while developing the code for this project:

  • How to adjust the timing interval value

  • How to start & stop the timing cycle

  • How to switch timing ranges

For adjusting the timing interval I had originally planned to use pushbuttons, however, after playing with the idea I decided against it. I found that it was much quicker and more user friendly to use a potentiometer as a virtual selector switch. In order to do this I used the map function, to divide up the potentiometer’s analog input values into the specified number of steps.

Starting and stopping the timing cycle was not as easy as it first appeared because the simplest way to wait a specific amount of time between events is to use the delay function. The problem with this is that while the program is delaying for the set amount of time, no other commands are being run and inputs are not recognized. To get around this I used a technique I found on the Arduino website which blinks an LED without using the delay function. Instead it sets a preset interval and then checks how much time has past using the millis function until enough time has gone by to trigger the desired event. This allows the processor to keep scanning the code while the timing cycle is taking place. Now if I want to cancel the timing cycle I can do so without resetting the Arduino.

To switch timing ranges I used this clever piece of code that allows you to use one button for two functions. When the button is pressed the Arduino keeps track of how long it was pressed. For short presses it performs one function and for longer presses it does another. I used this method to implement both timing range switching as well as toggling between set mode and timing mode as shown in the video below.

After getting all of my code together I assembled my new intervalometer in a 6″X4″X2″ project box from Radioshack. This is somewhat oversized for these purposes, but it’s cheap and readily available. Overall I am very pleased with this project. The responsiveness of the interface is very good and it triggers my camera shutter perfectly. The two timing ranges I preset in the unit are 5-60 seconds in 5 second steps and 30 seconds to 10 minutes in 30 second steps. These should cover the most common intervals I will use, and I can change them at any time if I have to. This is by far the most complicated Arduino coding that I have done and it was a great learning experience. Check out the video below for a demonstration of the device.

Arduino Punk Console 8 Step Sequencer - January 27, 2009

The arduino punk console is a simple tone generator that is capable of making some cool audio sequences. I’ve always enjoyed playing around with different audio equipment (see my analog synthesizer) and this looked like a cool project when I saw it on the Make Blog. It is a fairly straightforward project that uses an arduino to handle all of the switch and potentiometer inputs and generate the tones. What is especially fantastic about this is the flexibility afforded by having a reprogrammable controller instead of a hard-wired sound generator. That said I haven’t modified the original code yet.

While the original project was good (see also this Instructable), I made the following changes for my version of the arduino punk console:

  1. Eliminate the LCD screen – I wanted to make my version as cheap as possible and I thought the LCD was somewhat unnecessary for a simple project such as this since it doesn’t display very valuable information.

  2. Scratch build the arduino board – Similar to other DIY arduinos I’ve done before based off of the Boarduino design, I had the parts and building it myself cut the cost of the unit.

  3. 9V AC adapter power – I have found it is much more convenient to power many of my projects with an AC adapter instead of batteries as it saves having to access the inside of the unit for battery replacement and the portability provided by battery power is rarely necessary.

  4. Substitute 5K ohm potentiometers – I’m not sure why the original project used 100k ohm potentiometers, but I had a bunch of 5k’s around and they worked fine.

  5. No speaker – I was planning on using an external amplifier so I replaced the speaker with a mono 1/8″ audio jack.

  6. Eliminate the volume control potentiometer – Again, because I am using an external amplifier I don’t need another volume control.

GPS Receiver v2 - July 17, 2009

When I first built my GPS receiver over a year ago I was fairly pleased with its performance. After using it more, however, it became obvious that I needed to make some improvements. The following were my biggest problems with the device.

  1. Battery life. The 9V battery and 5VDC regulator combination that powered the receiver wasted a lot of energy in the process of reducing the 9V input to the 5V needed to power the receiver. I wanted to find an alternative power source that could use rechargeable batteries with more capacity.

  2. Build quality of the receiver’s enclosure. I found that the enclosure I had been using was too large to conveniently fit in a backpack with other gear. I also wanted to rewire the device to better utilize wire management techniques inside the enclosure.

  3. Power & Backlight Controls. In my first attempt I used slide switches which, while functional, looked terrible. In my revised build I used push-on-push-off switches. This was an improvement, but they were still poorly placed and could turn on accidentally when pressed against other objects in a pack.

Battery Life

The solution I found for this problem is actually a project that I’ve built before called the MintyBoost. This ingenious device takes a 2-3V input from 2 AA batteries and boosts it to 5V. While originally intended to charge USB devices such as cell phones or mp3 players, the MintyBoost works perfectly with my GPS receiver and offers a big improvement in convenience and performance. I can now use rechargeable NiMH AA batteries which provide 2000mAh of power, constituting over 300% more capacity than a typical alkaline 9V battery. This should translate into over 12 hours of battery life.

While I would normally build a simple circuit like this from scratch, I decided to get MintyBoost kit for this build. Aside from the obvious convenience factor, it also packs the circuit into a much smaller package than I could accomplish on a proto-board. The only changes I made to the kit were that I did not install the female USB connector and its associated pull-up/down resistors since I connected my power wires directly to the board itself.

Build Quality

I looked around for a new enclosure with a AA battery compartment, but I couldn’t find one that was the right size, so I decided to use a generic 6x4x2 project box from Radioshack and modify it for my purposes. While somewhat thicker, it is otherwise much smaller and fits better in the hand than my previous enclosure.

Because I need to access the inside of the case every time the batteries have to be changed, I wanted to be able to take the cover off without having to use tools. As with all Radioshack project boxes the cover is normally held on with 4 countersunk Phillips head screws. To allow for hand access, I drilled and tapped the screw holes in the body of the box to accept 6-32 cap screws. These machine screws have a knurled head instead of a screwdriver slot, allowing you to grip the head of the screw with your fingers. This makes removing the cover by hand a breeze.

In addition to modifying the case I also rewired all of the connections from the LCD and GPS module to the main board. This means I now have only 4 wires going from the main board to the lid, allowing me to bundle the wires and secure them with wire ties to the lid and body. Another change I made was mounting the two circuit boards and battery holder to the enclosure with double sided foam tape instead of stand-offs and bolts.

Power & Backlight Controls

To resolve my complaints about the receiver’s controls I decided to change both the placement and type of the switches I used. Instead of the face of the receiver, I moved the controls to the top of the unit. The main idea behind this is that it streamlines the profile of the receiver so that there are no protrusions when it is placed vertically in a backpack, making it less likely that the unit will be turned on accidentally. For the power switch I used a large rocker switch with a fairly stiff action. This switch is both functionally and aesthetically superior to my previous choice. For the backlight control I stuck with a pushbutton, but this time I went with a small momentary version. This was done because I rarely use the backlight and by requiring the user to hold down the button they are more likely to use it sparingly, thereby conserving the battery.

I am very pleased with this latest revision of my GPS receiver. It has always been a fun project and now it is even more capable and robust. Check out the video below for a walk-through and a demonstration of the unit.

Time-lapse Photography w/ DIY Intervalometer - October 6, 2008

In Make Magazine issue 15 a project caught my eye (based on this Instructable) that functions as a camera shutter timer, or intervalometer, allowing your DSLR to do time-lapse photography. This is possible because most DSLR cameras have a remote accessory port which allows the camera’s shutter and focus functions to be performed remotely. The way this works is very simple; the remote accessory port is simply a 3 contact jack similar to the one you plug your headphones into on your MP3 player or stereo. The difference here is that instead of outputting sound, the port is just a set of contacts which can be used to remotely trigger the shutter or focus. When the shutter contact is shorted to the ground contact the shutter is activated. Time-lapse photography has been something I wanted to play with for some time and this project looked like a great way to get my feet wet with my new Canon Rebel XSi.

The article itself, however, admitted that the design had limitations; it didn’t reliably trigger the camera’s shutter and its timing range was limited (30 seconds to 2 minutes). Looking at the original schematic I realized that I had experience making similar timing circuits and decided to make a more versatile intervalometer.

The primary upgrades I planned for this improved version were the following:

  1. Shutter trigger reliability

  2. Camera interface isolation

  3. Timing range options

  4. Battery or AC adapter power options

  5. Camera connection flexibility

In order to achieve better shutter triggering reliability I used a more sophisticated timer chip, the 556, which is essentially two of the 555 timers used in the original circuit in one package. I then chose appropriate resistor and capacitor values such that I increased the time the shutter is triggered to around 1.5 seconds, thereby eliminating any reliability issues.

The original design used a transistor to short the camera’s shutter pin to ground. I decided to completely isolate the camera from the timing circuit by using a reed relay which requires little current draw from the circuit. This eliminates the possibility of stray voltage entering the camera via the timing circuit and damaging the camera. Another benefit of eliminating the transistor is that I can use the two pushbuttons to manually focus and trigger the shutter while the timer is running, which was not possible in the original design.

To add timing range options I inserted a DPDT toggle switch which allows the user to choose which RC timing network controls the time delay of the shutter triggering. By switching in a much larger timing capacitor I greatly increased the timing interval that can be set. The Low Range allows for delays from 17 seconds to 5 minutes, and the High Range allows for delays from 7 minutes to over 60 minutes.

The final two alterations were the most minor, but still very useful. To allow the circuit to run off of an AC adapter instead of just battery power I added a coaxial power jack. I also configured the power wiring such that if an adapter is plugged into the intervalometer it cannot pass voltage to, and possibly damage, the battery. Instead of hard soldering a cable with the appropriate connection on the end to the intervalometer, I soldered all the camera connections to a 1/8″ stereo jack. This allows me to use a Radioshack stereo patch cable via a 1/8″ to 3/32″ adapter to connect to my camera’s accessory port.

After I built my circuit and put it in an enclosure I had to setup my camera properly to take good time-lapse photos. This article has a lot of good tips regarding what settings your camera should have and how you should assemble your finished video. I set my intervalometer to take a picture every 2.5 minutes and let it run.

Panel Meter Clock - March 12, 2008

There are several versions of this project, including one which can be purchased as a kit (The Chronulator). In this case I based it off of the one featured in Issue 13 of Make Magazine (original code and schematics). I liked this iteration as opposed to The Chronulator because not only can I easily build it from scratch using an Arduino board, it also has a seconds display

In order for panel meters to tell time the Arduino pulses three of its outputs according to what the clock demands. For example, if it is 6:45 the Arduino will pulse the hour meter output 50% of the time and the minutes meter output 75% of the time. The pulses occur so fast that the meters can’t react in time, consequently it appears as if they are receiving a constant supply of current. Since the Arduino’s outputs are 5VDC and the meters were chosen to read 1mA maximum, then a resistance of 5000 Ohms is necessary between the outputs and the meters. 5000 Ohms is not a standard resistor size so I used some parts I had lying around in my junk box, in this case 4700 Ohm resistors and 1000 Ohm potentiometers. The potentiometers allow you to adjust the total resistance of the circuit enabling you to set the peak value of the meter to the correct reading (1mA).

To finish the project I took an 8″x6″x3″ plastic enclosure from Radioshack and cut holes in the lid to mount the meters. I also placed the mode, hour set, and minute set buttons on the top of the enclosure. To finish it off I added a power connector for a 9V power brick which will be the power supply for the clock (in the lower left corner of the circuit board you can see the power circuit consisting of a protection diode, a 5V regulator and 2 capacitors which together supply 5V to the Arduino from the incoming 9V supply).

In order to make the panel meter faceplates read time instead of current I had to make a new set of scales for the three gauges. I started with the templates available on The Chronulator website (I particularly liked the VU meter as you can see in the photo). Since these are vector graphics images you can easily resize them without losing detail like you would in a bitmap image. I used a free conversion tool called FreeSVG to convert the files from PDF to SVG (Scalable Vector Graphics) format which can be read by the free, open source vector graphics editor Inkscape. Note: I believe that the new version of Inkscape will include the ability to open PDFs.

I used Inkscape to resize the faceplates to match the dimensions of the panel meters I had purchased (which were larger than the template). I also inverted the color scheme of the template since text on a white background is more visible than with a black background. I printed the new faceplates out on 4″x6″ glossy photo paper (which really shows off the colors of the scale better than regular paper). After cutting out the new gauges with a razor blade, I then used rubber cement to glue each of the completed faceplates onto the original aluminum gauges. I allowed the finished gauges to dry overnight and they went on without issue.

Total cost was about $60 for my scratch built Arduino, 3 panel meters, pushbuttons and enclosure.

This is an excellent project to get your feet wet with the Arduino, and it looks great too.

Arduino - March 8, 2008

If you have been following this blog at all you probably noticed that I have done a fair number of microcontroller projects. In my experience working with the PIC and AVR microcontrollers I ran into a number of issues:

  1. The PICBasic programming environment , while easy to learn, only works on Windows

  2. The C programming environment for the AVR requires more effort than I wish to put into a casual hobby enterprise and I have been unable to get it working in Linux

As I looked for more project ideas I noticed a lot of people using the Arduino development board. The Arduino is an open source hardware and software environment similar in concept to the BASIC Stamp (except it’s not expensive). Basically all the Arduino does is provide a standardized microcontroller board using the AVR ATMega168 processor and various power, I/O, and programming connections. They can be purchased as a completed board for around $35 (several versions of unassembled kits are also available). The biggest advantage from my perspective is that the Arduino software is truly cross-platform since it runs in Java and therefore can be used in Windows, Mac OSX and most importantly for me Linux.

One version called the Bare Bones Arduino removes the standard USB-serial adapter from the board itself and instead substitutes a FTDI USB-serial cable to connect the board to your PC. This is done to minimize cost since the adapter cable is a one-time $20 dollar purchase that can be used with an infinite number of compatible boards instead of paying for the adapter chip on the standard Arduino every time you get a new board. Another version of the Arduino called the Boarduino modifies the form factor of the circuit board into one more convenient for use on a solderless breadboard. otherwise it is essentially the same as the Bare Bones Arduino in that it also uses the FTDI adapter cable. Both of these boards are completely interchangeable with the Arduino.

While these are good products, I decided I wanted to build my own version from scratch to better fit my electronics setup. I used the schematic from the Boarduino website to base my design on, but I used the same form factor as the Bare Bones Arduino. Since I use a Graymark 808 Protoboard which has a built in power supplies I removed the power circuitry from my design. In its place I simply put two headers, one for +5V and one for Gnd that connect to the protoboard’s power supply (as shown in the pictures above). I also reduced the number of headers (which stab into the solderless breadboard) used to fit the Radio Shack PC board I used for my layout. I retained the power select jumper to choose whether the board is powered by the USB programming cable or the protoboard’s power supply. I also left the two indication LEDs, reset button, and the 6 pin ISP and USB programming headers as they are on the Boarduino.

Total cost for my homebrew Arduino was $9 (not including the USB adapter cable).

Having never dealt with the Arduino’s software package before, I wasn’t sure what to expect. It is a simplistic Java application which provides a very user friendly environment to write your programs (or sketches as they are called) in. The programming syntax used is similar to C, but the environment has many useful functions already built in so it’s very easy to do simple tasks such as set a pin as an output or toggle an output on & off. As someone who has used other languages, PICBasic for example, I can attest to how intuitive these functions are when compared to manually setting register ports in BASIC. Like in C you can also create your own functions and call them, making this a very powerful language despite its simplicity.

The installation of the Arduino software is fairly straightforward, even on Linux, and I encountered no issues. In Ubuntu it entails downloading the application from the Arduino Software page and following their well written instructions. These mainly involve installing Java and removing a package which inadvertently thinks the Arduino is a braille reading device and grabs your computer’s USB port. Left out of the instructions is an issue which caused me some problems; the Arduino software should be run with root privileges in order to gain access to the USB port and consequently the Arduino board. This is done by opening the terminal and executing the following commands:

cd /home/username/Arduino-0010 (navigates to the Arduino software’s folder)

sudo ./arduino (runs the Arduino software script with root permissions)

The application will now launch. Once running I selected my board under Tools – Board – Arduino Diecimila(currently the newest board design and bootloader) and picked my USB port under Tools – Serial Port – /dev/ttyUSB0. Since I built my Arduino from scratch, my ATMega168 did not come pre-burned with the Arduino Diecimila bootloader. The bootloader functions as a sort of operating system for the microcontroller, allowing you to transfer files over a serial port instead of having to re-burn the entire firmware every time you change your program, thus simplifying the entire process. In order to burn the bootloader I plugged my AVR programmer into the 6 pin ISP header on the board and selected Tools – Burn Bootloader – w/ USBtinyISP. The software displays its progress on the bottom of the screen and lets you know when it has finished burning the file to the chip. To check if the bootloader is running properly follow this guide (since the various bootloaders behave differently). Next I wrote a simple LED flasher sketch and after plugging in the FTDI cable I successfully uploaded the sketch to the board and it ran perfectly.

Aqua Teen Hunger Force Animated LED Art - February 10, 2008

On January 31, 2007 Boston was shutdown when pieces of LED artwork that looked like characters from the Cartoon Network show Aqua Teen Hunger Force were mistaken for bombs. Ever since this occurred I have wanted to build my own version to hang up in my apartment.

My version is designed to look like the character Ignignokt; in case you don’t watch the show Ignignokt and Err (his sidekick) are Mooninites (residents of the moon, designed to look like characters from an 8 bit video game) who occasionally come down to Earth to annoy the Aqua Teens. I chose Ignignokt because he is green and blue (Err is purple and blue) and green LEDs are cheaper than purple LEDs. My design used 72 green and 40 blue LEDs.

I got my LEDs from Mouser and I chose them based primarily on their diffusion angle (over 40 degrees), which allows for better viewing angles than other LEDs. In order for an LED array like this to function properly the LEDs must be wired in parallel (ie. all of the cathodes are connected together as well as all of the anodes). I also had to subdivide the LEDs into a group of all of the green LEDs (D6 on the schematic) and all of the blue LEDs (D5 on the schematic). This had to be done because the LEDs were different types and there were more greens than blues, causing the current draw of the groups to be unbalanced. This created a problem where only the green group would light, consequently, I adjusted the resistor values such that I balanced the current drawn by both LED groups. There are also four additional groups to create the effect of Ignignokt giving the finger. These groups are controlled by a PIC16F84A microcontroller which orchestrates the animation of the LEDs. As shown in the schematic, group D1 is the hand and groups D2-D4 are the finger. The code (written in PicBasic) is very simple, involving only turning on specific digital outputs of the PIC for set periods of time. I can power the whole thing off a 9 Volt battery using a power circuit similar to that shown in the schematic for my GPS project (I substituted a 78L05 for the 7805 voltage regulator since this circuit draws less current). Check out the video to see Ignignokt in action.

Parts

GPS Receiver - September 17, 2007

If you have never been to the MAKE Magazine website you should really check it out. They have tons of project ideas on their site and more are posted every day on their project blog. In July I saw an article regarding a project that took a GPS module, a simple LCD display, a Basic Stamp to interface the two together, and created a GPS receiver. The receiver displays your coordinates in degrees, minutes, and seconds.

I was intrigued because for such a complex sounding project it appeared very straightforward and relatively inexpensive. Upon further digging I discovered that this project used a Basic Stamp 2 chip for a processor, along with a Basic Stamp Development Board and software; these together cost around $200, not including the cost for the LCD Display and GPS module (another $100).Then I remembered that the Basic Stamp is actually based off of and very similar to the PIC series of microcontrollers that I had previously worked with in college. After looking at the code provided on the project page, I decided that with a little effort I could convert it for use with a PIC (I used a PIC16F84A, but others can be used, they cost $6).

To program the chip I used the programmer I had from college. Built from a kit, it is USB compatible and has a ZIF socket so you don’t wear out the PIC’s pins pulling it in and out of the socket while troubleshooting your projects. It is not the cheapest programmer available at $85. Many other programmers are available for much less money, or you can build your own. The last item necessary is a BASIC compiler for the PIC. While the Basic Stamp is also programmed using the BASIC computer language (hence the name), the PIC uses a slightly different version called PicBasic. The compiler I used is called PicBasic Pro ($250) which I had from college (there is a cheaper version called PicBasic Compiler for $100); I also found another compiler which offers a free demo. For me, since I already have all of the pieces I need for PIC development it was much cheaper ($6 vs $200) to use a PIC instead of a Basic Stamp. The casual hobbyist should decide which route they want to take since the Stamp ($200 to get started) offers a more user friendly path, while the PIC ($150-$300 to get started depending on programmer and compiler) offers more customization and more processing power.

It took me most of an afternoon to refresh my memory and convert the code from PBASIC to PicBasic. The photo above shows my version of a homebrew GPS receiver using a PIC as I prototyped it on my breadboard. The GPS module has an LED that flashes to show it is acquiring satellite signals (at least 3 are needed for valid GPS data) and is solid once enough connections have been made. Since I plan on putting this project in some sort of handheld enclosure, the LED will no longer be visible. To get around this I added some code which makes use of one of the built-in features of the GPS module. This feature will report back how many satellites have made connections with the module, when this value is below 3 the LCD displays the text “Searching for satellites…”. When the value is above 3 the LCD displays the GPS location data. Overall this project was a lot of fun and a great refresher for me regarding PICs.


Update - Enclosure for GPS

I previously prototyped my own GPS receiver. Since then I modified a small plastic enclosure to hold the LCD, GPS module and circuit board holding the PIC microcontroller and power circuit (see schematic for details). I also added code (see link below) that checks for the state of a switch to determine if you wish to have the LCD’s backlight on or off. I decided to add this feature after measuring the current draw of the receiver as a whole. With the backlight on, the receiver draws an average of 165mA; with the backlight off, the receiver draws an average of 125mA (that’s about a 25% savings). Since the receiver runs off of a single 9 volt battery (alkaline – 600mAh typically), that power savings is equivalent to as much as 72 minutes of additional time the unit will now be able to run. With a lithium 9 volt (1200mAh – typically) it could add another 2 hours and 24 minutes.

I will be the first to say that it is not the most professional looking, but it works. The switch on the right is for power and the other switch is for the backlight. There are 4 possible LCD states: searching with backlight off, searching with backlight on, receiving GPS data with backlight off, and receiving GPS data with backlight on.

I did some research and here are some constants that show how useful this unit can be for many different functions.

  • 1 Degree = 60 Nautical Miles (69 Miles)

  • 1 Minute = 1 Nautical Mile (1.15 Miles)

  • 1 Second = 101.2 Feet

  • 0.1 Seconds = 10 Feet

With these relationships and some basic geometry, I can determine distances and directions to and from GPS way points.

This was a really satisfying project to do. With just a handful of parts and a couple of modules I have a fully functional and now portable GPS receiver.

Parts List

  • LCD with backlight (2 lines, 16 characters per line)

  • Parallax GPS Module

  • PIC16F84A

  • 7805 (5 Volt Voltage Regulator)

  • 4700 Ohm Resistor

  • 4 MHz Crystal Oscillator

  • 100uF Electrolytic Capacitor

  • 0.1uF Ceramic Capacitor

  • 9 Volt Battery

  • SPST Switch (power)

  • SPDT Switch (backlight)


Update - Revised Enclosure

I got a new frontpanel for my GPS and replaced the two slide switches with push-on-off switches. The left button is for power and the right turns the LCD’s backlight on and off. Since the backlight toggle is performed via a digital input on the PIC I had to modify the circuit slightly by adding a 1M ohm pull-down resistor to the digital input which the pushbutton wires to. This is required because in the previous version the single pole double throw slide switch would either connect the digital input to +5V or ground; since the circuit now uses a single pole single throw pushbutton it cannot perform this same functionality. Therefore, the pull-down resistor grounds the digital input when the switch is not on and then when the switch is turned on its resistance is so high that it is effectively an insulator to ground in comparison to the straight +5V from the power supply circuit.

Vacuum Tube Audio Amplifier Kit - August 14, 2007

I have been somewhat interested in vacuum tube projects for awhile now after I refurbished an old AM radio from my grandmothers house. Although a simple project, involving cleaning the radio and replacing the old tubes with new ones, I think the main draw of a tube project is that distinct retro feeling you get when you fire up the project and it starts glowing, but in a good way. While looking around for a simple, beginners tube project I stumbled upon a fairly large community of people who had built and subsequently modded the K-502 audio amp kit from Antique Electronic Supply.

I purchased the kit and built it in a couple of hours. It is a very simple project to complete, consisting of only about two dozen parts. I had originally planned to assemble the kit in an enclosure, but my final assembly behaved poorly (I think in part due to improper grounding). I reassembled the parts on the pine board which comes with the kit and it now performs flawlessly. The amp takes a standard left and right RCA style audio input and can output up to 8 Watts of power. This may not seem like much, but with efficient speakers it gets loud enough for any common usage around the house.

I would still like to put some sort of cover over the board to minimize the risk of myself or others from coming into contact with the line voltages present. Although not the most inexpensive kit out there (compared to some solid-state kits), it is cheap compared to other tube based audio amplifier kits which can run upwards of $300. Definitely a fun project, especially if you need an extra audio amplifier.

Update - November 2009

Ever since I first completed this project I have wanted to build an enclosure for it. I wanted something that would decrease the risk of electric shock while also showing off the cool aspect of the vacuum tubes, ie. their characteristic glow.

In order to keep it simple I bought a sheet of aluminum that had a pattern of pre-punched holes in it at the hardware store. This allows the tubes to be ventilated while still being visible. I came to the conclusion that what the amplifier really needed was a circuit board cover, not a full enclosure. Keeping the cover size to a minimum allows access to the speaker wire terminals. I cut out a rectangle in the middle of the top to allow the tubes to stick through, again for easy access and viewing. Finally I attached the case to the base board using six screws.

Analog Synthesizer - June 13, 2007

I have been interested in synthesizers since I first started becoming interested in acid/new wave rock when I was in middle school. Analog synthesizers particularly interested me because they are easier to build and also cheaper, as well as having a lot of nostalgia for the original form of sound synthesis. Consequently when if first ran across the circuit board being offered at Music From Outer Space, I was very excited. The board is not only relatively inexpensive, it is also well made and was shipped very quickly. My synthesizer, pictured below, cost around $100 to make because I had to purchase the majority of the parts as well as the case. I purchased most of the parts and the case from Mouser, except for the potentiometers and the switches which I bought from Jameco. The construction of the board was fairly straight forward and took a few hours. The wiring of the board to the faceplate, however, took several ours of tedious wiring which I would not relish to repeat. In the end though I ended up with a great little unit which works great and can produce a variety of sounds. As can be seen from the photos, I also installed the mod which allows the modulation of VCO-1 with VCO-2’s output. I rearranged the faceplate accordingly to fit on my case’s aluminum plate. I had no alignment issues with the unit and it worked from the first time I turned it on. In the future I may build an audio amplifier as well as a sequencer to control the oscillators and actually produce music as opposed to just noises.

I had been looking for some time for a way to modify my analog synthesizer project to be powered by an AC adapter instead of the two 9 volt batteries that it had originally been designed to use. This was more complicated than it sounds since the synthesizer requires both +9V and -9V from the same power supply. After some investigation I found a circuit; that could be used to transform a single +9V input into both +9V and -9V. It is a really clever design that accomplishes this feat using a special charge pump converter IC and a couple of capacitors. As the pictures show I also changed the power switch to one that is more aesthetically pleasing than the toggle switch used previously. I also added a coaxial power socket to the back panel to accept the plug from that AC adapter. The synthesizer performs the same as it did before my modifications, however, I am now freed from having to worry about battery life.