arduino digital protractor

hi guys

i wish to start my own project completely from scratch and chose a digital protractor

(don't ask why i just thought lets have summit different ;D)

anyway i would like to ask your opinion on how to go about doing the soft ware

i have choose to use a pot as the input - depending on its analogue input i want to arduino to recognise the relevant angle something like this

read pot

if pot value = 1 print.serial 1 degree

if pot value = 5 serial.print 2 degree

and so on and on then for the else i will display error or something

sound ok so far???

now this is where i am getting lost

anothe feature i want to add to it (just for learning purpose really) is being able to edit the angle the arduino displays with 4 buttons (edit, increase, decrease, save)

i really do not have a clue how to go about that and this is where i need help

thank you very much :slight_smile:

do you know how to wire and use buttons in other applications, (ie asking in general)

or are you asking directly about your project?

i am asking about the project

i just can't get my head around editing them - i can get the buttons in no problem at all and get them to do stuff but to make it edit something and save it i am just lost

Read the pot, map the value to an angle and print the value is a single line of code, but I don't get the "edit the value" bit.
What is it you want to do?

BTW, make sure you don't specify a pot intended for audio applications (log).

ok i think i have buggered it up a little

i want to be able to edit the angle

for example if i measure a angle i know is 90 degree but the protractor says is 85 degree i want to be able to change the 85 degree that shows up on the protractor to the known 90 degree

thanks

So, a sort of "calibrate", rather than "edit"?

yes

thats probably a better way to think about it ;D

i guess the way to do it is save a set of numbers (the angles) to eeprom

then read this and tag it to a analogue input number

then when i edit it i clear then write it???

am i on the right track

how the hell do i do that ;D

I'd suggest you move along first to getting the mechanical pot part working. Find out what the full measurement range is you will be reading. Get the range mapping/units conversion and display working. Then if you find it doesn't hold a good repeatable calibration you can add that function later.

Lefty

hi Lefty

i have done that :slight_smile: it works out on the mapping

i want to make it programmable just to learn to do it - i know it won't move ect as the pot is stable as F considering its just a cheap one!

i just want to learn how to do it more than anything :slight_smile:

So, the next step would be to add switches and 4 LEDs and resistors. Make an LED come on when a switch is presses, and off when it is pressed again.

When you get that working, and there are plenty of examples on the web, and included in the examples, you will have a pretty good idea how to alter the value, in whichever way you need to. To store the value, look at the EEPROM reference:

cheers :slight_smile:

awesome forum this :sunglasses:

If its not too late, I'd highly suggest moving to something like an optical rotation (rotary) encoder rather than a pot. Interfacing A Digital Rotary Switch | Hackaday

It removes the absolute and just measures referencial changes in angle - so you would have to calibrate to zero every time you turn it on, the upside is precision would go way up.

Rather than use a potentially expensive encoder, you can make your own and use a different optical encoder to read a printed larger strip.

the percision would only go as high as the encoder allows, Im pretty sure the 10 bit adc is more accurate than a physical object you can see

Well depending on the actual travel range (% of normal 270 degree travel) of the pot used, and the step rate of the encoder (steps per revolution) used it's kind of a toss up of which would give better resolution without specific data on both the pot and encoder. The pot would be an easier software effort.

Lefty