Tuesday, May 26, 2009

RF Transmitter/Receiver and my new AVR

I have just picked up a new AVR microcontroller, the AT90USB647 AVR. This one has a built in USB controller, very neat. Its much larger than the previous AVRs I have used (Atmega8, Atmega48, Attiny13). One of the reasons I purchased this microcontroller was because my AVR-ISP programmer is compatible with it and the other is that it has USB functionality.

For a while now, I have wanted to make use of my RF transmitter and receiver. As I have stated before, I am rather cheap at this time, and I purchased a basic transmitter and a basic receiver. They are seperate modules, the transceivers are a bit too fancy for me right now.

As I put this circuit together, my goal was to implement a basic loopback system to test RF and USART functionality. The USART is handling the hardware protocol for RF transmission. The program I wrote sends data via the RF transmitter to the RF receiver and displays data received on Port A through 8 LEDs.



Everything in my circuit built and program being executed. The red wires sticking straight up are acting as my RF antennaes and surprisingly enough make quite a difference.

Gyroscope - Angular Rate Sensor

So I was looking for a new sensor to tinker with and I really wanted an Accelerometer. However, I am cheap and don't have a whole lot of money and so I bought a Gyroscope instead. This sensor measure the angular rate of movement. So here it is.


The Angular Rate Sensor XV-3500CB Gyroscope

Of course I did my usualy thing, build a test circuit to utilize this sensor. Using an Atmel Atmega48 AVR microcontroller I interfaced this sensor to it and used an LED light bar to indicate the rate of movement. To be honest, I was rather dissappointed with this sensor, it was well kind of boring. Its circuit is already designed and built onto this chip, using I2C bus or an A/D Converter, so no external hardware is needed.

And the last thing about Gyroscopes, they are not widely used. They don't give position, only angular movement. So one can use an Accelerometer instead, poll it periodically, and compare those positions with respect to time and calculate angular movement with some Physics.


Thursday, March 26, 2009

Flex Sensor and a Servo

My next project begins with a flex sensor. A strip of material that when flexed varies the resistance of the sensor. At a straight or 180 deg "flex" it gives a resistance of 9k Ohms, roughly. It can give up to 18k Ohms at about 90 deg or fully flexed. Now to interface the sensor to my AVR's A/D converter and measure that resistance.

Now to add a basic hobby servo to the system, a Futaba S3003 Servo. It has three wires Red, White, and Black meaning Voltage supply, Signal, and Ground, respectively. A while back I had developed some basic C code to control a servo and now is the time to test it.

What I want to do is control the servo via the flex sensor. Basically, the flex of the sensor controls the position of the servo motor. Hmmm, interesting applications with this concept. Here are a couple of pictures from my circuit in the works.


Some Flex:


More Flex:




Thursday, March 5, 2009

Breakout Board For My AVR

Now with my ISP device, I need a breakout board for my AVR processor. A breadboard works well from time to time but something more permanent is needed. So looking through my inventory on hand I found a protoboard that would work well.



The first thing I started with was the positioning of the processor and sockets for Port Pins. Then I moved on to adding IC sockets for EEPROM, a Real Time Clock, and a D/A Converter. After that I soldered on two pin terminals for easy interfacing to the chip's onboard A/D Convert Channels. The last things I have added are a LCD contrast pot and a system reset button. Now to wire everything up so the breakout board actually works.

Thursday, February 26, 2009

The AVR-ISP Lite Programmer

Well it finally came in this week and I figured out how to get it to work. I have programmed a couple of microcontrollers to test the ISP device. My collection now includes the Atmel Atmega48s and Attiny13s in addition to my Atmega8s that I was previously using.


My Attiny13 hooked up to the ISP device. I interfaced a Green-Red LED to demonstrate functionality of the programmer.


Yay! The LED is blinking Red and Green. Now back to the drawing board for the next idea.

Wednesday, February 25, 2009

SMD Soldering & Prototyping

My AVR-ISP lite programmer finally came in the mail today (only 3+ weeks). And now I can begin some other projects that I have been waiting to do. With that in mind I now need to solder on my Atmel Atmega48 chips onto a breakout board.




My starting point: the board by itself.










The first thing to do is line up the ic chip perfectly on the board. I really want to emphasize the perfectly part because smd solder does not allow for many mistakes or much tolerance.


Once the chip is lined up, you need to hold it in place to be solder. I use electrical tape to keep it in place temporarly. After that, you can finally solder the first pin down. I typically solder another pin down to hold the chip in place.




Once the chip is held in place, I solder a line across all four sides of the chip covering all the pins. At this point its fine to have sloppy solder down.









Once that was done, I took solder braid and sucked up all the excess solder to reveal nice soldered connections. Can not even till that they were done by a simple soldering iron.
Now my chip is ready to use. Hopefully the ISP programmer works.

Sunday, February 22, 2009

Working with EEPROM



In this project I have interfaced a I2C based EEPROM (Microchip 24LC32) to the Atmel Amega8 AVR. The program will read the first 4 bytes of an EEPROM and display the contents on the LCD. I have added external interrupts to enable erase and program of the EEPROM upon an external key press.The external interrupts are driven by falling edge and have 10k pullup resisters tied to them. In the interrupt routine, erase or program mode flags are set.This can then be used as a simple i2c EEPROM programmer with basic read, write, and program modes.

Saturday, February 21, 2009

My Temperature Data Logger

I have built a Temperature Data Logger for my Atmega8 around the LM34DZ Temperature sensor. This is somewhat of an expansion of my Temp Sensor project. In this project I have utilized a DS1307 Real Time Clock to trigger a A/D Converter sample every 10 seconds. The 10 seconds is an arbitrary value and I just used it for convenience.





My program is basically a simple state machine with 5 states. The '0' State is the default start up state and gets the first temperature reading. The '1' State is the time triggering state and it waits here until 5 seconds have elasped. The '2' State samples the ADC for a temperature reading (I used a 10k trimpot to test functionality). The '3' State processes the temperature samples and determines the high, low, and average values in addition to the current temperature. The finally State ('4') places everything in a "pretty" form to display on my lcd.




The Sensor range is 0-1000mV or 0'F - 100'F. 10mV = 1'F.







I eventually want to add EEPROM or Flash memory and USART functionality to my system. The I2C bus is already being used so EEPROM won't be a huge step up. I have added an optional Fan Control. Replace that main.c file with the original to have a basic Fan Control System. It compares the current temp to a threshold value (I set it to 75) and sets a bit once its reach or clears it if below. I have wired it into my circuit and tested it successfully with a 5V 0.3W Fan.


My Custom 5x6 LED Display

I built this 5x6 LED display from scratch and based it off of the link on avrfreaks main page. The project utilizes a method call row-column addressing for controlling the most leds. My project controls 30 leds with just 11 pins on the Atmega8 AVR processor. My starting point with the materials all sorted out and waiting to be soldered in.










I have updated the software for the display. I have used timers 0 and 1 to implement timeout functions. Timer 0 will strobe the led display 100us for every row and update the display. Timer 1 will update the data to be displayed every couple of seconds. This current project will count from 0 to 9 and repeat itself. In the next picture I have soldered on a couple of leds to get started. Also I have started to sort the rows and columns for the LEDs.

















Here is the completed project with all of the leds soldered on. Next I have to add a cable to interface this

project to a microcontroller.





This is the completed project all interfaced to my Atmel Atmega8 AVR microcontroller and ready for software.



A video of my LED display in action, go LEDs.