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: ,