# Wind direction compass and stepper

hi all,

So i would like to take a wind direction sensor reading and then make a mechanical gauge to show direction on a compass.
i have no code yet as i am still thinking what would be the best hardware to use.

I was thinking of using a stepper motor combined with rotary encoder so it always knows it’s exact position, but right away i am thinking about a couple of ‘cons’

1. stepper uses a lot of power to keep position (i could perhaps shut it off between readings…as no mechanical force will be used to change position while turned off)

2. i will convert sensor reading to 360 degrees of the compass circle BUT, imagine that the wind direction balances between 355 and 5 degrees… would it be possible to code it in a way that stepper takes the short route from 355 to 5 degrees or would it always go in reverse full circle?
It easy to tell encoder to start over after 359 degrees but would stepper follow the short route… it’s whats out of my perception at the moment.

Anyone has any other suggestion as to what could be better than stepper?

Many thanks in advance,
Alek

1. Correct, can be done.
2. No problem to do in code, making the stepper advance 10 degrees from 355 to 5.

1. Correct, can be done.
2. No problem to do in code, making the stepper advance 10 degrees from 355 to 5.

I think there has been a misunderstanding maybe... maybe its not difficult to make it 'jump" from 355 to 5 degrees but would it aways know that it needs to go in circles instead of always going in reverse? That is, to always make a shortest path, from 300 to 50 and so on.
many thanks,
Alek

elcrni:
I think there has been a misunderstanding maybe... maybe its not difficult to make it 'jump" from 355 to 5 degrees but would it aways know that it needs to go in circles instead of always going in reverse? That is, to always make a shortest path, from 300 to 50 and so on.
many thanks,
Alek

Alek, once you get the stepper to always go one way to the final position, you can easily figure out how to decide the direction and number of steps for the shortest trip.

Paul

Do a search on this site.
Seems to have been done before with car instrument steppers and/or clock mechanisms.
You might have to remove the end-stop, and add a zero position sensor.
Leo..

elcrni:
I think there has been a misunderstanding maybe... maybe its not difficult to make it 'jump" from 355 to 5 degrees but would it aways know that it needs to go in circles instead of always going in reverse? That is, to always make a shortest path, from 300 to 50 and so on.
many thanks,
Alek

Add 360 degrees to both target and present position. Then subtract and compare to 180.

combined with rotary encoder so it always knows it's exact position

That is possible only with an absolute angle encoder, and it is very difficult to find such an encoder with angular resolution that matches the steps/revolution of typical steppers.

For this reason almost everyone chooses a simple zero indexing mechanism for the motor shaft, and counts steps from that position after startup.

Just for fun you could do a google search for stepper as a synchro. You can use the stepper as the wind direction sensor and use its input to drive the stepper for the display.

What is the stepper driving?

Google gray scale encoder.

Considder using LCD with graphics of compass and needle pointer