I'm not really good at finding places and direction but at least I'm able to read maps and compass. These days, GPS navigation systems are getting more popular, so probably some people would say why I need a compass. Well, first off, I like gadgets and if I can make one, that will be much better to enjoy it. So, I decided to make a digital compass for my car.
I started with very basic function, showing bearing and heading angle from a digital magnetometer on an LCD, but there are a number of digital and analog pins are left unused on the microcontroller (Arduino compatible, JeonLab mini) so I added a digital temperature sensor and a phototransistor to adjust the brightness of the backlight (single LED) of the LCD.
I still have more than a few pins available and have a plan to add more sensors such as an exterior thermometer, anti-theft device, etc. (any suggestion would be appreciated!)
The picture shown in this Intro page is the fully assembled and mounted on top of the interior mirror of my car showing the bearing, angle and current interior temperature. Unfortunately I didn't take a lot of pictures when I assembled the electronic parts, but I'm sure someone who are interested in making one of these will be able to follow easily the schematic diagram I will show in a couple of steps later.
Step 1: Part List
- LCD: 16x2 HD44780 LCD (white text on blue background): This is pretty popular LCD that you can find and buy easily.
- JeonLab mini v1.3: This is a minimalist Arduino board I made. There are a number of small Arduino compatible boards in the market so pick anything small that can be hidden behind the LCD.
- Digital compass: MAG3110 (bought an assembled one from ebay): I have tried other digital compass a couple years ago but couldn't make it work. But this one is relatively easy to program. I will explain this in detail later.
- Temperature sensor: TMP36: take a look at the datasheet from the Digikey link. It's easy to use.
- Phototransistor: LTR-4206E: I'm sure any other IR phototransitor will do the same.
- 7805 regulator: You know what this is. Car battery's charging and regulated voltage is 13.8-14.4V while we need 5V for the controller and the LCD.
- resistors and capacitors (see schematic diagram)
- Car battery jack
- prototyping board
- push button switch (normal open, N.O.) for calibration of the magnetometer
- solid copper wire (1mm in diameter) for bracket frame
- cable ties