Simple LED Compass

Discussion in 'The Projects Forum' started by Jkirch86, Nov 5, 2012.

  1. Jkirch86

    Thread Starter New Member

    Nov 5, 2012
    4
    0
    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.
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,123
    3,047
    Get a sensor with analog output. As is, you need a microprocessor.
     
  3. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,130
    267
    Use some optical sensors to detect the position of an analog magnetic compass needle.

    Really simple.
     
  4. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
  5. Jkirch86

    Thread Starter New Member

    Nov 5, 2012
    4
    0

    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.
     
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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".
     
  7. Jkirch86

    Thread Starter New Member

    Nov 5, 2012
    4
    0
    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?
     
  8. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    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 :)
     
  9. Jkirch86

    Thread Starter New Member

    Nov 5, 2012
    4
    0

    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.
     
Loading...