View Full Version : DIY digital compass: electronics experts needed!
Hi,
OK, now that we have top-level conformation that the n900 has no digital compass (http://www.nokiausers.net/General/Q-A-Session-with-Jussi-Makinen-on-the-N900-Maemo.htm):(, I've spent some time trying to figure out what it would take to build a digital compass and somehow connect it to the n900, so that once AR applications take off we can still use them with the n900.
I'm not skilled enough in electronics to figure this out by myself, so I hope some of you can offer some advice or ideas.
Basically I think we would need two things: (1) a small digital compass that could be held with one hand flush against the n900 case so that the n900 and the compass move together, and (2) some way of getting the compass data into the n900.
For (1), I found the following compasses that seem promising:
a. OS5000-US (http://www.oceanserver-store.com/osevkitsorus.html). Digital compass with USB interface. Best candidate, but expensive: $299, about half the price of the n900 itself! :eek:.
b. R117-COMPASS (http://www.acroname.com/robotics/parts/R117-COMPASS.html). Digital compass, but no USB interface, instead using a timing pulse and an I2C interface. Reasonable price: $57.00.
c. Dinsmore R1655 analog compass sensor (http://www.robsonco.com/Dinsmore/). Provides analog signal only (http://www.jelu.se/shop/pdf/dinsmore%20r1655%20sensor.pdf); needs analog-to-digital converter to be useful. The sensor specifications (http://www.jelu.se/shop/pdf/sensor%20information.pdf) suggest some circuits for extracting the direction, and this project (http://basicrobot.blogspot.com/2009/07/compass-sensor-with-microcontroller.html) shows how to use a microcontroller to change the analog level to digital. It seems to be a bit involved. However, this sensor is cheap: $37.
Given one of these sensors, the next thing is to get the data to the n900. For that, I could imagine bluetooth or USB. Bluetooth would be nicer that the compass assembly could really be separate and only taken out of your pocket when needed; no need to plug it in to the n900. However I have no idea how complicated it would be to connect one of the above compasses to a bluetooth interface. Bluetooth also has the disadvantage of requiring its own power. USB would need a tethering cable or at least a plug, but might work easier, especially with the above compass (a) that already has a USB interface.
One bluetooth idea I had was to use the cheap Dinsmore analog sensor (c), hook it up somehow :confused: to a voltage-controlled audio oscillator that would produce a varying analog audio tone (mixture of the two sine waves that the sensor produces), connect that audio signal to an existing bluetooth headset's microphone, and grab the bluetooth audio signal on the n900 in software. Then on the n900, do signal processing on the (analog) audio signal to extract the orientation. This would be a wireless solution using an existing bluetooth headset with its own power supply, so no new bluetooth transmission circuit or power supply would need to be designed. It could also conceivably be made compact. Again, I don't know enough about electronics to know if this is feasible (in particular how exactly to connect the Dinsmore to a VCO and how to do the software signal processing).
Feasible? Any other ideas?
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? :)
quipper8
2009-09-19, 02:06
maybe
http://www.ocean-server.com/compass.html
They also have some sample source code for interfacing with the unit, although it is in C#
Their documentation says silabs.com has linux drivers...
quipper8
2009-09-19, 02:12
oh, sorry, I see that the os5000 you have in your post is from what I posted above. I agree, best candidate
I have tried a few AR programs on my g1. They really arent all the amazing , but I think the hack to get this to work is a worthwhile pursuit from a "cool" point of view.
If your going to hack maybe start here http://www.dealextreme.com/details.dx/sku.11691 with a prebuilt compass its only 13 bucks. There are more expensive devices there also but this one seems reasonable. It has output the the screen I would think that leaching from the screen input and dumping it through the usb would be easier than the bluetooth suggestion.
If the device had a usb connector built in then it would always be in the same orientation for the n900 and you aug reality apps wouldn't get confused by movement of the external compass.
Epi
If your going to hack maybe start here http://www.dealextreme.com/details.dx/sku.11691
Thanks, looks interesting. However one thing I'm worried about is the accuracy of the compass in a cheap device like that. The Dinsmore (http://www.robsonco.com/Dinsmore/) sensors have two types: a cheap kind that outputs only 8 directions (N,NE,E,SE,S,SW,W,NW), and a more expensive kind that is analog and can be decoded to 1-degree accuracy.
Any idea if the clip-compass you linked is accurate to the degree, or if it's just 8 directions?
Thanks - I'll also start looking at consumer digital compasses to see if there are some that look hackable.
One of the other compasses that was around 20 or so had good reviews on accuracy. to see if it viable 20 vs 299 sounds like a win win situation........
Found an interesting link: Interfacing I2C sensors with the Nokia n800 (http://www.harbaum.org/till/i2c_tiny_usb/index.shtml)! The project page says "Attach any I2C client chip (thermo sensors, AD converter, displays, relais driver, ...) to your PC via USB". Compass (b) above that I linked to has I2C.
It says that you need to enable USB host on the n800 - which I think is not yet supported on the n900. Still, this looks like the most promising lead yet.
jethro.itt
2009-09-19, 04:19
Now that the N900 supposedly has IR capability, that's one more connection type to consider. IrDA transmitter/receiver is typically directly connected to a UART, which is really easy to access in Linux.
You would need a clip to keep the IR LED aligned with the receiver on the N900, but software-wise it seems the simplest option. Hardware would consist of a simple 8-bit 8-pin microcontroller ($2 or less a piece) with an internal AD-converter and some support components. Atmel Tiny AVR series is a good fit, and the compiler suite (gcc) is free and runs on Linux. AVR gcc could even be made to run on the tablet if desired...
(Disclaimer: I'm an EE and do this stuff for living.)
Have a look at these, some are quite cheap http://www.ssec.honeywell.com/magnetic/products.html. For example the full 3 axis/I2C interface (it can give a 3D compass bearing) hmc5843 is only $20 here http://parts.digikey.com/1/parts/1599656-sensor-magnetic-3-axis-20-lcc-hmc5843.html
I something like that would be your best option, combined with the i2c to usb program above, or using one of the cheaper and simpler 2-axis magnetometers with a microcontroller that has an A/D converter (pic chips like that can cost about a dollar). Either option would probably be small enough that you could make it sit flush to the edge of the phone and attach via usb (so 3 axis would come in handy).
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/product_info.php?products_id=9371
Also this guy (http://wiki.openmoko.org/wiki/Talk:I2C_Compass) 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 :)
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.
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.
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.
CountDown
2009-09-19, 20:48
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.
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.
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.
smackpotato
2009-09-19, 23:42
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
Thesandlord
2009-09-19, 23:43
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.
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/product_info.php?products_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.
What about the sparkfun breakout board for the HMC5843 compass chip?
http://www.sparkfun.com/commerce/product_info.php?products_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.
Yea, that would also be a valid option, though if you want the easy soldering option, you would also have to get the big style microchip, and you still have to find a way to hold it all together, and it's getting a lot bigger. On the other hand I'm probably overestimating my own soldering skills too, the smallest thing I've ever soldered is a ps2 chip years ago. :o
As for making a separate bluetooth one, that sounds even harder to me, and more hassle getting batteries and chargers and stuff. Also it means that you would have to hold your phone and bluetooth box in alignment or it would be completely meaningless.
Since I've been assured that it will be possible to force the usb into host mode, that would be my choice of interface/attachment.
if you want the easy soldering option, you would also have to get the big style microchip, and you still have to find a way to hold it all together, and it's getting a lot bigger.
Oh, right - I didn't realize that the other chips you mentioned are also surface mount. Well, I did see this link the other day about DIY surface mount soldering using a toaster oven (http://www.seattlerobotics.org/encoder/200006/oven_art.htm), but I'm not sure I'm ready to pop electronics into kitchen appliances yet (my wife might also have something to say about that...)
If/when I get around to trying this, I'll probably use the bigger chips to ensure greater chances of me actually being able to build the thing. I imagine that as long as the device is small enough to be pocketable, so it can be taken out when needed, it would still be usable - though of course, smaller would be better.
EDIT - This seems to be a feasible way to solder the surface mount chips that would be involved: http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=100
Bad news. Looks like the n900, unlike its predecessors, does not have hardware support for USB host (http://talk.maemo.org/showpost.php?p=330352&postcount=339). Scratch the USB plans, looks like the DIY compass will have to use IR or Bluetooth to communicate with the n900.
vkv.raju
2009-09-21, 05:37
Bad news. Looks like the n900, unlike its predecessors, does not have hardware support for USB host (http://talk.maemo.org/showpost.php?p=330352&postcount=339). Scratch the USB plans, looks like the DIY compass will have to use IR or Bluetooth to communicate with the n900.
That is only for external use cases. But the OMAP inside N900 DOES support USB OTG. So, this may still work.
I really think you're going to want an external bluetooth unit. You really don't want to be hacking your brand new (expensive) phone by carving away the inside of the plastic back, or something equally risky.
Especially since, as Bratag pointed out, AR apps just aren't there yet in terms of maturity or usefulness.
It will be fun to build, and fun to goof around with, but maybe a BT unit stuck to your N900 with some velcro is your best bet right now...
I really think you're going to want an external bluetooth unit. You really don't want to be hacking your brand new (expensive) phone by carving away the inside of the plastic back, or something equally risky.
Especially since, as Bratag pointed out, AR apps just aren't there yet in terms of maturity or usefulness.
It will be fun to build, and fun to goof around with, but maybe a BT unit stuck to your N900 with some velcro is your best bet right now...
I also agree with using bluetooth.
I use a cover for my n800: http://www.amazon.com/gp/product/B000P277C2/ref=ox_ya_oh_product
and I think it's reasonable to stick this device into a cover which would give you a known orientation.
My gut says you could do this for under a hundred bucks, if not half that, if you spin your own board. People charge you an arm and a leg for breakout boards.
I don't think spinning your own is as bad as it sounds, and I'm willing to buy an extra toaster oven for surface mount. :)
Though prototyping with the breakout boards makes sense to do first.
Biggest concern on my part is power which may make the widget infeasible to use.
Bluetooth sounds good, but what chips/components would you use to connect e.g. the HMC5843 compass chip (which has an I2C interface) with a Bluetooth module? SparkFun has a BlueSMiRF Gold (http://www.sparkfun.com/commerce/product_info.php?products_id=582) Bluetooth module that is pretty small, but it seems to take RS232 as input, not the I2C that the HMC5843 has. How would you interface the two? I found an I2C-to-RS232 module (http://www.i2cchip.com/), which could then connect the I2C device to the BlueSMiRF (http://www.i2cchip.com/pdfs/I2C2PC_Bluetooth.pdf), but the adapter module is as huge as a brick (http://www.i2cchip.com/#I2C-2-PC). That company says they are considering making an I2C-to-RS232 chip (http://www.i2cchip.com/monitoring_i2c_bus.html), but they haven't yet. I also found a supposed I2C-to-Bluetooth module (http://www.emv-electronics.com/de/intro/i2cbusadapter.htm), but I couldn't find it for sale anywhere.
There also seems to be an RS232 compass module (http://www.alibaba.com/product-gs/210672171/digital_compass_sensor_electronic_compass_module_s ensor.html) which could perhaps directly be hooked up to the BlueSMiRF. Minimum order quantity is 50, though.
Then there's also the issue of power - hooking up some batteries to this will increase the size even further...
I've got another really, really, REALLY low-tech idea about how to do this, but I'll only consider that if all else fails. Idea: use the low-res, user-facing camera to do image processing on an analog compass and determine its orientation :D This then becomes more a problem of mechanical rather than electrical engineering...
EDIT: Another potential compass module with RS232 interface that might be connectable to BlueSMiRF: TD-CMP03 (http://www.techdesign.be/projects/023/023.htm). Kind of large at 40x41mm. It has tilt compensation; I wonder if it can be held vertically upright against the N900 body, or if it has to be held horizontally. No word on its power consumption. Again, comment from electronics gurus would be welcomed... is it really as simple as connecting the RX/TX lines from the compass to a BlueSMiRF, and connecting the power?
Bluetooth sounds good, but what chips/components would you use to connect e.g. the HMC5843 compass chip (which has an I2C interface) with a Bluetooth module?
Is this chip a requirement?
Then there's also the issue of power - hooking up some batteries to this will increase the size even further...
Yes, I mentioned that.
As to the actual hardware, again I don't know exactly without going through all the options, but magnetometer tied directly to a bluetooth modem is probably not the best one from a size / cost perspective. You are also looking at modules which are expensive and bulky.
I am suggesting a custom board if there was going to be use beyond R&D.
Anyways, I'm going to wait for the n900 to be in my hands just in case this is some kind of bizarre easter egg (wasn't the radio tuner an easter egg in the n800?) In mid october maybe I take more time to look at it if nobody beats me to it..
Another question I have is if there's an existing library to take raw counts from the digital compass and turn it into a heading. I know there are differences also between true north and magnetic north and I don't know the magnitude of those differences.
allnameswereout
2009-09-27, 20:45
(wasn't the radio tuner an easter egg in the n800?)You can call it like that. The Bluetooth module included (a quite common one, by Broadcom) also had FM tuner. Free, it just was by default disabled due to lack of driver IIRC. The likelihood of such happening with digital compass... well, I wouldn't hold my breath.
Sigh. I'm way too obsessive.
Let me know if I screwed anything up. Attached is costed bom + misc for board / prototype in OO and csv format.
hopslink
2009-09-27, 22:59
Seems quite reasonable. Take a look at the RN-41 BT module, it has a built in antenna and is cheaper at digikey. I haven't looked at the datasheet but they claim a 30mA power draw when transmitting, which is less than you have estimated: http://www.rovingnetworks.com/rn-41.php
While it may be slightly easier to prototype with complete modules like arduino you will have to start again when you move to your final design. If you use one of the common, low end microcontrollers from Microchip (PIC) or Atmel (AVR) you should find very cheap programmers and free development tools exist along with loads of example code for i2c and serial comms. HTH
Seems quite reasonable. Take a look at the RN-41 BT module, it has a built in antenna and is cheaper at digikey. I haven't looked at the datasheet but they claim a 30mA power draw when transmitting, which is less than you have estimated: http://www.rovingnetworks.com/rn-41.php
I think meant to put down the rn-21 actually because physical integration looked easier. It still needs an external antenna according to the DS. I think I pulled 100mA off the datasheet somewhere but maybe it was the wrong one, thanks for pointing that out.
While it may be slightly easier to prototype with complete modules like arduino you will have to start again when you move to your final design. If you use one of the common, low end microcontrollers from Microchip (PIC) or Atmel (AVR) you should find very cheap programmers and free development tools exist along with loads of example code for i2c and serial comms. HTH
The arduino has the same chip I picked out, the ATmega328. In fact given it's creative commons, starting with an arduino schematic and adding bluetooth / magnetometer to it may be the best solution.
The one thing which is different from board to proto is the bluetooth module, and I am unsure that is a big deal. In fact I think for prototyping it may be better to use what was used with the n900 push http://blogs.nokia.com/pushn900/wp-content/uploads/2009/09/PUSH_N900_Hackers_guidev1.0.pdf
It is going to be in the sheet but not in the prototyping total.
I am going to update the original sheet. I would have used a smaller battery but there is nothing on sparkfun between 100mAh and 1100mAh right now.
So, do you think we could get money from Nokia to build what they should have put in in the first place? :P
Of course push n900 is for flashy, not for "I want to get navigation directions when I'm walking and have to stop at a crosswalk" which I see as being the first basic app.
texaslabrat
2009-09-28, 03:53
r "I want to get navigation directions when I'm walking and have to stop at a crosswalk" which I see as being the first basic app.
Well, if that's the main goal....I think I just solved your problem!
Behold the latest in high-tech navigation gadgetry:
http://www.dealextreme.com/details.dx/sku.8388
(since satire doesn't come across in writing...please note this is intended to be VERY tongue-in-cheek)
Well, if that's the main goal....I think I just solved your problem!
Behold the latest in high-tech navigation gadgetry:
http://www.dealextreme.com/details.dx/sku.8388
(since satire doesn't come across in writing...please note this is intended to be VERY tongue-in-cheek)
I know someone who lost several job interviews before he got a GPS due to showing up hours later, and still needs a GPS for routes he has used dozens of times ... a standalone compass would not help him much. :)
mannakiosk
2009-09-28, 20:56
Feel free to take this as a joke-post too, but...
With an old-fashioned compass, I guess one could build a contraption that would hold the compass in front of one of the cameras and use image recognition to get the bearing...
texaslabrat
2009-09-29, 01:06
I know someone who lost several job interviews before he got a GPS due to showing up hours later, and still needs a GPS for routes he has used dozens of times ... a standalone compass would not help him much. :)
Well, I wasn't suggesting that the compass would replace the GPS..rather the bolt-on electronic compass that is being proposed in this thread ;)
Well, I wasn't suggesting that the compass would replace the GPS..rather the bolt-on electronic compass that is being proposed in this thread ;)
I think it would take him at least 30 seconds to reorient himself every time he stopped. :)
Of course this might be a more interesting way of using the compass:
http://www.exothermia.net/monkeys_and_robots/2009/02/04/on-the-haptic-compass/
Image processing an analog compass would work if the compass is at a known orientation, but would be a hassle to use.
texaslabrat
2009-09-29, 01:22
No.... still not going to work for him. Trust me. :P
Well, lucky for your friend the N900 is also a phone so he can call a taxi rather than getting lost :p
The other thing being, now I can just listen to the robot voice tell me where to go on the headphones and not have to pull out the n900 at all :)
Laughing Man
2009-09-29, 02:33
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.
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.
Additionally, the cool things we build for ourselves can be just that, for ourselves. :)
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/applicationnotes/AN00022_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.
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 :)
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. :)
Mine too. And the google-fu* is strong in me.
*google-fu means "excellence of searching"
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
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... :)
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
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.
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).
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
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
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.
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.
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.
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.)
damn that craves1 for being missing.
someone try and get him into this thread, he might be able to help.
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 (http://images.google.com/images?hl=en&source=hp&q=%22%E3%81%A8%E3%81%AA%E3%82%8A%E3%81%8C%E6%92%AE %E3%82%8C%E3%82%8B%22+%E6%90%BA%E5%B8%AF+%E3%82%B9 %E3%83%88%E3%83%A9%E3%83%83%E3%83%97&gbv=2&aq=f&oq=&aqi=), here (http://www.strapya.com/images/medium/137/137-861905_MED.jpg), here (http://image.d-064.com/products/images/samnail2/611204) and here (http://store.shopping.yahoo.co.jp/keitai/137-861868.html).
2. Hold a miniature ball compass beneath the periscope mirror. Such a ball compass, intended as a phone accessory, can be seen here (http://images.google.co.jp/images?start=0&q=%E3%83%9F%E3%83%8B%E3%83%9C%E3%83%BC%E3%83%AB%E3 %82%B3%E3%83%B3%E3%83%91%E3%82%B9&btnG=%E7%94%BB%E5%83%8F%E6%A4%9C%E7%B4%A2&hl=ja), here (http://www.k4.dion.ne.jp/~east1/mini-ball-compass2_256.JPG), and here (http://a248.e.akamai.net/f/248/37952/1h/image.shopping.yahoo.co.jp/i/j/a-achi_ck-g-900).
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 :)
@otaku:
Oh, I've done something like that too.. but mine adds a full featured camera to a phone:
http://yaflamingalah.files.wordpress.com/2007/12/mobile-phone-with-camera.jpg
@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.
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
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. :) :(
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
You've actually used the user-facing camera? Great! This is the first report I've heard about it.
See this project (http://talk.maemo.org/showthread.php?t=33098) as there have been a lot of comments there that were camera related.
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 (http://talk.maemo.org/showpost.php?p=352807&postcount=40) from other thread.
Painful fact, we won't be able to do this (http://gizmodo.com/5390894/build-your-own-life-hud-with-a-smartphone-and-some-cardboard).
Painful fact, we won't be able to do this (http://gizmodo.com/5390894/build-your-own-life-hud-with-a-smartphone-and-some-cardboard).
...Whew. Thank you, Nokia, for sparing us from that. :D
http://cache.gawker.com/assets/images/4/2009/10/500x_aghelm.jpg
"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-n900-mobile-phone-specification is this true?
As true as the "Voice command / dial" four lines below.
ie. NO.
how did I missed that =D thanks
wickeddeus
2009-10-28, 18:38
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.
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 (http://www.diyphotography.net/super-macro-your-cellphone-camera-with-a-dvd-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.
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. :)
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.
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
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 (http://www.mobilewhack.com/reviews/spectec_sdw_823_microsdio_card.html), so it apparently is possible to add IO devices via microSD.
wickeddeus
2009-11-02, 17:32
This raises an interesting question: does the N900 support microSDIO? Here, for instance, is an example of a microSDIO WiFi card (http://www.mobilewhack.com/reviews/spectec_sdw_823_microsdio_card.html), 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
Stick a http://www.arasan.com/products/sdioinbox/sdioinabox.php to the smallest UART electronic compass you can find and your done.
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.
In theory nothing. In practice, do you know if you can buy less than a few thousand?
This is a good point. Some research on whether this device is obtainable is clearly in order.
It is also extremely unlikely that chip will not also require glue logic.
All it takes is an I2C interface and you're in business. You can find the AK8973 datasheet on the web, e.g.,
http://www.datasheetarchive.com/pdf-datasheets/Datasheets-2/DSA-37871.pdf
It's pretty clear from this that the interface portion is trivial.
I picked parts based on what was available for easy prototyping and what was available in quantities of 1 on digikey.
I assume you went with the Honeywell 3-axis magnetometer? I'm fairly confident the N900's tilt sensors can be used to do the tilt compensation, so the much more expensive tilt compensated one shouldn't be necessary.
In my mind, the question of AK8973 vs. HMC5843 isn't a useful one because they are substantially the same. Ideally, we'd be able to tap into an existing i2c bus and be done with it---we just need the IC and some bypass caps. Going through USB (assuming OTG support becomes available) will probably require a microcontroller and will be bulkier and uglier.
By the way, as nice as the SDIO idea sounds, it's probably no better than doing a USB interface, since SDIO<->I2C will still take a microcontroller, and the issue of mechanically supporting the compass module protruding from an SD slot is not one I want to tackle. USB seems better suited to this. (I say protruding with fair certainty having played around with the HMC5843 enough to ascertain that it is too thick to go inside said slot. The AK8973 is somewhat thinner, but is still too thick when you consider that you need to mount it on a PCB.)
wickeddeus
2009-11-03, 17:37
I wish I could find an actual picture of the AK8973 because in my imagination it would look something like the chip in this article: Atheros's AR6003 chip bring 802.11n to cellphones (http://www.engadget.com/2009/11/03/atheros-brings-802-11n-to-cellphones-with-ar6003-is-one-antenna/#comments)
kwantam: The person who builds a working USB interface for the N900 will be a Hacker Hero.
So maybe the first thing to do is build an SDIO->USB host adapter for the N900, and then all sorts of new gadgets are available...
I wish I could find an actual picture of the AK8973 because in my imagination it would look something like the chip in this article: Atheros's AR6003 chip bring 802.11n to cellphones (http://www.engadget.com/2009/11/03/atheros-brings-802-11n-to-cellphones-with-ar6003-is-one-antenna/#comments)
It's a 4mm x 4mm x 0.7mm rectangular prism. It has no leads, just 16 metal pads on the bottom. Google for "16 qfn" and you'll find images of one.
I assume you went with the Honeywell 3-axis magnetometer? I'm fairly confident the N900's tilt sensors can be used to do the tilt compensation, so the much more expensive tilt compensated one shouldn't be necessary.
Yes on honeywell, because again it's available in units of 1 and you can get a module at sparkfun for prototyping. I'm also told you can theoretically hand solder it.
Ideally, we'd be able to tap into an existing i2c bus and be done with it---we just need the IC and some bypass caps. Going through USB (assuming OTG support becomes available) will probably require a microcontroller and will be bulkier and uglier.
While I'm often willing to void warranties that goes a tad over my comfort level.
What's your target price point, and what volumes are you guessing?
So maybe the first thing to do is build an SDIO->USB host adapter for the N900, and then all sorts of new gadgets are available...
Do we know that the N900's MicroSD slot supports SDIO? And if it does, are drivers available? I seem to recall that licensing problems (http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/Where-are-the-opensource-SDSDIO-stacks/) prevented open source projects from making free SDIO implementations (which is why the Zaurus C-series, which supported SDIO in hardware, had hardly any actual SDIO products they could use).
The N900's MicroSD slot placement (inside the device) is also rather sub-optimal for attaching external USB gadgets. Maybe a hardhack could add a new MicroSD slot into the case (would require cutting a hole in the case) and connect it to the original slot with a ribbon cable. That might then allow you to connect various oddly-sized SDIO devices without needing to pop the N900's lid every time. Not sure if it would be worth doing, though, since the risk of permanently marring the case is pretty high.
sirflyalot
2009-11-04, 13:26
Go up to 10 people and ask them for directions to their house. I doubt that 3 of them will use the words, "North, South, East or West". Then ask each of them if they have ever used a compasss. 0 of 10 will have used a compass.
I would love to have a compass in the N900, but for most people it isn't necessary. Only people that were Boy Scouts actually care about this.
Ok, flame me now.
darethehair
2009-11-04, 14:18
Ok, flame me now.
I have no intentions of 'flaming' you :)
However, I personally would love to use a digital compass with the N900 so that I could add 'automatic directionality' (or whatever you want to call it) to the astronomy program(s) I have written. Similar to the Celestron 'SkyScout', I would like the directional orientation of the N900 to be reflected in the portion of the sky being shown to the user.
In my case, it has nothing to do with giving 'walking directions' to anybody :)
kevloral
2009-11-05, 09:24
Go up to 10 people and ask them for directions to their house. I doubt that 3 of them will use the words, "North, South, East or West". Then ask each of them if they have ever used a compasss. 0 of 10 will have used a compass.
I would love to have a compass in the N900, but for most people it isn't necessary. Only people that were Boy Scouts actually care about this.
Ok, flame me now.
A digital compass is not for the user to know there the North is (well, it also enables that, but it is not its main point), it is for the applications that are running on the device to know it. That is a pretty significant difference, as it enables augmented reality applications.
For instance, have a look at this: http://layar.com/
0Dark Knight0
2009-11-05, 09:27
me too,
i want it badly,,,:(
Go up to 10 people and ask them for directions to their house. I doubt that 3 of them will use the words, "North, South, East or West". Then ask each of them if they have ever used a compasss. 0 of 10 will have used a compass.
I would love to have a compass in the N900, but for most people it isn't necessary. Only people that were Boy Scouts actually care about this.
A compass isn't just for the user to know which way they're facing; it's so that the GPS can tell you which way to turn before you set off in the wrong direction.
I'm just wondering if the accelerometer+GPS is good enough to fake a compass through dead reckoning. You turn on dead-reckoning mode, get a GPS fix, walk 20ft or so in a straight line holding the device in some predefined position and now the device knows what direction its facing. Or alternatively, you point the device north, tell it to sync, and it does.
Granted, last time I did anything with dead reckoning was a FIRST robotics competition 6 years ago and I remember that just failing horribly, but maybe things have gotten better since then?
attila77
2009-11-05, 09:57
1. Dead reckoning with a single accelerometer is trouble. You'd really need a gyro, accelerometers will give you onyl translation, but not rotation.
2. If you walked 20ft with GPS on, you'd have a direction anyway :) There is just one assumption to make - that the device was in front of you.
1. Dead reckoning with a single accelerometer is trouble. You'd really need a gyro, accelerometers will give you onyl translation, but not rotation.
2. If you walked 20ft with GPS on, you'd have a direction anyway :) There is just one assumption to make - that the device was in front of you.
Or two accelerometers as far apart as possible in the phone. A magnetic bearing gyro sounds like it would give better results though. But then again, silicon accelerometer == no separate moving parts to fail.
You'd need to integrate the accelerometer measurements, which I'd think would have to be done continuously by the electronics to have a chance at being accurate.
i2c would be easiest to access using some microprocessor with a similar interface (Atmel has TWI or USI depending on model). I don't know if you can bit-bang the SDIO in the microSD, or if there would be a driver for the UART interface, though there is a NXP/Philips UART to I2C chip that might work.
mannakiosk
2009-11-24, 09:33
I'd be really happy with an integrated bluetooth compass/headset. Or even just a BT compass.
It would mean that I'd have to keep the N900 aligned correctly, but I don't think holding the phone straight in front of me would be any kind of herculean task.
Looks like someone named "HapticGuide" is working on a bluetooth compass prototype for the N900:
http://www.flickr.com/photos/hapticguide/4206070945/
http://www.flickr.com/photos/hapticguide/4164852805/
AFAICT there is no user on t.m.o. with that username.
Anyone know more information about this project, or care to comment on the visible electronics in the photo?
EDIT: better photo added
EDIT: Found the project home page here (http://blogs.nokia.com/pushn900/category/the-haptic-guide/); it's a PUSH project. Looks like it's intended for walking navigation, not for AR. I wonder if the compass circuit returns full 360 degree information or just 8 directions.
there is a strange blanking plate type thing inside the n900
go have a look at some disassembly videos, would a honeywell i2c unit fit in that space?
Shame this isn't available anymore:
http://www.wintec.com.tw/GPS/bluetoothgps/WBT100.htm
http://www.pocketgpsworld.com/wintec-data-logger.php
It actually spits out an NMEA HDG message, just what we could do with: http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=57588&whichpage=5
That Wintec device does indeed look like it would fit the bill surprisingly nicely: small, battery-powered, and bluetooth! Looks like it was pricey when it was available ($150)... wonder if there's a similar product available today.
EDIT: Is this (http://www.wintec.com.tw/en/product_detail.php?pro_id=78%20style=) the successor? Seems like it's still available (http://www.buygpsnow.com/Wintec-G-Trender-Waterproof-Sport-Bluetooth-GPS-Data-Logger-with-LCD--Barometer--Electronic-Compass-WSG-1000.aspx). Looks like you'd be paying for a lot of stuff you don't need though if all you need is a compass.
I seem to recall someone in this thread said (s)he had contacts to a Chinese manufacturer who might be willing to take up a compass project. I wonder if the Wintec might be able to serve as a useful example for said manufacturer when considering development of a similar device.
I've just read back through the thread, and I saw the mention of SDIO. It does apparently work, have a chat to Crashanddie who happened to have a suitable card and it was recognised.
And while I'm waffling, though slightly OT now, has anyone actually tried forcing the USB chipset to host mode using the same trick that was necessary for the N800 and N810 (if you used a gender changer as you didn't want to buy an extra usb cable with the right wire crossed over in it)?
One of the things I'm working on involves adding a magnetometer (HMC5843 - http://talk.maemo.org/showthread.php?p=450739#post450739) to my stack with a Venus 10Hz GPS (with WAAS and AGPS!), reading J1850 from my harley, my radar detector. I'm also adding baro and temp (and maybe humidity if I can find the right sensor).
The HMC is more than sensitive enough to give a heading reading - I was surprised. It is I2C so just needs to be turned into serial for bluetooth.
EDIT: Is this the successor? Seems like it's still available. Looks like you'd be paying for a lot of stuff you don't need though if all you need is a compass.
Good find, apparently it does spit out the compass reading along with the barometric data in a proprietary sentence.
http://www.gpspassion.com/forumsen/topic.asp?TOPIC_ID=117303
Looks like there's another product in the category of GPS logger + compass + bluetooth: the MN500 from "Themap", a Korean company. Can't find any pricing info yet though, not even on their home page... the product was only recently launched.
http://www.ceatec.com/2009/en/news/exhibitor_detail.html?press_id=00041
specs (http://www.ceatec.com/2009/en/visitor/detail.html?exh_id=E090400) - Touch_Panel, 3.5"Transflective LCD, Bluetooth, Compass, Altimetric Barometer, 2.4GHz Bike_Sensor(ANT+), CPU ARM9_2442 @ 400 Mhz - you could probably run Linux on this thing, if it's not running Linux already.
I suspect again though it will be rather pricey.
edit: added specs link
Yeah, if we're going to go that large and pricey it would make more sense to just buy one of the Android devices which comes with GPS + compass and do VR work on there.
That Wintec device isn't available in the UK afaict, so it looks like it will unfortunately be a case of doing some soldering and making up a BT link for the 3-axis i2c accelerometer *grumble*.
And while I'm waffling, though slightly OT now, has anyone actually tried forcing the USB chipset to host mode using the same trick that was necessary for the N800 and N810 (if you used a gender changer as you didn't want to buy an extra usb cable with the right wire crossed over in it)?
http://talk.maemo.org/showthread.php?t=31921
iamNarada
2010-01-05, 20:42
I've been lurking following the progress of this thread. I have a question. What height (thickness) of chip can the microSD card slot accommodate? Would it be possible to custom fab a magnetometer microSDIO card. The 3 axis magnetometer chip from Honeywell are a bit thicker (1.3mm) than the official microSD card spec (1mm), but they are substantially smaller in the other dimensions (3x3mm vs 11x15mm) so there should be ample real estate for whatever other electronics (i.e. flexPCB). Just wondering!
I don't think it would fit on an SD card without sticking out (at least on the 900). You might be able to do something via bluetooth (or even flash an IR LED at the camera).
I don't think the Honeywells do SPI (which would make it easy), but do I2C - I have the HMC5843 talking to various Atmel chips (the new attiny45 in tssop might fit in the uSD slot though). It could go via bluetooth as well though it would probably be a bit big.
Jack6428
2010-01-05, 23:22
I wanted to ask... i thought the N900 does have a digital compass actually? When i use Ovi Maps and the A-GPS, and set a route and drive by car... the map is turning by itself as i drive, targeting always north. For ex. when i turn right, the map turns with me. I though that can be done only with a digital compass? Or am i wrong?
noobmonkey
2010-01-05, 23:32
I wanted to ask... i thought the N900 does have a digital compass actually? When i use Ovi Maps and the A-GPS, and set a route and drive by car... the map is turning by itself as i drive, targeting always north. For ex. when i turn right, the map turns with me. I though that can be done only with a digital compass? Or am i wrong?
I'm pretty sure it's just able to tell the direction you are going in by gaps in the gps, (ie you getting closer and farther away from them)...
If you face the other way in a taxi etc, it does the same as facing forward. So i don't think it uses a compass unfortunately :(
If you've moving the GPS can tell your track, which is probably also your heading assuming you're driving.
When you're stationary it can't tell which way you're pointing
Looks like someone named "HapticGuide" is working on a bluetooth compass prototype for the N900:
Unfortunately, reading the latest update (http://blogs.nokia.com/pushn900/2010/01/14/my-n900-can-walk-me-home/) to the project, it seems it's using GPS and movement to determine your direction, not an actual magnetic compass (though the project is advertised (http://blogs.nokia.com/pushn900/2009/12/02/haptic-guide/) as a "wearable compass").
Anyone in this thread constructed a working compass prototype yet?
Not for the N900 since I don't have one, but I have an HMC5843 breakout, arduino, and bluetooth talking together sending X,Y,Z. I'm working on adding barometric pressure.
tz1, can you post how you did that? I'm guessing it works for any bluetooth device which handles serial ports. Thanks!
I2C Magnetometer:
http://www.sparkfun.com/commerce/product_info.php?products_id=9371
First, you might need to fix the capacitor, see the comments.
On the page is some sample code for an ATmega328p. I basically use that merged with an improved I2C driver on my 3.3v Arduino Pro.
http://www.sparkfun.com/commerce/product_info.php?products_id=9220
Normally to an FTDI 3.3v breakout to /dev/ttyUSB0, but it is just TTL serial UART levels.
I have a Parani bluetooth module from sena.com that just takes 3.3v, ground, tx, and if you need rx, or you could also use the bluetooth mate:
http://www.sparkfun.com/commerce/product_info.php?products_id=9358
The HMC I have runs at around 70Hz and returns 13-14 bits for each axis so even 9600 baud should work but I usually set things faster.
It produces output like:
472, -9, -687
465, -4, -685
474, -4, -692
471, -8, -683
467, 1, -694
471, -5, -688
475, -11, -691
471, 2, -698
473, 8, -685
474, -3, -685
466, 0, -686
479, -1, -698
469, -7, -694
469, 1, -687
471, 2, -688
472, 5, -690
477, -2, -688
Read the datasheet for details.
#include <avr/io.h>
#define ENABTW ((1<<TWINT)|(1<<TWEN)|(0<<TWIE)) // 0x80 4 1
#define START TWCR = (ENABTW|(1<<TWSTA)) // 0x20
#define STOP TWCR = (ENABTW|(1<<TWSTO)) // 0x10
#define SEND(x) TWDR = x; TWCR = ENABTW;
#define RECV(ack) TWCR = ENABTW | (ack? (1<<TWEA) : 0 );
unsigned char twista;
unsigned twitmo;
#define WAIT twitmo=0; while (!((twista = TWCR) & (1 << TWINT)) && ++twitmo);
/////===================================////////////////////
void TWIinit(void)
{
DDRC &= ~0x30; // pullup
PORTC |= 0x30; // pullup
TWBR = 2; // 400 khz
TWCR |= (1 << TWEN);
}
void TWIdocmd(unsigned char *msg)
{
unsigned int mlen, rdwrf;
while ((mlen = *msg++)) {
rdwrf = *msg & 1;
START;
WAIT;
do {
SEND(*msg++);
WAIT;
// should check for ACK - twista == SAWA or SDWA
} while (--mlen && !rdwrf);
// read
while (mlen--) {
RECV(mlen);
WAIT;
*msg++ = TWDR;
}
}
STOP;
}
#ifndef F_CPU
#define F_CPU 8000000
#endif
#include <util/delay.h>
#include <stdio.h>
static int serout(char c, FILE * stream)
{
if (c == '\n') {
while( !(UCSR0A & 0x20) );
UDR0 = '\r';
}
while( !(UCSR0A & 0x20) );
UDR0 = c;
return 0;
}
static FILE fpuart = FDEV_SETUP_STREAM(serout, NULL, _FDEV_SETUP_WRITE);
void UART_Init(unsigned centibaud) {
unsigned acc,count;
// we don't do this often, and it should be more accurate than divides
#define BCLK (F_CPU/800)
acc = 0;
count = 0;
while( acc < BCLK )
acc += centibaud, count++;
if( acc - BCLK > centibaud >> 1 )
count--;
UBRR0 = count - 1;
UCSR0C = 0x06; //8N1 (should be this from reset)
UCSR0A = 0xE0 | 2; // clear Interrupts, UART at 2x (xtal/8)
UCSR0B = 0x18; // oring in 0x80 would enable rx interrupt
stdout = &fpuart; //Required for printf init
}
unsigned char sendhmci[] = {
5, 0x3c, 0, 0x18, 0, 0,
0
};
unsigned char sendhmcpr[] = {
2, 0x3c, 9,
0
};
unsigned char sendhmcrd1[] = {
2, 0x3d, 0,
0
};
unsigned char sendhmcrd2[] = {
7, 0x3d, 0, 0, 0, 0, 0, 0,
0
};
int main(void)
{
unsigned char cnt, sta;
int xo, yo, zo;
#define BAUD 57600
UART_Init(BAUD/10);
for (;;) {
TWIinit();
printf("HMC5843\n");
TWIdocmd(sendhmci);
printf("Init2\n");
TWIdocmd(sendhmci);
printf("Ready\n");
cnt = 0;
while (cnt++ < 20) {
TWIdocmd(sendhmcpr);
TWIdocmd(sendhmcrd1);
sta = sendhmcrd1[2];
if (sta != 5)
continue;
cnt = 0;
TWIdocmd(sendhmcrd2);
xo = sendhmcrd2[3] | (sendhmcrd2[2] << 8);
yo = sendhmcrd2[5] | (sendhmcrd2[4] << 8);
zo = sendhmcrd2[7] | (sendhmcrd2[6] << 8);
printf("%5d,%5d,%5d\n", xo, yo, zo);
_delay_ms(12);
}
}
}
stefanmohl
2010-02-09, 03:54
Have a look at:
Using PS3 SixAxis controller with N900
http://talk.maemo.org/showthread.php?t=41693
blackbird
2010-02-09, 11:09
Make that i2c magnetometer small enough to fit in the microsd card bay ;)
Hi!
I am also trying to get some sort of digital compass for my N900, and as far as I checked the price and shipping costs for all the parts necessary for simple IC2 -> Bluetooth digital compass, for me it is cheaper, faster and easier to just buy used Android phone (G1/Dream or Tattoo), attach it to the back of N900 with two elastic bands, and create a simple App that transmits compass coordinates from Android phone via Bluetooth/WiFi. I know it sounds completely stupid, but it solves all the battery/circuitry/soldering/etc problems for the same price or cheaper, AND I get an additional phone. Mind if I include this as one of the options in the Digital Compass wiki section?
Edgars
I'm planning on trying to figure out what the pads below the battery actually are (got Open Logic Sniffer (http://dangerousprototypes.com/open-logic-sniffer/) in the mail a while back), at least for those that output something.
Current problem is getting probe wires on those pads without doing anything destructive (like soldering, besides it's cramped in there), current plan is to mill pieces of polycarbonate to fit the slots and drill wire sized holes, CNC mill would be nice but I don't have one...).
I'm hoping there is I2C or SPI on the pads (which would enable us to make plans for a "bolt-on" accessory, we could even design a "shields" [ala Arduino] system for N900 :))
I'll update the wiki when I get around to doing this (which might take a while since I'm at aKademy mon-wed and on a training camp for a week starting on friday...)
Made a sorta-adapter (http://www.qaiku.com/channels/show/N900/view/5956c9e2876d11df83e6a1d695620f270f27/), unfortunately as later comments show (http://www.qaiku.com/channels/show/N900/view/81892b16878211dfb40adb88028bab4dab4d/) I had a brainfart and thus got nothing out, need to try again later (but not today)
Edit: Did some schematic reading, as result updated the debug ports documentation (http://wiki.maemo.org/N900_Hardware_Hacking#Debug_ports).
Just a quick update: My adapter is crap (poor connection and no connection at all on some pads) and my lab supply is puny so I can't power the device without battery. So I need to either find very small springs (that could be used to make good connections on a number of pads from a new adapter or some other nondestructive way of getting wires on the pads, or I need to get a more powerfull supply (working on it but it'll take a while)
OTOH: at http://hacklab.fi/ I have access to a 48ch (actually 96ch but we have only one bag of probes...) logic analyzer so once I figure out a good way to get the probes to the pads it's possible to look at all of them at the same time...
, or I need to get a more powerfull supply (working on it but it'll take a while)
Bit the bullet and got a new 2x5A (can be used in parallel for 10A) lab supply (even got a rather good "special price - only for you" -discount since I'm a regular at the electronics store :D, still it cost over 200EUR :()
But I have a milling job (http://www.qaiku.com/channels/show/hacklabfi/view/69adb992a0e311df9cbc69f5cbd00bf70bf7/) to do for a fellow hacklabber (http://basscadet.fi/) that needs to be done by tomorrow (we need it at ASM2010 (http://www.assembly.org/summer10/news/hobby-depot-2010), which is where I'll be spending a lot of the weekend too...) so this will still take a while.
Status update: figured out the need for 47k resistor between BSI and GND pins and now can boot my device with a bench supply, with a multimeter and a small handheld scope located some promising pads for further study and now need to figure a good way to get the logic analyzer probes to stay on them.
shadowjk
2010-08-15, 08:37
IIRC, BL-5J has a 100K resistor.
vBulletin® v3.8.8, Copyright ©2000-2025, vBulletin Solutions, Inc.