PDA

View Full Version : [APP][Updated 07/18/2008] BubbleLevel v1.02


j0bro
14th July 2008, 05:21 PM
BubbleLevel v1.02

My first attempt at utilizing the Touch Diamond's accelerometer. And it's free! :)
The sensor is a Kionix KXSD9 (http://www.kionix.com/accelerometers/accelerometer-KXSD9.html).

Donate a cup of coffee! (https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=j%2ebrosens%40gmail%2ecom&item_name=BubbleLevel&no_shipping=0&cn=Optional%20remark&tax=0&currency_code=EUR&lc=NL&bn=PP%2dDonationsBF&charset=UTF%2d8)
Thanks for donating on my birthday: Damien (€2,00)
and another thank you for Nuno (€1,00)

Features:
- Measure the slope of a surface using the 'bubble level' concept
- Display the slope angle in degrees
- Real time display and calibration of sensor data
- Can be used upside down too (go measure yer ceiling matey!)

Changelog:
v1.02
- Added verbose calibration screen
- Real time sensor data monitoring
- Implemented two-direction calibration method (for absolute sensor bias compensation as suggested by Kionix)
- Calibration data is stored to memory (used for BubbleLevel only!)

v1.01
- Added icon and placed shortcut in Programs (instead of Start Menu)
- Fixed bug of bubble flying away >42 lightyears when device is tilted at 90 degrees, causing a warp core breach (thanks akito)

v1.00
- Initial release

TomInMB
14th July 2008, 05:25 PM
You developers never cease to amaze me. Great work! XDA-Dev is wonderful!

Da9L
14th July 2008, 05:26 PM
Sounds nice ! So this software will let us be able to calibrate the Touch Diamonds Accelerometer?

I have downloaded the cab and installed it but how to use it?

akito
14th July 2008, 05:27 PM
I'm going to try this!! Thanks for posting it and letting us try :-D

j0bro
14th July 2008, 05:30 PM
Sounds nice ! So this software will let us be able to calibrate the Touch Diamonds Accelerometer?

I have downloaded the cab and installed it but how to use it?
The shortcut's in your Start Menu. Click the Windows flag to get to it; I will find a nice icon and add a decent Programs shortcut later on ;)

Da9L
14th July 2008, 05:41 PM
The shortcut's in your Start Menu. Click the Windows flag to get to it; I will find a nice icon and add a decent Programs shortcut later on ;)

Okay got it working now.. But when i calibrate and exit the program it resets the settings back to before it was calibrated.. So it doesnt save the calibration.. :(

feridoun
14th July 2008, 05:51 PM
Brilliant!

Now if the Diamond had a flat back cover, I could actually use this for a bit of DIY :D

akito
14th July 2008, 06:34 PM
Bug found ;-)
Whether calibrated or not, when I hold my phone completely vertical making it show about 87 degrees of more the program crashes... actually my whole phone crashes cause I can't exit the program anymore and need to push the reset button :-p

horstborsch
14th July 2008, 06:40 PM
can anyone post some screens? my diamond is up and away for repair :(

edit: sorry my browser took some while to load the pic on the first post so I didn´t see it.

Blob8me
14th July 2008, 06:52 PM
BubbleLevel v1.0

My first attempt at utilizing the Touch Diamond's accelerometer. And it's free! :)


That is soo cool. Thanks Bro - great work. :)

.

j0bro
14th July 2008, 07:04 PM
Bug found ;-)
Whether calibrated or not, when I hold my phone completely vertical making it show about 87 degrees of more the program crashes... actually my whole phone crashes cause I can't exit the program anymore and need to push the reset button :-p
Thanks akito, I could indeed reproduce that behaviour quite easily... I guess I need some exception handling when doing vector dot product calculations :cool:
Will fix this asap.

Edit: Fixed in v1.01, check start post!

castor.troy
14th July 2008, 09:47 PM
Where can we download version 1.01 of Bubblelevel? Because the above problem still exists in the version which can be downloaded on the first page.

j0bro
14th July 2008, 10:13 PM
Where can we download version 1.01 of Bubblelevel? Because the above problem still exists in the version which can be downloaded on the first page.

Please check the About box in the program for the version number. The cause for the bug mentioned above is removed in v1.01, but you might have come across another situation. Please let me know if you find out when it happens exactly, thanks!

Da9L
14th July 2008, 10:30 PM
wasn't this program supposed to calibrate the accelerometer?

chribruu
14th July 2008, 10:55 PM
No. the calibration is only valid in the app.

Da9L
14th July 2008, 11:57 PM
No. the calibration is only valid in the app.

Could it maybe be tweaked somehow so that it can calibrate globally, so that it will effect other software too ? Would be perfect.. !

Jef34
15th July 2008, 12:34 AM
Thanks for this software. Very Cool

futureshock
15th July 2008, 12:50 AM
Hi, could you please give me some advice how to programm with the g-sensor..

i have an idea for a small programm that uses the sensor...

i already found the "HTCSensorSDK" but when i want to load the project files within C# Express 2008 i became an error that the project files could not opend...

eastmushu
15th July 2008, 02:59 AM
BubbleLevel v1.01

My first attempt at utilizing the Touch Diamond's accelerometer. And it's free! :)

Features:
- Measure the slope of a surface using the 'bubble level' concept
- Display the slope angle in degrees
- Measure the relative angle between surfaces using the calibration function
- Can be used upside down too (go measure yer ceiling matey!)

Changelog:
v1.0.1
- Added icon and placed shortcut in Programs (instead of Start Menu)
- Fixed bug of bubble flying away >42 lightyears when device is tilted at 90 degrees, causing a warp core breach (thanks akito)

v1.0
- Initial release

Will this work with Omnia (i900) too?

sandervanzijl
15th July 2008, 09:27 AM
it should also be possible to check if something is completely vertical.
when i hold my phone in the vertical position and tilt it a little bit the numbers change.
could you add indicators for vertical and horizontal bubblelevel?
could you also lower the refresh rate a little bit. the numers keep jumping making reading them almost impossible.

j0bro
15th July 2008, 10:33 AM
it should also be possible to check if something is completely vertical.
when i hold my phone in the vertical position and tilt it a little bit the numbers change.
could you add indicators for vertical and horizontal bubblelevel?
could you also lower the refresh rate a little bit. the numers keep jumping making reading them almost impossible.
In the next version I will incorporate some extra features (user requests, my own ideas) and I will definitely improve the data readout to cutoff any noise from the signal. From the readings that I got out of the sensor I can tell that is doesn't sit perfectly straight inside the device (mechanical tolerances) and therefore needs calibration to eliminate sensor bias. It would be interesting to let all users post their calibration offsets, I'll look into this.

For anyone interested, the sensor is a Kionix KXSD9 and they've put up some handy technical documents about it on their website: http://www.kionix.com/sensors/application-notes.html

nannini
15th July 2008, 11:16 AM
thanks a lot for your development concerning the acceleration sensor in the diamond.

would it be possible to log and visualize the vibrations in x-, y- and z-direction like the iphone application?
would be an interesting feature to record vibrations with a diamond.

greets,
nannini

j0bro
15th July 2008, 11:20 AM
Hi, could you please give me some advice how to programm with the g-sensor..

i have an idea for a small programm that uses the sensor...

i already found the "HTCSensorSDK" but when i want to load the project files within C# Express 2008 i became an error that the project files could not opend...
Unfortunately, the Express editions of Visual Studio do not support Smart Device programmability... You must use a full version of VS as well as the Windows Mobile SDK, the latest version of that is found here: http://www.microsoft.com/downloads/details.aspx?familyid=06111A3A-A651-4745-88EF-3D48091A390B&displaylang=en

eaglesteve
15th July 2008, 11:46 AM
Nice application.

The only strange thing I find is that I do not get the measurement of the slope displayed at all. I understand that it's supposed to display this at the top right corner.

Someone suggest that it may be problem with my font, but I don't know how to verify this.

Any idea?

MrDerrickC
15th July 2008, 11:58 AM
I would like to say thanks! This little program is awesome! Can see it going a long way!
Keep up the excellent work

stief
15th July 2008, 12:14 PM
Can hang my diamond on my toolbelt now:)

ben®nie
15th July 2008, 12:15 PM
Great tool, thanks!

Inc
15th July 2008, 12:36 PM
Nice program - with nice possibilities in the future ;-)

is there any way you can "stabilize" the ball a little bit - make it roll gently like in teeter ? It's all over the place jumping a few steps in all directions 1000 times a second ;-)

Thanks,
Inc

Knochi
15th July 2008, 03:21 PM
Pls add the possibility to save the calibration.
The tool is quite useless, if you need a real "BubbleLevel" to calibrate it every time.
Perhabs you can make a Calibrate for... yes.. calibrating and a Hold-Funktion for Measuring differnces (perhabs by Displaying cailbrated value and difference?)
Yes and both X and Y Values would be nice (as already mentioned) :-)

Thx

j0bro
15th July 2008, 03:29 PM
Pls add the possibility to save the calibration.
The tool is quite useless, if you need a real "BubbleLevel" to calibrate it every time.
Perhabs you can make a Calibrate for... yes.. calibrating and a Hold-Funktion for Measuring differnces (perhabs by Displaying cailbrated value and difference?)
Yes and both X and Y Values would be nice (as already mentioned) :-)

Thx
I'll have a look at it this evening. Being able to save the calibration is indeed an added value, as others also mentioned; especially because every Diamond unit likely has its own sensor bias. Stay tuned!

Bolus
15th July 2008, 03:42 PM
Now that is a nice piece of software! I'm looking forward to using my diamond in my DIY attempts!

2395
16th July 2008, 04:57 AM
thanks j0bro well done so far ...have you seen this.....

http://msmobiles.com/news.php/7502.html

joonsuan
16th July 2008, 06:25 PM
I found an interesting registry entry:

HKLM\Drivers\BuiltIn\GSensor\EnableShaking

Value is set to 0.

Doesn't seem to do anything for me...but it does make one wonder about the capabilities for the Diamond if someone could write an app that makes use of this feature.

j0bro
18th July 2008, 01:27 AM
Updated to v1.02.

Check the starting post (http://forum.xda-developers.com/showthread.php?t=408056)!

Plattendoktor
18th July 2008, 03:00 AM
Hi,

this program is very nice! ;) I love it!

But its not useable for a little more advanced job. It would be perfect, if the user could edit the sensitivity of the bubble by changing the max. angle. So that the full deflection represents not 90° but more 10°, for example. Therefore the number of decimal places has to be increased and the moving of the bubble has to be damped.

But till now it is a very good work! Both thumbs up!

SMASH1902
18th July 2008, 09:20 AM
[QUOTE=j0bro;2404640]BubbleLevel v1.02

My first attempt at utilizing the Touch Diamond's accelerometer. And it's free! :)
The sensor is a Kionix KXSD9 (http://www.kionix.com/accelerometers/accelerometer-KXSD9.html).

Features:
- Measure the slope of a surface using the 'bubble level' concept
- Display the slope angle in degrees
- Real time display and calibration of sensor data
- Can be used upside down too (go measure yer ceiling matey!)

Changelog:
v1.02
- Added verbose calibration screen
- Real time sensor data monitoring
- Implemented two-direction calibration method (for absolute sensor bias compensation as suggested by Kionix)
- Calibration data is stored to memory

Is it possible calibrate g-sensor or not? I haven't understood...what happens if you store data to memory?thanks for explanation

j0bro
18th July 2008, 10:42 AM
BubbleLevel v1.02

My first attempt at utilizing the Touch Diamond's accelerometer. And it's free! :)
The sensor is a Kionix KXSD9 (http://www.kionix.com/accelerometers/accelerometer-KXSD9.html).

Features:
- Measure the slope of a surface using the 'bubble level' concept
- Display the slope angle in degrees
- Real time display and calibration of sensor data
- Can be used upside down too (go measure yer ceiling matey!)

Changelog:
v1.02
- Added verbose calibration screen
- Real time sensor data monitoring
- Implemented two-direction calibration method (for absolute sensor bias compensation as suggested by Kionix)
- Calibration data is stored to memory

Is it possible calibrate g-sensor or not? I haven't understood...what happens if you store data to memory?thanks for explanation
The calibration is *only* for BubbleLevel; I updated the starting post to make this more clear. The sensor can't be calibrated globally in software, the readings are always off a little bit, due to the manufacturing process tolerances. As Kionix mentions on their website, developers need to take this in account (like I did :))

aleph305
19th July 2008, 01:48 PM
thanks for your work. very nice app

hallur84
21st July 2008, 11:46 AM
Just the program I've been looking for!

One cool feature could be that you can measure acceleration in each direction, and also display the total acceleration (the vector sum) and maybe even G-forces :)

Then I can have fun in the car to measure acceleration and turn G-forces (relating to the 2009 Nissan GTR in Top Gear last Sunday).

I haven't had a chance to try the application yet, so I don't know if this feature is included.

Petertju
21st July 2008, 10:41 PM
Great tool... just what I wanted! Seems to accurate also. And it is fast!

Good work!

Kiwi_hknz
23rd July 2008, 05:29 AM
Hi

Just installed it and calibrated on a flat surface but when I put my diamond upright it's not really 90 degrees, is it accurate?

j0bro
23rd July 2008, 08:36 AM
Hi

Just installed it and calibrated on a flat surface but when I put my diamond upright it's not really 90 degrees, is it accurate?

I already found that too. It seems that the rotation angles cannot be accurately reported by the DLL, as they skip around 87 and 93 degrees when you hold the device upright. This could be due to a math function that reaches infinity somewhere, or HTC not using quaternions (a mathematical method to describe 3D rotations) in the DLL internals. Quaternions do not suffer from tricky errors, such as gimbal lock and inaccuracies at right angles.

There is a possibility that I can overcome this by combining several outputs at 90 degrees but I'll have to look into that still. Thanks for noticing!

gauzak5
24th July 2008, 09:22 AM
Hello,

Very nice application. But I have a problem with my Diamond: I have started the program 30 or 40 times. Only in one of all I could see the inclination number (4,6º in your aAttached Thumbnail). Now I restarted it a lot of times, I make softreset, I calibrate it meny times and nothing, the number doesn't appear!

Someone has the same problem?

Thank you very much for your work j0bro.

EDIT: I have reinstalled it and now it works ok :rolleyes:

gauzak5
24th July 2008, 09:39 AM
Hello, I have one suggestion for your next version:

It would be nice if you could draw a line or an arrow (from the inner circle to the outer one, for example) showing the inclination direction. But it should be quite stable.

Thanks.

j0bro
24th July 2008, 08:12 PM
Hello, I have one suggestion for your next version:

It would be nice if you could draw a line or an arrow (from the inner circle to the outer one, for example) showing the inclination direction. But it should be quite stable.

Thanks.
Well, the 'imaginary' line between the gauge center and the bubble is in fact the direction of the inclination. You only have to see it in there! But thanks for the tip, maybe I'll add it.

herbys
31st July 2008, 09:50 AM
This is very interesting, and it could be extremely useful with just three enhancements:
1) Add some moving average function to the bubble calculation (that would simulate viscosity in the virtual fluid). That way the ball would not jump around that much, and measurements would become much more precise.
2) Increase resolution and precision by making the bubbe move away from the center more with deviation. Today that might not make much sense as the bubble would randomly jump all around the sphere, but with the previously mentioned enhancement it should work fine.
3) Add a vertical level option: when the phone is placed on its side, a traditional bar type bubble level should be displayed instead of the round one. Would be useful for leveling frames and the like.

If you post source code, I'm willing to make these changes. Keep up the excellent work.

maximo_lider
23rd August 2008, 02:22 PM
Thanks for posting it and letting us try :D:D

5578
15th September 2008, 10:53 PM
Great toy, thanks a lot.
I have two requests to make it perfect:
- increase the sensibility of the bubble to (adjustable) deg
- average the measurement to (adjustable) amounts of readings (don't limit max)
and one request for HTC:
- straighten the bottom of the touch diamond :)

dominoid
30th September 2008, 02:12 PM
fantastic app! I can see this saving me so much time in trying to remember where I put my spirit level.
thank you.

Pippa
2nd November 2008, 09:41 AM
Hi,
compliments for your very good work, now a question: is it compatible with Omnia?

maximo_lider
2nd November 2008, 11:02 AM
I'm going to try this!! Thanks

bugmenot20090308
14th March 2009, 12:02 PM
I miss lines on the display.
horizontal and vertical

joeburly
12th April 2009, 11:49 PM
does this work for the omnia?

amjay
1st October 2009, 02:46 PM
hi j0bro, can u do me a big favour. can u put a cross mark and some rings on the main circle. and a small cross on the small circle. it would make it very easy to view the change. thanks in advance.

miniwaiwai
22nd January 2010, 07:53 PM
Hi guys,

Does anyone know something similar working on Acer M900? This one says "DLL PInoke 'HTCSensorDSK' introuvable" (introuvable meaning that it doesn't find it, yes, me and my phone speak french!)

Thx

wildstrubel
17th August 2011, 05:06 PM
Hi j0bro, would it be possible to get a cab-file with increased size of degree number, possibly without dezimal? I'm using this tool on skitouring for avalanche dangerous slopes and have to read it in some distance and in bright light. Would be great, thanks in advance!