Geejayrail
Posts: 1
Joined: Wed Jun 20, 2018 1:15 pm

Using raspberry pi to measure angle newbie

Wed Jun 20, 2018 1:23 pm

Hi

I'm relatively new to the programming game. I'm basically looking for a way to measure an angle on an arm that pivots up and down. I'd like to be able to move the arm to a point I choose, then have a way of it remembering that exact point for example when I press a button, and then it will alarm if I get to that point until I press a reset switch.

I know you can get inclinometers that are compatible. I'd just like to know if it would be possible on the platform?

Kind regards

GJ :?:

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28358
Joined: Sat Jul 30, 2011 7:41 pm

Re: Using raspberry pi to measure angle newbie

Wed Jun 20, 2018 2:28 pm

This would be quite an expensive way of doing it.

https://www.leveldevelopments.com/produ ... interface/

There are others.

You could simply have a rotation sensor on the arm pivot perhaps? Or a laser distance sensor? Number of ways of doing it.

EDIT : Or this? https://www.sparkfun.com/products/9836
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
Z80 Refugee
Posts: 359
Joined: Sun Feb 09, 2014 1:53 pm

Re: Using raspberry pi to measure angle newbie

Wed Jun 20, 2018 2:41 pm

Geejayrail wrote:
Wed Jun 20, 2018 1:23 pm
I'd just like to know if it would be possible on the platform?
If you mean without any additional parts (like you can with an Android/iOS phone), the answer is no.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
bensimmo
Posts: 5146
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Using raspberry pi to measure angle newbie

Wed Jun 20, 2018 2:55 pm

if your arm is using a motor and that motor gives feedback, you can use that provide the position. store it in a variable and then just use it for the goto point.

it will be as good as your motor is.

if your arm is using something else, hydraulic etc, see if it has a feedback mechanism you can record.

User avatar
bensimmo
Posts: 5146
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Using raspberry pi to measure angle newbie

Wed Jun 20, 2018 2:59 pm

other alternatives rotational potentiometers and adc convertor.
again this will give you the angle/resistance of the point.

we use these with pendulums to datalog the position.

a gyro/accelerometer and read its position, probably quite easy to connect via i2c.

for the alarm, you just check until it goes past the data point you have stored with that push button.

User avatar
mark3112
Posts: 46
Joined: Mon Apr 09, 2018 10:39 am

Re: Using raspberry pi to measure angle newbie

Wed Jun 20, 2018 8:18 pm

Linear potentiometer and an ADC?
Type “Linear-Position-Sensor” into ebay.
You can make a real CPU in a FPGA, but you can’t make a real FPGA in a CPU.

Return to “General discussion”