Simple LED Compass

Thread Starter

Jkirch86

Joined Nov 5, 2012
4
I'm working on a project for a simple 4 led compass.

I am using a 3 axis compass module with IIC output.

What I need is a way to turn the leds on or off when the compass is pointing north, south, east, and west.
For example I will use 1 red, 1 blue, 1 green, and 1 yellow. When the compass is heading north, only turn the red on, when east turn the green on, south = yellow, and west = blue.

Any recommendations for the simplest and smallest way to do this?

Thanks for all the help.
 

THE_RB

Joined Feb 11, 2008
5,438
The simplest and smallest way IS likely a microcontroller.

The compass module with I2C output has no clock speed issues so you could use a cheap 8 pin PIC with internal osc (no xtal or high speeds needed) and I2C comms to the compass module and 4 LEDs.
 

Thread Starter

Jkirch86

Joined Nov 5, 2012
4
The simplest and smallest way IS likely a microcontroller.

The compass module with I2C output has no clock speed issues so you could use a cheap 8 pin PIC with internal osc (no xtal or high speeds needed) and I2C comms to the compass module and 4 LEDs.

I think I will try this.
I don't have much experience with microcontrollers and I'm hoping to learn a little with this project.

Would I be able to use an Attiny in place of the Picaxe?
I have the tools to communicate and program an AVR chip but nothing for a Picaxe.
 

THE_RB

Joined Feb 11, 2008
5,438
If you have AVR tools then by all means use AVR. :)

You will need AVR code to do I2C comms, that should be easy enough to find if you google for "AVR code I2C comms to XXX compass module".
 

Thread Starter

Jkirch86

Joined Nov 5, 2012
4
Ok, I've ordered a couple of parts, now I need to decide on the power.

I've decided to use an ATtiny85 (Specs)
And a HMC5883L compass (Specs)

I'm trying to make this as small as possible and was hoping to use one 3 volt button cell battery mounted on a pcb. I don't think this will be enough to power the MCU, compass, and one led at a time though.

Any recommendations on supplying power?
It would need to run for at least 6 hours.

Also, it would only need to take readings maybe once a second. Would it be possible to change the clock to sample at longer times to conserve power, or is it worth trying?
 

BMorse

Joined Sep 26, 2009
2,675
or to save with all the hassle of programming a uC or working with analog, you could just use a sensor like the Dinsmore 1490 digital compass module like this >> http://www.morse-code.com/id32.htm, all you would need are a few passive components for the LED's, power and the compass module :)
 

Thread Starter

Jkirch86

Joined Nov 5, 2012
4
or to save with all the hassle of programming a uC or working with analog, you could just use a sensor like the Dinsmore 1490 digital compass module like this >> http://www.morse-code.com/id32.htm, all you would need are a few passive components for the LED's, power and the compass module :)

That looks like it would be ideal and very simple.
I have already ordered a few parts to try it with the attiny so if it doesn't work out, I will get one of these for sure.

I don't know yet if tilt will be a problem. The Dinsmore compass can only tilt up to 12 degrees. If I do have problems with tilt I should be able to add an accelerometer later on that will work with the compass I ordered.
 
Top