Monday, July 28, 2008

PC Power Usage (fun with a Kill-a-watt)

Recently I purchased a Kill-a-watt power meter and since then I have been testing the power usage of my various PCs. The Kill-a-watt is a low cost ($20) wall outlet power meter that will display the voltage, amperage, frequency, power-factor, wattage, volt-amps and kilowatt-hour usage of whatever you have plugged into the unit. In order to do a well rounded test of my computers I decided to monitor the power used during various activities. I tried to do tests that best matched tasks I primarily use the machines for (laptop for productivity, desktop for gaming, etc). I was most interested in testing my HTPC since it is turned on almost 100% of the time, so I left it plugged into the Kill-a-watt for 4 days to get a good average usage sample. The tests I decided to run were the following:

Off - phantom power usage when unit is turned off
Standby - power draw when in standby mode
Typical - usage during general computing and web browsing
Video Playback (SD) - power usage while watching a standard definition video
Video Playback (HD)
- power usage while watching a high definition video
FLAC to MP3 Conversion - a real world test intended to load the CPU but not the GPU
Gaming (Mafia) - test performed in Windows to give a reference for an older game
Gaming (Half-Life 2) - test performed in Windows to give a reference for a newer game

Here are the specs and power test results for my laptop, desktop, and HTPC.

Dell M1330 Laptop
  • Intel T7250 Core 2 Duo CPU (2.0 GHz, 65nm)
  • nVidia 8400m GS GPU
  • LED backlit LCD display
  • 65W power supply
  • OS - Ubuntu 8.04 Linux & Windows XP SP2
  • Off - 0W
  • Standby - 0W
  • Idle - 23W
  • Typical - 27W
  • Video Playback (SD) - 30W
  • Video Playback (HD) - 36W
  • FLAC to MP3 Conversion - 45W
  • Gaming (Mafia) - 54W
  • Gaming (Half-Life 2) - 56W
Desktop
  • AMD Athlon 64 X2 3800+ CPU (2.0GHz, 90nm)
  • nVidia 7900GS GPU
  • 500W Antec Earthwatts power supply
  • OS - Windows XP SP2
  • Off - 2W
  • Idle - 99W
  • Typical - 105W
  • Gaming (Mafia) - 130W
  • Gaming (Half-Life 2) - 158W
HTPC
  • AMD Athlon 64 3200+ CPU (2.0 GHz, 90nm)
  • nVidia 7600GS GPU
  • 250W Shuttle power supply
  • OS - Mythbuntu 8.04 Linux
  • Idle - 67W
  • Video Playback (SD) - 69W
  • Video Playback (HD) - 80W
  • FLAC to MP3 Conversion - 96W
  • 4 Day Average - 67.5W
Going into these tests I knew that the laptop would draw the least power, but after looking at the data I have come to a few interesting conclusions:
  1. Percentage wise the jump in power usage between the two gaming examples on the laptop vs the desktop are very different. This is most likely due to the considerably more capable Core 2 Duo CPU in the laptop not having to do nearly as much work as the Athlon 64 X2 in the desktop. Also the much more powerful GPU in the desktop has extra settings turned on (such as anti-aliasing) that are not used on the laptop.
  2. As in #1 the laptop doesn't have to work much harder to play HD video than SD video, while the HTPC must do considerably more work to achieve the same performance.
  3. I was pleasantly surprised to see how efficient my HTPC is. Recently I had been considering upgrading to a newer more efficient processor and motherboard, but after this test I don't feel I would be saving too much power. As you can see from my 4 day average test, the system runs at idle almost all the time. 67.5W per hour spread over a month is 48.6KWH. According to my last electric bill I pay $0.0455 per KWH, therefore the cost to run my HTPC for the month comes to only $2.21. Even with a new machine twice as efficient I would only be saving about $12 a year. This savings hardly offsets the hundreds I'd have to invest in a new system when my existing HTPC still performs adequately.
These tests were a lot of fun to do and I plan on doing more on the rest of my electronics in the near future.

Labels:

Sunday, May 4, 2008

GPS Receiver (minor revision)



In my previous post I brought up several ideas regarding how I wanted to upgrade my GPS receiver. After further investigation, most of my ideas are not practical for a variety of reasons. The PIC microcontroller I was planning on using does not support the math functions I would need to calculate directions and distances between waypoints. Even the saving of waypoints became far too complicated when I attempted to code it (due primarily to the way the GPS passes information). This was made even more difficult because the larger LCD I was planning on using would have required a much larger case than I wanted to use and thus was eliminated as well.

Long story short, the only change made to my GPS was its external appearance. This was accomplished by getting a new frontpanel and replacing the two slide switches with push-on-off switches, as you can see in the photo. 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.

As I mentioned previously I could most likely completely rebuild this project using the much more powerful Arduino and a larger LCD to accomplish my design goals. However, such an undertaking's cost would approach that of a commercially available GPS unit with considerably more functionality.

Labels: , ,

Monday, April 28, 2008

GPS Receiver Revision Ideas

In the seven months that I have been using my GPS Receiver I have been thinking about a lot of improvements I could make that could greatly improve the usability and power of the unit. The following is my wish list of improvements.
  1. Rechargeable battery - while running off of a standard 9V has its advantages; having a battery with more capacity, lighter weight, and smaller size(assuming I would use a Lithium-Polymer battery) would be very handy
  2. Ability to save GPS Waypoints - I had thought about this from the beginning of the project but was somewhat lazy and didn't look into it too much; now that I have used the unit for a few months I realize that adding this capability is a must
  3. Distance & Direction calculations between GPS Waypoints - this idea came about from doing the calculations by hand on a calculator which isnt' difficult but still a pain
  4. User Interface Upgrades - this aspect of the revision directly follows the ideas listed above, especially upgrading the display and adding a rudimentary menu structure to allow the saving of waypoints and performing calculations; I also want to change the backlight switch from a slide switch to a press and hold momentary pushbutton
Since I first developed this wish list I have done some analysis into what I would have to do to realize these upgrades. I considered the possibility of completely rebuilding the unit based around the Arduino, especially since I could upgrade the software via the USB port at any time. The arduino, however is somewhat overkill for this application (16K Flash & 512 bytes EEPROM) and is also a rather large board to fit into a small handheld device with an LCD and GPS receiver. The arduino does come in another form factor called the Arduino Mini. While this is much smaller, at $37 for the unit itself and another $20 for the USB adapter, it is a larger financial investment than I am willing to make for an upgrade of a device such as this (considering I already spent $100 on the current unit).

The rechargable battery has also turned out to be somewhat unfeasible. I did find a small LiPoly battery charger board for $17 and a 1100mAh LiPoly battery for $12 at Sparkfun. This isn't too much money, especially since a rechargeable battery pays for itself over time, but since the charger only works with single cell batteries (which only put out 3.7V) it is not compatible with a 5V system such as this and using multiple cells could get complicated.

After further research I realized that the PIC16F84A that I based the current unit off of contains 64 bytes of EEPROM which could be used to save waypoints. I recalled, however, that my current GPS program is running toward the limits of the PIC's 1024 word Flash memory. The solution to this problem comes from the fact that the PIC16F84A has been replaced by the PIC16F628A. The 16F628A is a pin-for-pin equivalent to the 16F84A so I can reuse my existing circuit board and simply program the new chip and drop it into the existing socket. The 16F628A has the added benefit of 2048 words of Flash and 128 bytes of EEPROM. This should allow the 16F628A to have enough program memory to implement my UI changes and the calculation options I would like to add as well as store up to 32 waypoints (4 bytes per waypoint). The best part is that I have a couple of these lying around so it costs me nothing. The only items I will have to purchase will be a larger LCD, a new case and a couple of switches.

Labels: , , ,

Tuesday, March 25, 2008

Panel Meter Clock (Part 2)


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.

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

Labels: ,

Monday, March 24, 2008

Freeduino (Arduino Clone Kit)


The Freeduino is a great kit for those interested in the Arduino platform. It is essentially identical to the Arduino Diecimila, but made with through-hole components to allow for easy assembly as a kit. I assembled mine in about 30 minutes. Unlike my homebrew Arduino, the Freeduino shares the Arduino's form factor and therefore is interchangeable with the pre-assembled board (including compatibility with the various shield kits that are available for the Arduino). Another benefit of the Freeduino is that, due to its onboard female headers, it allows for prototyping without the use of a solderless breadboard.

Pictured above is a side-by-side comparison of the finished Freeduino kit (on the left) and my scratch built Arduino.

Labels: ,

Wednesday, March 12, 2008

Panel Meter Clock (Part 1)



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).

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

Update (3/27/08)
I discovered that the hour scale did not behave properly (it took longer than an hour to move the gauge 1 hour). I checked the code and found that the hour code was set to run on a 24 hour scale, while my hour gauge has a 12 hour scale. After editing the code to account for this difference (and adding some comments), the clock now runs properly.

Labels: ,

Monday, March 10, 2008

Arduino (Part 2)

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.

Labels: , ,

Saturday, March 8, 2008

Arduino (Part 1)



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).

Labels: ,

Sunday, February 10, 2008

Aqua Teen Hunger Force Animated LED Art




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:

video

Labels: , ,

Trippy RGB Light Redux


I decided to rebuild the Trippy RGB Light with a single RGB LED instead of three individual LEDs. I also changed from a 3 Volt supply to a 4.5 Volt supply. As a result I also had to change the resistor values (Blue - 150 Ohm, Red & Green - 270 Ohm). The video shows a marked improvement over the previous version.
video

Labels: , ,

Saturday, January 26, 2008

Trippy RGB Light



This is another project that modifies the MiniPOV kit, similar to the LED Cube project I did previously. This time, instead of an LED matrix, one Red, one Green, and one Blue LED are used to create a multi-color light show by utilizing pulse-width modulation of the AVR's output. The construction is very similar to the LED Cube in that I also built the RGB from scratch. I did not, however, include an ISP header this time around because I felt the original program was adequate for a project of this scale. If I later decide to rebuild this project using multiple better quality LEDs I will definitely include an ISP header to be able to reprogram the RGB for other light shows.

In order to program the RGB Light I had to modify the makefile code for use with my USBTiny ISP in the same manner I did in the LED Cube project. This project is very simple to build and it produces an interesting light show. With some better quality LEDs with more diffuse viewing angles this could be even better. I will most likely rebuild this at some point in the future with more appropriate LEDs. Check out the video of my Trippy RGB Light in action (with a plastic bag between the RGB Light and the camera to diffuse the light for better color mixing).

Links
video

Labels: , ,

Saturday, January 12, 2008

LED Camera Light




This is project is originally from ProdMod and I built my version of one in about an hour. I had been looking for a way to put a camera light on my digital camera, especially for video, and this project fits the bill perfectly. All this camera light consists of is a modified 4-AAA battery case (with built-in switch) which has a 3/4" long 1/4" cap screw passing through it and 3 white LEDs wired to the batteries. To use it you simply thread the screw into the tripod mount on your camera and turn it on.

I used a different parts source than the original article, getting both the white LEDs and AAA battery case from Mouser Electronics. The cap screw can be purchased as a pack of 2 from Home Depot for $0.88. Other than that my camera light went together the same as the original article, with the exception that I used a 15 Ohm resistor instead of a 10 Ohm to protect the LEDs. I chose this in order to add the flexibility of using regular alkaline batteries or rechargeable batteries. Since alkaline batteries produce 1.5 Volts typically, three alkalines produce 4.5 Volts. Rechargeable nickel-metal-hydride batteries produce 1.2 Volts typically, so three batteries produce 3.6 Volts. This voltage differential means the current limiting needed to keep each LED's current draw under 2o mA is different if using alkalines or NiMH batteries. For the LEDs I chose from Mouser, the 15 Ohm resistor used with alkalines produces a current of 63 mA or 21 mA per LED. If using NiMH batteries this would amount to approx 17 mA per LED. Therefore, the 15 Ohm resistor is a good compromise that allows me to not worry about battery type.

Labels: , , ,

Monday, December 3, 2007

LED Cube



This is another project I found via the Make Magazine Podcast. It is very simple to build, especially if you do what the original project recommends and start with the MiniPOV kit. Just follow the podcast's directions and modify the kit to get up and running. I took a somewhat different route. Since the MiniPOV is based off of an Atmel AVR 2313 microcontroller, and I have several of these chips and an AVR programmer, I built the project from scratch and modified it to use the AVR's in-system-programming (ISP) capability instead of a serial port like the MiniPOV. Otherwise my hardware ended up identical to the original.

On the software end I had to make some changes to the code from the project's ZIP file. I modified makefile to look for my USBTiny ISP instead of a serial port. Then all I had to do was follow the remainder of the podcast's instructions to compile, build and program the AVR. To make different LED animations all that is required is modify the LED code matrix in the ledcube.c file to make different LED configurations light up for different amounts of time. Check out the video of one of my animations. Definitely a fun, easy project.

Links
video

Labels: , ,

Friday, September 28, 2007

USB Device Charger


This was a nice, simple project that is also very useful. Called the Minty Boost, as soon as I first read about this device I wanted to build one. Basically it transforms the 3 Volts from 2-AA batteries into 5 Volts and has a USB connector to attach the device you wish to charge (IPod, Sansa, cell phone, etc.); the bonus is that it all fits inside a Altoids Gum tin. You can build this from scratch, but some of the parts are somewhat uncommon and the printed circuit board is made to fit inside the tin so I just bought the kit (full kits are $19.50, PCBs are $5). It is a very simple kit to build and takes only about 30 minutes to complete. Then you just stick it in an Altoids Gum tin and you're done. Now I can charge my Sandisk Sansa's battery even if I don't have a computer or an outlet around.

Labels: ,

Saturday, September 22, 2007

AVR Programmer


As you can probably tell from my last couple of posts I have been getting into projects involving microcontrollers. While the GPS receiver I built used a PIC, many projects use an AVR instead. Made by Atmel, they are a direct competitor to the PIC. For a good comparison of the two check out this article. One of the more unique differences is that AVRs allow for in-circuit-programming. This means that you can plug the programmer into a header-pin assembly in the AVRs circuit and reprogram the AVR without having to pull the chip out of the circuit like with a PIC.

After seeing several interesting projects using AVRs in the MAKE Blog, I decided it would be a good idea to make an AVR programmer. Just like with my PIC programmer I did not want to be tied to a serial port and I didn't want to have to spend too much. I did some investigating and found the USB Tiny ISP. It is offered as a kit (or you can build if from scratch) for $22. The kit goes together very easily; the directions on the website are well written and detailed. Mine is pictured above and so far it functions perfectly. AVR projects are now in my near future.

Labels: ,

GPS Receiver (Part 2)




In the previous post I described how I 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. 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.

The picture on the right shows the receiver as completed; 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. The center picture shows the 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. The last picture is the schematic for the receiver unit.

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)

Labels: , ,

Sunday, September 16, 2007

GPS Receiver (Part 1)


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. In part 2 I'll talk about how I powered this project off of batteries, integrated it into an enclosure, and provide my final schematic and parts list.


Parts List:
Links:

Labels: , ,

Monday, September 10, 2007

Analog Synthesizer Modification



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 here; that could be used to transform a single +9V input into both +9V and -9V. It is a really clever circuit 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.

Labels: ,

Monday, August 13, 2007

Vacuum Tube Audio Amplifier



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.

Labels: ,

Tuesday, June 12, 2007

Analog Synthesizer


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.

Labels: ,