Reply
Thread Tools
Posts: 71 | Thanked: 34 times | Joined on Sep 2009
#11
Originally Posted by patstew View Post
For example the full 3 axis/I2C interface (it can give a 3D compass bearing) hmc5843 is only $20 here
Thanks for the tip; searching on the hmc5843 led me to this breakout board which might be easier to work with: http://www.sparkfun.com/commerce/pro...oducts_id=9371

Also this guy is working on an I2C compass using the 5843 and has some notes on interpreting the output of the 5843.

I have to honestly admit this stuff is a bit over my head right now, but it certainly seems feasible. One thing that seems complicated is the orientation of the sensor. The vector math at the above link seems to indicate that an up-down tilt has no effect, but a sideways tilt would need accelerometer correction. Since the n900 has accelerometers this can probably be done, but I don't have a clear idea about exactly what would need to be done yet.

Anyone with more knowledge/experience in magnetometer circuits, feel free to share
 
Posts: 69 | Thanked: 53 times | Joined on Aug 2009
#12
The problem is that although you know the direction of north relative to the phone, you don't know how the phone's screen is orientated, so you can't show a 2D compass on the screen. Imagine holding your phone so that the camera is pointing due north. You would probably expect your phone to show N with an arrow pointing upwards, but to know what upwards means you either need to take information from the accelerometer, or tell you users to only use portrait mode, or to hold their phone flat.
Alternatively you could render a 3D arrow onto the screen which would avoid the whole issue.

To do the 2D case properly you need to consider 3 (unit) vectors : the vector from the compass, m, which points north, the vector from the accelerometer, a, which points down, and a vector pointing into the screen, s (along the z axis). What we want to do is pretend that a and s are the same. To do that you take the angle between a and s, the axis perpendicular to a and s and rotate m by that angle about that axis. Since naturally a and m are perpendicular, this should leave m as a vector in x-y as far as the phone is concerned, which then can be displayed (remember that x-y-z of the phone and compass are the same).

I bet that was clear as mud. And it won't work near the poles, or if you shake your phone. To fix it near the poles you would need to project m onto the plane perpendicular to a first.

I think the 3D option is best, especially when the hardware (omap3) is there to do it nicely. Also, the 3D vector option is actually exactly what you want for AR applications.

Last edited by patstew; 2009-09-19 at 20:06.
 
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#13
Originally Posted by patstew View Post
The problem is that although you know the direction of north relative to the phone, you don't know how the phone's screen is orientated, so you can't show a 2D compass on the screen. Imagine holding your phone so that the camera is pointing due north. You would probably expect your phone to show N with an arrow pointing upwards, but to know what upwards means you either need to take information from the accelerometer, or tell you users to only use portrait mode, or to hold their phone flat.
the accelerometer shows absolute orientation of the device.
all we lack is the direction.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#14
i just tried to close the back case of the n900 with a uk penny behind it
i could not find a way to close it without it popping back out - ie not much space.
the case is however fairly thick ruggedised plastic, so it may be possible to lap enough of an indent for the chip to sit ontop of the battery and within the case.

(instead of lapping, a small heated branding unit could make the required indent?)

not sure if the case itself is thick enough for this but if anything is wanted inside, i think in absense of nokian engineering, its down to hardware mods.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk
 
Posts: 1 | Thanked: 0 times | Joined on Sep 2009
#15
Originally Posted by Otaku View Post
Thanks guys - the n900 looks super, but the lack of a compass is painful enough that I'm determined to find a DIY solution. After all, the n900 is aimed at hackers, right?
Agreed. Check out:

http://www.media.mit.edu/resenv/tricorder/tricorder.htm

It was done a while ago with an N770 and an expensive compass, but the idea is similar and it looks like the same hardware might work with the N900.
 
Posts: 69 | Thanked: 53 times | Joined on Aug 2009
#16
Originally Posted by lcuk View Post
the accelerometer shows absolute orientation of the device.
all we lack is the direction.
Sorry if I wasn't clear, I was replying to Otaku, and trying to make it clearer when/why an accelerometer is needed for a compass app. The rest of my post relys on the fact that accelerometer shows absolute orientation of the device

Unless we can find a spare I2C bus inside the N900 (seems unlikely without some help from nokia, and even if there is a spare I2C port in theory I bet the soldering would be pretty hard/impossible) there doesn't seem like much point in internal mounting. IMHO the best thing to do would be a flat circuit board, flush to the top of the N900 and attached with a usb plug on one side and the microcontrollers on the other. Unfortunately there would be a need for some other components since the compasses run at 2.5V (USB is 5V) and need external capacitors. If a 2.5V-capable microcontroller was used, that would make it 3 chips, including a voltage regulator. The compass is 4x4mm, a chip like the PIC18LF13K50 is 7.2x7.8mm in its SSOP form (it runs on 2.5V, and supports USB and I2C in hardware, so only a few lines of glue code should be needed on the chip. It costs a massive $2.50) and an appropriate voltage regulator like a TC1014 is 3x3mm. Along with the 3 required capacitors, which will take up a few more mm^2 it would all fit on a board of ~ 10x20mm and only be a couple of mm thick. That wouldn't be that much on the 18x60mm end of the N900. It would also be a soldering nightmare with all those surface mount components, but at least the board could be one sided. Also this method would give you the ultimate power saving option of simply unplugging it.

I put the model numbers down here in case I decide to have a crack at this one day.
 
Posts: 69 | Thanked: 53 times | Joined on Aug 2009
#17
Everything I wrote above may in fact be pointless, as I suspect that the N900 doesn't have usb-otg at all, since it looks as if it has a micro-B socket. USB-OTG devices are required to have a micro-AB socket. If that's the case, then no usb host mode.
 
Posts: 220 | Thanked: 19 times | Joined on Jun 2006
#18
my opinion is; use modules from spark fun as they are easy to use.most of the electronics is done for you. I would use
1 compass
2 bluetooth module
3 microcontroler card a very simple one is all thats needed
4 power supply
5 a baseball hat and some determination
It should cost you about 200 bucks but you would learn alot putting it all together
 
Posts: 1,213 | Thanked: 356 times | Joined on Jan 2008 @ California and Virginia
#19
Originally Posted by patstew View Post
Everything I wrote above may in fact be pointless, as I suspect that the N900 doesn't have usb-otg at all, since it looks as if it has a micro-B socket. USB-OTG devices are required to have a micro-AB socket. If that's the case, then no usb host mode.
The OMAP3 supports OTG and Host. The n800 did not have a AB socket, but could do host mode through software switch. I don't use OTG on my n810, but instead the host mode software switch. So its probably fine.
__________________
----------------------------------------------------

www.ezschool.com - The best online educational experience.
 
Posts: 71 | Thanked: 34 times | Joined on Sep 2009
#20
Originally Posted by patstew View Post
Along with the 3 required capacitors, which will take up a few more mm^2 it would all fit on a board of ~ 10x20mm and only be a couple of mm thick. ... It would also be a soldering nightmare with all those surface mount components
What about the sparkfun breakout board for the HMC5843 compass chip?

http://www.sparkfun.com/commerce/pro...oducts_id=9371

It has the capacitors already mounted, with just 4 easy-to-solder lines for the I2C and power supply. The board is 12.7x12.7mm: it increases the size a little bit, but could probably make the soldering feasible for mere mortals such as myself.
 
Reply


 
Forum Jump


All times are GMT. The time now is 07:34.