Digital angle reader / inclinometer hack?

363 views
Skip to first unread message

invent_or

unread,
Mar 25, 2013, 4:33:32 AM3/25/13
to london-h...@googlegroups.com

Has anyone, or does anyone know of, any hacking of these little "angle boxes"?

I want to strip the sensor out and wire it to an RPi or, if it is feasible, an Arduino. Google searches haven't brought anything useful up beyond a few others asking.

The other option is to buy a sensor and use that directly, but as these boxes cost less than any decent sensor I can find, I'd rather use the box I've already got.

It's for a project that you'd probably rate as "Really Cool", so any pointers would be great.
Ta, N

Adrian Godwin

unread,
Mar 25, 2013, 4:53:17 AM3/25/13
to london-h...@googlegroups.com
I have one like this : http://www.warco.co.uk/digital-measuring-equipment/300-mini-digital-protractor.html

It contains a MEMSIC D2020E dual-axis accelerometer.

http://www.memsic.com/userfiles/files/Datasheets/Accelerometer-Datasheets/MXD2020E_FRevH.pdf



--
You received this message because you are subscribed to the Google Groups "London Hackspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to london-hack-sp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mike Harrison

unread,
Mar 25, 2013, 6:34:19 AM3/25/13
to london-h...@googlegroups.com
On Mon, 25 Mar 2013 08:53:17 +0000, you wrote:

>I have one like this :
>http://www.warco.co.uk/digital-measuring-equipment/300-mini-digital-protractor.html
>
>It contains a MEMSIC D2020E dual-axis accelerometer.
>
>http://www.memsic.com/userfiles/files/Datasheets/Accelerometer-Datasheets/MXD2020E_FRevH.pdf
>
>On Mon, Mar 25, 2013 at 8:33 AM, invent_or <
>yt...@discreetsecuritysolutions.com> wrote:
>
>> Has anyone, or does anyone know of, any hacking of these little "angle
>> boxes"? <http://www.engineering-tools.com.au/images/bevel-box-lge.jpg>
>>
>> I want to strip the sensor out and wire it to an RPi or, if it is
>> feasible, an Arduino. Google searches haven't brought anything useful up
>> beyond a few others asking.

I looked at these when I was doing a job that needed to sense the position of the London Eye.
http://cinimodstudio.com/project/london-eye-mood-conductor/
I bought a cheap Ebay digital potractor (I think the same as the one pictured above) and was
surprised to see it used a mechanical/capacitive sensor - similar to what they use on digital
calipers, and not an accelerometer.

I ended up using an MMA8451accelerometer - this gave something like 1 to 3 degree accuracy over the
whole range with a 4 point (90 degree) calibration. With finer calibration I'm sure you could get
well below 1 degree as long as it's close to teh vertical plane. Not sure if there is any
significant temperature dependence.
You do need to use some trig (arcsine) to derive the angle, so will use quite a lot of code on an
Arduino, but probably doable, or you could use a lookup table with interpolation.


invent_or

unread,
Mar 25, 2013, 11:33:07 AM3/25/13
to london-h...@googlegroups.com
Thanks.

I was hoping to avoid an accelerometer, as I know that if the CPU is busy it might well drift, and the CPU will be doing stepper driving. I know the usual Arduino code for that blocks everything, (Start ignoring everything, step 300 times, start listening again) so I might well need the extra power and expense of the RPi.

I might pull one open to see if there is a way to read the data lines that output to the LCD, and decode that in software.

N

Gavan Fantom

unread,
Mar 25, 2013, 11:53:42 AM3/25/13
to london-h...@googlegroups.com
On 25/03/2013 15:33, invent_or wrote:
> Thanks.
>
> I was hoping to avoid an accelerometer, as I know that if the CPU is
> busy it might well drift, and the CPU will be doing stepper driving. I
> know the usual Arduino code for that blocks everything, (Start
> ignoring everything, step 300 times, start listening again) so I might
> well need the extra power and expense of the RPi.
>

Why would an accelerometer drift? What are you trying to measure? If you
just want angle, it's a gyro that would drift (but would be more
accurate short term) whereas an accelerometer would give you the right
answer (once you take an average as it is likely to be quite noisy)
providing you have no other acceleration in play at the time you take
your readings.

Mike Harrison

unread,
Mar 25, 2013, 12:14:04 PM3/25/13
to london-h...@googlegroups.com
On Mon, 25 Mar 2013 15:53:42 +0000, you wrote:

>On 25/03/2013 15:33, invent_or wrote:
>> Thanks.
>>
>> I was hoping to avoid an accelerometer, as I know that if the CPU is
>> busy it might well drift, and the CPU will be doing stepper driving. I
>> know the usual Arduino code for that blocks everything, (Start
>> ignoring everything, step 300 times, start listening again) so I might
>> well need the extra power and expense of the RPi.


You are measuring the acceleration due to gravity, not motion, so you can read it whenever you want
without any additional error ( you may want to avarage a number of readings to improve resoution)

invent_or

unread,
Mar 26, 2013, 3:07:09 PM3/26/13
to london-h...@googlegroups.com
Gavan, Mike,

Thanks, you are both right. The MEMS do drift, but it won't be enough to make any difference on the timescales I'm looking at, and if I cease other activity until the readings are done, I'll get the accuracy.

Going to start putting this together now, I think...

N
Reply all
Reply to author
Forward
0 new messages