Archive for the ‘avr’ Category

Firmware for the GPS tracking device

Wednesday, August 8th, 2007

After some trouble with my SMS sending routine I am finally able to show some working code.

Features so far

  • Displays menu via serial port if attached to PC
  • Can run unattended or interactively for debugging
  • Fetches GPS positions and sends them via SMS every two minutes

If the circuit is powered on, the following sequence will be executed:

  1. Boot up, switch on the GPS-GSM module
  2. Initialize the modem
  3. Fetch the GPS position, redo until position is fix
  4. Parse and format position
  5. Send formatted position as link to Google Maps as SMS
  6. Wait 120 seconds
  7. Goto 3

Rebuilding it

Well, now you have all information and sources to rebuild and program this device, at least you should. If not, please tell me, what is missing.

But I had some hints in the comments that this can be done easier with the built-in Python. There also other very promissing sources and that is definetely the next thing, that I want to try out. If that works fine, which is not really doubtful to me, I could drop nearly all the external components. That would make it cheaper, easier and smaller.

Nevertheless, the firmware can be useful, if you would like to see, which commands to use to talk to the Telit module.

Links

Downloads

Using Google Maps with a Mobile GPS Tracker

Saturday, July 28th, 2007

Two weeks ago I posted about how to interface an AVR microcontroller to a Telit GM862. You can read it here: Interfacing an AVR controller to a GPS Mobile Phone.
That post got listed on Hack-A-Day, Engadet and Makezine among many others! w00t! Thanks for posting and reading it, I really appreciate it.

This post will show you, how to use this equipement to send an SMS with your current position and how to display it in Google Maps.
google_maps2_small.png

(more…)

Interfacing an AVR controller to a GPS Mobile Phone

Friday, July 13th, 2007

Update: Part II Using Google Maps with a Mobile GPS Tracker is online.

My goal is to build a kind of a mobile tracker. There are many different use cases you can think of but one of the obvious is a device, that is able to report where it is. This device can be put in your car and it could trigger an alarm, if the car got stolen. Actually it could tell you where it is.

There are already mobile tracking devices out there, but they seemed to be too expensive and too closed for my needs. Another option is one of these new Nokia N95 which have built-in GPS. They are really nice, but about 600€, which is not a bargain. So I decided to do my own.

IMGP1475

(more…)

Using PROGMEM and EEMEM with AVRs

Saturday, June 16th, 2007

This post will give you a short example how to read and write EEPROM, and how to use flash memory as storage.

When you are jumping into programming microcontrollers many things are new and uncommon. At least to me as I used to develop in Java. This snippet may save you some time when you start playing with EEPROM and flash storage. Please note, that this is not a complete tutorial on this topic. You may find usefull links in the link section below.

(more…)

Cheap Sound Sensor for AVR

Sunday, May 20th, 2007

I searched the web for a cheap method to let the ATmega respond to sound. My knowledge in analog circuits is very limited, but what I do remember, is that you can not attach a electret mircophone to a controller pin. The signal of the microphone is just too small and has to be amplified. There is much of information out there, especially on diy amplifiers. I stumbled upon this little circuit here. It consists only of a handful of components:

  • 2 resistors 10k
  • 1 resistor 100k
  • transistor 2N3904
  • 2 capacitors 0.1u
  • electret microphone

Prototyping the amplifier

Putting things together on a breadboard.

IMGP1255

Actually I had no 2N3904 around, so I replaced it with a BC337. The circuit is a emitter circuit with voltage degeneration (I dont know if that exists in english). I dropped the couple capacitor and took the signal right away at the collector.

Prototyping with the ATmega

The sound sensing is done with the ADC of the ATmega. A simple program reads the analog value of the amplifier over and over. If the value (loudness) exeeds a specific level, an LED is lit.
IMGP1253

The schematic for rebuilding.
mic-schematic

The code can be found here mic_sensor.c. It is just hacked together and has lots of room for improvements.

Video

Here is a video that I made. Has lousy quality, for both, video and audio.


Click To Play

Conclusion

It was easy and worked pretty well. I enjoyed looking at the LED responding to the music. I haven’t recorded anything with this amplifier, it might sound awfull. Next steps could be playing the sound back or be able to analyze the sound (FFT). And (re-)learning more on analog circuit design.

Links

Synchronizing Fireflies

Friday, May 11th, 2007

I was always fascinated by the emergence of patterns. One I like most is the synchronization of hundreds or thousands of fireflies. First they flash randomly but after some time and influencing each other, they flash in sync.

The rule behind this is very simple. All fireflies have nearly the same frequency for their flashing, but their phase is shifted. If a firefly receives a flash of a neighbour firefly, it flashes slightly earlier.

This circuit simulates fireflies with small microcontrollers.

A single Firefly

The board consists of 25 fireflies. Every single firefly is self contained, there is no over-all controller. A single firefly consists of:

  • ATtiny13 microcontroller, 1k SRAM, 64 bytes RAM
  • Light Dependant Resistor (LDR)
  • LED
  • 2 resistors

IMGP1171

The circuit is the same as for the Programmable LED.

The complete Board

Assembling 25 fireflies on a prototype board is easy. Harder is to get the right distance between all fireflies. It has to be close enough to let one firefly influence another, but not the whole group.

The LEDs I used emit the light mostly straight up. So a kind of reflector is needed. I used a piece of paper which is located 5 mm above the LEDs. For the next version I would take LEDs with a wider light emitting angle and use a kind of diffuser, as proposed by Tod for his Smart LED Prototypes.

IMGP1200

Here is a video. It is a bit dark as my camera is not very suitable for this.


Click To Play

Links

Programmable LED

Wednesday, May 9th, 2007

Inspired by various LED Throwies, blinking LEDs and similar instructables I wanted to do my version of an LED controlled by a microcontroller.

The idea is to make the LED blinking sequence reprogrammable. This reprogramming can be done with light and shadow, e.g. you could use your flashlight.

How is it done?

It consists of an LDR, an LED and a tiny microcontroller. I used a ATtiny13v which is able to run with 1.8V. That makes it easy to power it with smallest batteries or even fruits.

schematic

Prototyping

All components can be easily used on a breadboard. Be aware, that you will need a separate programmer or an ISP adapter to program it.

The final version

The final version is powered by a CR2032 cell. It should have enough power for at least two weeks, depending on the light sequence it plays.

I have done a step-by-step instructable here.

IMGP1144

Here are some responses to the instructable

LED Clock

Saturday, May 5th, 2007

So this is my approach of an LED clock. There are zillions of LED clocks out there. Mine is some kind of retro and minimalistic version. It consists of

  • AVR ATmega8, 8 Kb, 4.096 MHz
  • Everlight 2.3″, LED Matrix, 8×5 LEDs
  • some resistors, capacitors and a quarz
  • optional serial connection for configuration

The LED matrix is used in landscape mode, that means it uses a very tiny font. Most characters fit in 3×5 pixels. The font supports only uppercase characters. Because the display has only 8 columns the message has to scrolled.

The display has the following features at the moment:

  • Displays a greeting message
  • Displays the current time, hh:mm:ss
  • Displays a custom message
  • Messages and current time can be modified via serial port

IMGP1238

Schematics
Here is the schematic of the LED clock. The Everlight 5*8 Dot Matrix was not available as part of the Eagle libraries, so I build the part on my own. It looks a bit clumsy as it is my first try to design components.

schematics

Here is a video of the LED Clock. You can see how it changes through different modes from telling the time to displaying a greetings message.

Click To Play
Click To Play