There are many reasons why you may need an RS485 bus. Imagine you have a cluster of microcontrollers and/or embedded computers far away from each other. Then an RS232 or TTL serial connection is not useable, because the cables are to long, the signal is damped and data cannot be transmitted. With a RS485 bus it is possible to use a cable length up to 1200 m (with a data transmission speed of 100 kbit/s). The RS485 bus normally uses two wires, + and -, this configuration allows to use it half-duplex (members can talk to each other but sending and receiving at the same time is not possible).

RS485 half duplex communication

GarminDakota20My girlfriend bought a handheld gps with an integrated compass sensor. I was fascinated by watching the virtual pointer turn around (in realtime) depending on the current heading. That was the moment were I was inspired and thought that this could not be that hard and can easily be rebuild.

So I decided to try it by myself. Because I had all the necessary things laying around it was pretty fat forward to get started.

  • Arduino Mega
  • LCD Shield
  • Jumper Wires
  • Compass Module: Just ordered the HMC6352 on a breakout board from sparkfun

First I tried to retrieve data from the HMC6352 module and tried to display it with the LCD shield.

It is a bit tricky to get the heading data from the HMC6352 module, because it is connected to the Arduino via I2C. Therefor it is very important to have the datasheet at hand (and the knowledge how to read and send data wih the arduino via I2C).

How to read and send data via I2C can be found at the Arduino Playground.