May 21st, 2008

My first AVR code

This is my first AVR project. After going trough the tutorial i was telling you about a couple of days ago and after testing the “Blinky” project i decided to make my own Blinky. So i came up with this idea that the led’s should start lighting from the middle and move to the sides, when they reach the sides blink a couple of times and come back to the center.

I was actually quite easy to do it, i expected to be harder. I used the 8 LED board i designed in the avr butterfly starting guide.

Here is the LED’s in action:

You need to a flashplayer enabled browser to view this YouTube video

Here is a zip archive containing both the source and the compiled hex. The code was written and compiled in AVR studio.

AVR Butterfly is an evaluation tool demonstrating the capabilities of the latest AVR Technology. The tool is shipped with preloaded firmware supporting temperature sensing, light measurement, voltage readings and music playback. The AVR Butterfly is controlled by an ATmega169.

It’s basically the cheapest development board on the market, $21.28 as we’re speaking at Digikey. I choose to start with the AVR Butterfly because it is also featured in all examples in the tutorial I’m reading. The tutorial is easy to follow and i recommend it if you want to start programming AVR’s in C language. You can find it at SmileyMicros.

The tutorial contains all you need to now, but some things are not entirely covered, and other things present incompatibility issues.

When ordering the Butterfly its also a good idea to order some pin headers because they are not included. When you take the Butterfly out of the box it should look like this:


Now it would be nicer if they would of included those pin headers in the package. And here is my Butterfly after i soldered the pin headers.


Another thing that i noticed about this step, is that my Butterfly doesn’t have the LDR, it seems that this version only comes with the NTC soldered on the back, which is also an analog sensor and it should be enough for developing code with analog sensors.

The next important thing that you need to solder is the RS232 cable, because the communication between the computer and the Butterfly is done via RS232.

Hers is a picture of my cable, and how it should be done. (disregard the connector i used, its taken from an old computer case, that’s why its saying turbo sw).


Notice how the RXD and TXD from Butterfly are reversed on the RS232 connector ? That’s because what you transmit here has to be received there. Pay attention on soldering this connector, you will avoid future headaches. But what if you don’t have an RS232 connector on your computer ? the answer is simple you buy a RS232 to USB converter cable, like i did:


I could of done myself the cable using the schematic from this article, but the parts cost more than a commercial cable, not to mention the hours you put in fabricating.

Now about the battery, the onboard CR2450 isn’t gonna last too long with the projects that you’re gonna work with. So its best to build an external power supply. I build mine with 2 x AA-R6 battery holder.

2xaa-battery-external-power-supply-for-avr-butterfly avr-butterfly-with-pin-headers-soldered-and-power avr-butterfly-with-external-power-connected

From this step on, you can approach things two ways, either use a breadboard or fabricate PCB’s. I don’t have a breadboard so i had to make pcb’s. Basically its just a board with 8 LED’s, 8 current limiting resistors and some headers for linking it to the Butterfly.

here is the Eagle schematic and board file.

details on how to fabricate the PCB are covered in my DIY PCB Tutorial.

Here are a couple of pictures with the board after being etched and after being assembled. The 8 LED board is going to be used with the Blinky Project.

boards-after-beeing-etched 8-led-board-after-beeing-assembled

I also did two small PCB’s for driving an RGB LED, one for a CA version and one for CC version.(Common Anode and Common Cathode). I will use this boards later when i will be experimenting with PWM control.

Here are the RGB LED boards assembled.


And to end this article here is a picture with the USB to RS232 cable connected to the AVR. Now all i have to do is read and learn the next 300 pages from the tutorial.


Now i started working on a lab power supply, i could of just buy one but its more fun to build it. Here is a picture where i just started the assembly. The project should be up soon at my personal projects page.

May 15th, 2008

Parts orders arrived

Today my parts order arrived, i got a little from everything 🙂 . Some of the parts were ordered from DigiKey and were very nicely wrapped and others were ordered from local suppliers. There will be many projects posted on the Personal Projects page, so check the site regularly.

Here is a picture with most of the parts on the table


As you can use i got 10 57 LED matrix’s which i will use in some LED Display projects.

I also got an AVR Butterfly because I’m going trough a AVR Programming Book. By the way i didn’t knew so far that the AVR Butterfly is the cheapest development board on the market(taking to consideration all of its features).

AVR Butterfly out of the box

And here is a picture of my stash. I took me a full day to arrange all the parts. Ofcourse i took my time and enjoyed doing it. 🙂


May 12th, 2008

AVR Butterfly GPS System

AVR Butterfly GPS System

The handy Butterfly GPS is a cost-effective system that presents location, date, and time data on its LCD. The system features an ATmega169 and a highly sensitive GPS receiver engine board based on the SiRF chipset. Its amazing what you can do with such a low cost development board.

AVR Butterfly GPS System: [Download Project][View Project PDF]

 Blind Spot Detection System

Blind Spot is an area of the road that cannot be seen by the driver while looking forward or through either the rear-view or side mirrors. Such Blind Spot Detection System are already present in many cars.  In this project the ATmega169 uses a high-intensity infrared light to detect approaching vehicles. Although the system works, i would only recommend you build it for testing purposes, not for long therm use. Why not use it for long therm ? Well no one guarantees that the system would not fail.

Blind Spot Detection System: [Download Project][View Project PDF]

© 2007-2011 YourITronics | Any logo, trademark and project represented here are property of their respective owners | Wordpress | Privacy Policy    RSS