DIY Digital Compass (for your car)
I’m astounded that some cars don’t have a digital compass always visible. You either have to launch the navigation app each time which may even disappear when you adjust the radio. In this project, you’ll create a digital compass that can be powered by by the cigarette lighter or another source (batteries make it handheld). You could buy one, but where’s the fun in that?
You’ll use an awesome OLED screen (with amazing viewing angles), a magnetomter, and Arduino (with a zombie apocalypse mode Easter Egg) to create this cool gadget. If you just want to see the code, I have it in a Gist: Compass.ino. I put it in a Gist so that other people can make edits and improvements to it.
- Arduino Pro Mini 328 – 3.3V/8MHz I got the 3.3v version for simplicity of connecting it to the other 3.3v parts (Sparkfun).
- SparkFun Triple Axis Magnetometer Breakout – HMC5883L This compass breakout can be mounted in any orientation (Sparkfun).
- SparkFun Micro OLED Breakout This is the screen form the MicroView, but the Arduino + Screen is cheaper than the MicroView and its programmer (Sparkfun).
- Protoboard It doesn’t matter what you use, but this is what I got (Sparkfun).
- Power Source I just cut the end off a 30-pin 5v car charger that I had. It was useless and lying around. The Arduino can handle an input from 3.3v to 12v DC.
- Thin wire You’ll need this to make jumper connections on the perfboard. My was about 24 AUG. I used both stranded and solid wire for different parts.
- Headers This will make it easy to attach the components to the protoboard.
- Why no accelerometer? An accelerometer would allow for automatic adjustment of orientation and declination angle, but this is mostly intended to be a more permanent thing, and you can learn about how the declination angle works.
- Wire cutters They must be capable of cutting the size wire that you have
- Metal file These are for making notches in the perfboard
- Sandpaper I used both 110 and 200 grit to clean the hole in the case.
- Another Arduino with USB You’ll use this to program the non-USB arduino. I used my Arduino Mega 2560.
- Logic Level Converters If your other Arduino with serial over USB is 5v, then you’ll need this to bring its serial voltage down to 3.3v for the Pro Mini (Sparkfun, Adafruit).
- Breadboard This for prototyping everything originally and testing it out.
- Soldering Iron and solder
- Solder wick and/or solder sucker I prefer the wick, but you’ll probably need one or the other.
For More Details: DIY Digital Compass (for your car)
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw
This Post / Project can also be found using search terms:
- arduino digital compass
- arduino digital compass project