-
Log 05: Proof of Concept Prototype
05/28/2015 at 00:34 • 0 commentsFinally got to writing some sample code for the compass, based off of the Adafruit Arduino library (git repo here), and I've gotten the whole setup working. Now I just have to fix it up, streamline it, and then test it on an attiny. I've included some images of it working below. The first image shows the measured magnetic north and the second image shows the magnet I used for testing in the bottom left corner. Once I figure out the components/footprints I'll be using (mcu package, battery holder, etc), I plan on doing the board layout next.
-
Log 04: Sensor and Display Changes
04/23/2015 at 23:14 • 0 commentsQuick update: After a grueling month of waiting for the cheap ebay sensors to arrive, they are finally here! I've hooked one up and I'm in the process of writing some test code to get everything working on the breadboard. I neglected to get the sensor breakout board with level shifters on the I2C lines, so I've switched over to a Teensy for the prototyping since it's one of the few 3.3V boards I have. This also lets me drive each of the LEDs independently from their own pins, which simplifies things. I'm still planning on porting over to an AVR chip for the final board. However, I think I'll stick with 1 LED per pin, so I won't be using an attiny85 like I had originally planned. A picture of the current setup is included below, and hopefully I'll have it all working soon.
-
Log 03: LED Display
03/23/2015 at 02:17 • 0 commentsFor the visual interface of the compass, I am planning on using 8 LEDs laid out in a ring. Since I'm planning on using an ATTiny85 at this point, I would only have 4 pins for driving the LEDs (with 2 already used for the I2C connection to the magnetic field sensor). Thus I did some experimenting with different ways to drive the LEDs without any extra components.
I tried out charlieplexing first, but for only turning on a single LED at a time, the flicker was quite noticeable. Thus I tried out a different method, with only 2 LEDs / pin, in the following configuration:
So I soldered up a ring of LEDs and hooked everything up to a 5V trinket (from Adafruit) that I had laying around. However, I ended up having to use 3.3V for Vcc on the LEDs, since the resistors were not large enough to prevent both LEDs from turning on with 5V as Vcc. On the final PCB, I'll make sure that I choose high enough resistor values, but since this was just meant as a demo, the work around will do. Once I had everything hooked up, I noticed there was another issue: one of the LEDs would remain on even when coded to be turned off.
I made sure all the connections were good on the breadboard and the PCB, and that none of the wires were loose/shorting, but the same LED kept giving me issues. I tried switching the pins around, and apparently pins 3 and 4 of the trinket I am using have issues with Hi-Z mode (input mode), since none of the other pins had the same problem on any of the other LEDs. I'm not sure if there is just some capacitive coupling on pins 3/4 from somewhere else on the board or if there was some interference (although turning off the fluorescent lights didn't help at all), but I ended up just putting a 1 kOhm pull down resistor on pin 4 of the microcontroller (show below).
Doing so got rid of the problem, so I may have to do something similar on the final board, or even use a shift register or decoder chip for driving the LEDs. I would like to avoid doing that, as extra chips would require more power, take up more space, and increase the final cost. Hopefully getting rid of the reset pin (using it as I/O) won't cause any problems (fingers crossed that I can get the firmware right on the first go) but we'll see what happens.
-
Log 02: Starting Up
03/19/2015 at 22:48 • 0 commentsI managed to find some HMC5883L modules on ebay for <$1 US shipped, so I picked some up and now I just have to wait for them to arrive from overseas. If the tests go well, then I'm hoping to be able to desolder the components from one of the boards to use on the final PCB, which is why I ordered a few. For the brains of the device, I'm considering using an ATTiny85, as its the one of the smallest microcontrollers I have on hand and it has just enough pins to cover the I2C to the sensor and LEDs (2 LEDs/pin). I plan on testing the concept at some point, but ultimately I'm waiting on the sensors to arrive at this point.
EDIT: I also did a quick mockup of what it may look like (using Eagle and SketchUp) just to get rid of the blank image for the project.
-
Log 01: Brainstorming
03/18/2015 at 01:44 • 0 commentsAs an initial step in this project, here is some of my brainstorming: I'm aiming to power the entire device from a single CR2032 coin cell battery, it will have 8 LEDs to show the direction of north, and have at least 1 push button for user interaction. For functionality, I'm thinking that the user will just press and hold the button to display the direction of north on the LEDs and then the system will be disconnected from power when not in use. From some initial searches, the MAG3110 from Freescale seems like it may work, and I will probably end up using a small AVR chip for the microcontroller, as I don't have a PIC programmer at the moment. It's a fairly simple system, but I've included a block diagram of the system as it currently stands, and I doubt it will change too much over the course of the project.
System Block Diagram: