maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   DIY digital compass: electronics experts needed! (https://talk.maemo.org/showthread.php?t=31861)

Laughing Man 2009-09-29 02:33

Re: DIY digital compass: electronics experts needed!
 
Perhaps, nobody else has pointed this out but..

How on earth would AR applications take off on the n900 if it doesn't have a digital compass built in? Assuming if you did get a digital compass on the n900 working then you have the problem with you have to assume the developers of such AR applications also have an n900 + digital compass. Or that the next Nokia device comes with a built in digital compass and that the application can be back-ported.

sarahn 2009-09-30 03:18

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by Laughing Man (Post 335785)
Perhaps, nobody else has pointed this out but..

How on earth would AR applications take off on the n900 if it doesn't have a digital compass built in? Assuming if you did get a digital compass on the n900 working then you have the problem with you have to assume the developers of such AR applications also have an n900 + digital compass. Or that the next Nokia device comes with a built in digital compass and that the application can be back-ported.

The n800 did not have a GPS built in so there's some precedent for peripherals being used which are not built into the device. Granted the cost is !!!!! way more than I want. At this point I am skeptical though that usb won't work with the right SW and if a cell phone battery can be used instead of the sparkfun stuff that would also help a lot.

sarahn 2009-09-30 03:22

Re: DIY digital compass: electronics experts needed!
 
Additionally, the cool things we build for ourselves can be just that, for ourselves. :)

kwantam 2009-09-30 20:49

Re: DIY digital compass: electronics experts needed!
 
I don't know if there is continuing interest in this topic, but I can contribute a few bits of information and opinions.

NXP has a decent application note on building an electronic compass:
http://www.nxp.com/acrobat_download/...22_COMPASS.pdf

Note that to do tilt compensation you'll either have to combine magnetic field data from the magnetic sensors with tilt information from the N900's accelerometers or just put a 3-axis accelerometer on the external board. Assuming that there is access to raw 3-axis tilt info, the former is obviously preferable cost-wise (an ADXL320 runs $15 in single quantities).

The Honeywell HMC5843 seems to be the best candidate for a three-axis magnetometer, since it handles temperature compensation and offset correction by itself. There exist cheaper magnetoresistive sensors, e.g., the KMZ51 and KMZ52 mentioned in the above app note, but then you also need a preamp, ADC, temperature sensor, et cetera. Beyond that, to get three axes out of the KMZ5x parts, we need to mount one of them perpendicular to the other!

If it's possible to connect the HMC5843 directly to an I2C bus on the N900, we're done with the hardware. Otherwise, it's USB or Bluetooth depending on what resources are available. There's a lot of rumor right now, so we'll probably have to defer this discussion until the phones are actually in our hands. Clearly, not having to add a microcontroller and its consequent cost and power draw to the bill would be preferable.

The software to actually produce a compass reading will take the magnetic and gravitational data and do some math to turn it into a heading. From there, you can even use GPS data to easily convert from magnetic north to true north if desired.

lardman 2009-10-01 08:47

Re: DIY digital compass: electronics experts needed!
 
I'm certainly still interested, though I would prefer to pay more and just get a pre-built Bluetooth unit (usb not working and all).

Anyway do all keep up your investigations, should make for some cool apps if these things can be made :)

sarahn 2009-10-01 16:04

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by lardman (Post 337337)
I'm certainly still interested, though I would prefer to pay more and just get a pre-built Bluetooth unit (usb not working and all).

Prebuilt? My google-fu has failed me. :)

qole 2009-10-01 17:08

Re: DIY digital compass: electronics experts needed!
 
Mine too. And the google-fu* is strong in me.

*google-fu means "excellence of searching"

lardman 2009-10-01 19:33

Re: DIY digital compass: electronics experts needed!
 
Well yeah, I'd just like to buy something rather than make it. Not that said device actually exists....

allnameswereout 2009-10-01 23:34

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by lardman (Post 337738)
Well yeah, I'd just like to buy something rather than make it. Not that said device actually exists....

Maybe those who make the hack will share schematics MAKE-style, or start a business from it, or Craves1 passes by... :)

lcuk 2009-10-02 00:45

Re: DIY digital compass: electronics experts needed!
 
there are still a few days to post proposals to the Nokia Push N900
they do not have to be finished models, just the idea to build one and a bit of a plan.

http://blogs.nokia.com/pushn900/

have a go, draw up a components list, find someone with some circuitry skill to help with layouts and tell them how its going to work and what you want to do with it.

Lord Raiden 2009-10-02 01:04

Re: DIY digital compass: electronics experts needed!
 
This might sound really, really stupid, but since the n900 has GPS on it, why not just use the GPS as a compass? As long as it can get a 3D lock, it can tell you what direction you're facing. Even my Garmin can do that.

bocaJ 2009-10-02 04:55

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by Lord Raiden (Post 337941)
This might sound really, really stupid, but since the n900 has GPS on it, why not just use the GPS as a compass? As long as it can get a 3D lock, it can tell you what direction you're facing. Even my Garmin can do that.

That would depend on movement - your garmin GPS knows your direction when you're moving down the highway at 60, but not when your standing still (unless your particular model actually has a built-in compass).

sarahn 2009-10-02 17:30

Re: DIY digital compass: electronics experts needed!
 
I suggest adding wiki page http://wiki.maemo.org/Digital_compass_howto for pure tech info like SW references BOM list

Laughing Man 2009-10-04 03:55

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by sarahn (Post 336476)
The n800 did not have a GPS built in so there's some precedent for peripherals being used which are not built into the device. Granted the cost is !!!!! way more than I want. At this point I am skeptical though that usb won't work with the right SW and if a cell phone battery can be used instead of the sparkfun stuff that would also help a lot.

True, but were GPS apps made before the n810 was around? It could be later hardware had such capabilities (GPS) and since everything internally was also the same, you can do the same functionality on the n800 + bluetooth or USB GPS.

So we might see something where the next Maemo Nokia device has a magnetic compass, and software used there could be backported to the n900.

attila77 2009-10-04 07:29

Re: DIY digital compass: electronics experts needed!
 
Unfortunately compass is not that easy - it has to be physically connected to the device (as in, turn/rotate with it) otherwise it's not too useful.

Otaku 2009-10-04 07:32

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by attila77 (Post 339145)
Unfortunately compass is not that easy - it has to be physically connected to the device (as in, turn/rotate with it) otherwise it's not too useful.

My enduring hope is that the unit can be made no larger than a USB stick, enabling you to easily hold the N900 and the compass at the same time.

sarahn 2009-10-05 15:42

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by attila77 (Post 339145)
Unfortunately compass is not that easy - it has to be physically connected to the device (as in, turn/rotate with it) otherwise it's not too useful.

As I discussed earlier, you would build it into a case which would give a known orientation. The unit, if not the battery, would be on the back of the device.

sarahn 2009-10-05 16:03

Re: DIY digital compass: electronics experts needed!
 
Actually, I have a pretty good idea now for n900 push if someone who is up to date on fremantle is willing to partner with me (I can put together HW and hopefully do the magnetometer calculations, but these are all very low level things. I haven't touched maemo proper since chinook.)

lcuk 2009-10-05 16:15

Re: DIY digital compass: electronics experts needed!
 
damn that craves1 for being missing.
someone try and get him into this thread, he might be able to help.

Otaku 2009-10-25 04:08

The analog compass solution: periscope + ball compass
 
I was pleasantly surprised to discover that the parts necessary for an analog compass solution are available in off-the-shelf form.

Here's the idea.

0. Hold the device in landscape mode. World-facing camera is facing forward; user-facing camera is facing the user and is at the upper-left corner of the screen.
1. Place a periscope-like mirror on top of the user-facing camera. This directs the line-of-sight of the user-facing camera downwards. Such a periscope mirror, intended as a phone accessory, can be seen here, here, here and here.
2. Hold a miniature ball compass beneath the periscope mirror. Such a ball compass, intended as a phone accessory, can be seen here, here, and here.
3. Use image processing to capture the image of the ball compass and determine its orientation. Make this orientation available to other applications such as AR or mapping apps.

The merits of this approach are:
1. Cheap.
2. No power needed.
3. Relatively small: parts are originally intended for mobile phone use.
4. Graceful degradation. Just by having the analog compass available, you can manually look at your orientation and drag an on-screen compass to rotate a map or an AR display. With the mirror and the image processing, this could be automated, but automation is not strictly necessary.

I managed to find these parts in a local store, but you can probably order them over the web as well. Total cost was around $30.

The main technical hurdles to implementing an automated image-processing solution would be:
1. Sufficient lighting for the camera to recognize the compass. A small battery-powered LED might work.
2. The ability to use both cameras at the same time (world-facing camera and user-facing camera). Unknown if the hardware supports this.
3. Mechanical: some kind of a bracket to hold the mirror and the ball compass in place.

Given the difficulties posed by a real digital compass solution (tiny parts making for difficult soldering, high cost, external battery, lack of USB host), the analog solution seems to be an alternative, at least for people like me without skills in surface-mount soldering.

At least, buying these parts gave me something to do while I wait for the N900 to become available :)

ysss 2009-10-25 08:18

Re: DIY digital compass: electronics experts needed!
 
@otaku:

Oh, I've done something like that too.. but mine adds a full featured camera to a phone:

http://yaflamingalah.files.wordpress...ith-camera.jpg

Otaku 2009-10-25 09:16

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by ysss (Post 357598)
@otaku:

Oh, I've done something like that too.. but mine adds a full featured camera to a phone:

Looks good, but where's the compass? :)

I realize the analog compass solution is kludgy, but if you built a small tube/shaft containing the periscope mirror at the top and the ball compass at the bottom (with optionally an LED+button battery for illumination), it would be a one-piece, compact unit that would only need to be pressed against the user-facing camera to be used, and could be pocketed when unused.

It seems that the other solutions are:
1. Pre-built compass module + bluetooth module (e.g. from SparkFun) + battery.
2. Custom PCB + surface mount compass chip + bluetooth chip + battery.
3. Ready-made serial compass module OS-5000.

Based on the hardware modules I found by searching the web, option 1 would probably be bulkier than the analog compass solution. Option 2 could potentially be made small, but the battery will still make it bulky, and it requires equipment to etch a board and do surface-mount soldering. Option 3 would be very small, but requires USB host and costs almost $300, which probaby most people will agree is too pricey.

I guess we can still hope for Option 4, that the shipping delay is due to Nokia adding a built-in compass...

I'm not saying the analog solution is optimal, just that for someone like me without PCB/SMT tools or skills, it seems like a workable, low-cost, low-risk kludge. The small analog compass strap is also at least useful by itself.

qole 2009-10-26 23:38

Re: DIY digital compass: electronics experts needed!
 
Rather than a periscope, what about some kind of lens that could be placed between the camera and the compass that would allow the camera to focus on a tiny ball compass pressed right against the camera? That would certainly be more compact and lit would allow more light to shine on the compass...

attila77 2009-10-27 01:57

Re: DIY digital compass: electronics experts needed!
 
Just a small note... Don't bet too much on the user facing cam, the image quality (with the current, prerelease firmware) is so bad it needs to improve to earn being called atrocious. :) :(

Otaku 2009-10-27 12:03

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by attila77 (Post 358717)
Just a small note... Don't bet too much on the user facing cam, the image quality (with the current, prerelease firmware) is so bad it needs to improve to earn being called atrocious. :) :(

You've actually used the user-facing camera? Great! This is the first report I've heard about it.

Could you describe in more detail the quality issues? Or better yet, could you post some images? Preferably of small objects in distances from zero to a few cm in front of the camera lens, to simulate the ball compass...

attila77 2009-10-27 13:02

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by Otaku (Post 358924)
You've actually used the user-facing camera? Great! This is the first report I've heard about it.

See this project as there have been a lot of comments there that were camera related.

Quote:

Could you describe in more detail the quality issues? Or better yet, could you post some images? Preferably of small objects in distances from zero to a few cm in front of the camera lens, to simulate the ball compass...
Qole described it being similar to a bad UHF TV reception :) Macro focusing is a no-go, it's infinity locked. Image from other thread.

R-R 2009-10-27 15:30

Re: DIY digital compass: electronics experts needed!
 
Painful fact, we won't be able to do this.

qole 2009-10-27 17:05

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by R-R (Post 359038)
Painful fact, we won't be able to do this.

...Whew. Thank you, Nokia, for sparing us from that. :D

http://cache.gawker.com/assets/image...00x_aghelm.jpg

muwimax 2009-10-27 20:21

Re: DIY digital compass: electronics experts needed!
 
"N900 DOES have digital compass! It’s just not in use yet. We’ll see new applications that use the digital compass soon i think." http://www.geekwithlaptop.com/nokia-...-specification is this true?

qole 2009-10-27 21:34

Re: DIY digital compass: electronics experts needed!
 
As true as the "Voice command / dial" four lines below.

ie. NO.

muwimax 2009-10-27 23:19

Re: DIY digital compass: electronics experts needed!
 
how did I missed that =D thanks

wickeddeus 2009-10-28 18:38

Re: DIY digital compass: electronics experts needed!
 
I don't know if this has been suggested yet but why not use the same digital compass that is currently in the Iphone 3GS (and all of the Android phones, I believe)? The unit is Asahi Kasei's AK8973S. From the specs I was able to pull from the internet, the chip-size packaging is 2.5 x 2.5 x 0.5 mm. I don't know if it is technically possible but someone might be able to fit it inside a microSD body (microSD being 15 mm × 11 mm × 1 mm). It might even be possible to make the card do double duty as a digital compass plus memory storage.

Otaku 2009-10-31 04:01

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by qole (Post 358637)
Rather than a periscope, what about some kind of lens that could be placed between the camera and the compass that would allow the camera to focus on a tiny ball compass pressed right against the camera? That would certainly be more compact and lit would allow more light to shine on the compass...

Interesting idea. Do you know any cheap lenses that could be used for this purpose? I found this DIY macro lens for cell phone cameras using a DVD player lens. Looking at the pictures from that site, it seems that this macro allows only for very, very close-up shots, so it might in fact be too close. For image processing you would need to capture the entire image of the ball, which letters you can see (N,S,E,W), and from there determine the ball orientation. If you can only see a tiny super-close-up portion of the ball, it would be harder to determine the compass orientation.

Also, I tried placing the small ball compass next to my current cell phone and noticed there are some magnetic "hot spots" where the compass won't work due to magnetic interference. So, depending on the magnetic fields around the user-facing camera, the position of the ball compass may need to be adjusted. A mirror allows more flexibility in placement of the compass.

The ball compass usage instructions actually say it should be held 8cm away from the phone to avoid magnetic interference. I'm hoping though that there will be some magnetic "dead zones" on the N900 so it won't be necessary to separate the compass from the phone (but again, a periscope mirror allows exactly such separation, though it then looks even more kludgy....)

Further investigation will probably need to wait until the N900 is available to try out various positionings of compass/lens/mirror and find a positioning that prevents magnetic interference and allows clear focusing on the ball compass.

Otaku 2009-10-31 04:02

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by wickeddeus (Post 360137)
I don't know if this has been suggested yet but why not use the same digital compass that is currently in the Iphone 3GS (and all of the Android phones, I believe)? The unit is Asahi Kasei's AK8973S. From the specs I was able to pull from the internet, the chip-size packaging is 2.5 x 2.5 x 0.5 mm. I don't know if it is technically possible but someone might be able to fit it inside a microSD body (microSD being 15 mm × 11 mm × 1 mm). It might even be possible to make the card do double duty as a digital compass plus memory storage.

I suspect that the "someone" who would be able to pull this off would have to be a professional with access to specialized ($$$) soldering/etching equipment. Imagine trying for yourself to solder a 2.5 x 2.5 x 0.5 mm chip and associated support components, and etching a board that would fit inside a microSD body - it's not something most people are likely to be able to do in their homes.

Then even if someone could do this, that leaves the problem of how to enable to rest of the communty to do the same thing, to allow a compass-enabled N900 community to exist and encourage developers to make compass-aware apps. As was pointed out earlier in the thread, compass-aware apps like AR can't take off if the compass-enabled userbase doesn't exist.

If someone could get a good automated compass production process going, and was willing to sell the resulting compasses for a reasonable price, I suspect they would get a lot of business from N900 users. However, again I think that few people in the community have the resources to pull this off. I'm willing to be surprised, though. :)

bocaJ 2009-10-31 05:21

Re: DIY digital compass: electronics experts needed!
 
I'll just put out there that I have a friend with ties to some Chinese manufacturers, who expressed some interest in an N900 project, so if there is a serious electronics engineer in the community who can accomplish the design for something like this, I would love to help arrange the mass production side.

MrGrim 2009-10-31 07:27

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by wickeddeus (Post 360137)
I don't know if this has been suggested yet but why not use the same digital compass that is currently in the Iphone 3GS (and all of the Android phones, I believe)? The unit is Asahi Kasei's AK8973S. From the specs I was able to pull from the internet, the chip-size packaging is 2.5 x 2.5 x 0.5 mm. I don't know if it is technically possible but someone might be able to fit it inside a microSD body (microSD being 15 mm × 11 mm × 1 mm). It might even be possible to make the card do double duty as a digital compass plus memory storage.

This isn't plumbing you know. It's not only about fitting it, it's mostly about integrating in the circuit. I somehow doubt the AKwhatever will be able do directly 'talk' to the memory controller that manages whatever is in the microSD slot. And i'm pretty sure it's simply not possible to plug something into the mainboard without having extensive knowledge about how it works. The chances you'll not break something in new and interesting ways are pretty much like winning the lottery

Otaku 2009-10-31 08:00

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by MrGrim (Post 362242)
I somehow doubt the AKwhatever will be able do directly 'talk' to the memory controller that manages whatever is in the microSD slot.

This raises an interesting question: does the N900 support microSDIO? Here, for instance, is an example of a microSDIO WiFi card, so it apparently is possible to add IO devices via microSD.

wickeddeus 2009-11-02 17:32

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by Otaku (Post 362248)
This raises an interesting question: does the N900 support microSDIO? Here, for instance, is an example of a microSDIO WiFi card, so it apparently is possible to add IO devices via microSD.

This is exactly what I'm talking about. I know it's not something that people can do easily. But if the community demands it someone might pick it up and built (maybe Nokia themselves). I would imagine that a microSDIO card containing a digital compass would be easier then a Wifi one. Also since the card will be in the phone then it should have no issue with orientation.

impatient 2009-11-02 18:16

Re: DIY digital compass: electronics experts needed!
 
Stick a http://www.arasan.com/products/sdioinbox/sdioinabox.php to the smallest UART electronic compass you can find and your done.

sarahn 2009-11-03 05:02

Re: DIY digital compass: electronics experts needed!
 
Quote:

Originally Posted by wickeddeus (Post 360137)
I don't know if this has been suggested yet but why not use the same digital compass that is currently in the Iphone 3GS (and all of the Android phones, I believe)? The unit is Asahi Kasei's AK8973S.

In theory nothing. In practice, do you know if you can buy less than a few thousand? It is also extremely unlikely that chip will not also require glue logic.

I picked parts based on what was available for easy prototyping and what was available in quantities of 1 on digikey.


All times are GMT. The time now is 05:38.

vBulletin® Version 3.8.8