Arduino Finds the Pole Star

by cristinepotu7171 in Circuits > Arduino

3863 Views, 52 Favorites, 0 Comments

Arduino Finds the Pole Star

snapshot111.png
4444.png
How To Find The North Star? Arduino and Visuino Show Us The Way!

Hello, I present to you the construction of a simple astronomical instrument, an instrument that uses the reverse principle of the sextant. A compass module and an accelerometer detect the cardinal point and position relative to the visible horizon, and a Neo 6M GPS module detects latitude. All three values ​​establish the exact position of the polar star, Polaris, indicated by an SG90 servomotor.

The device can only be operated by viewing 2 LEDs with different colors. One for the indicator of the cardinal point and another for the indication of parallelism to the earth's surface. I chose this calibration mode because it is extremely difficult to look at the sky and at an Oled or any other kind of screen at the same time.




Supplies

IMG_20240328_115735.jpg
IMG_20240328_115831.jpg
IMG_20240328_115913.jpg
IMG_20240328_115852.jpg
IMG_20240328_115931.jpg
IMG_20240328_120037.jpg
IMG_20240328_120122.jpg
IMG_20240328_120002.jpg
buzzer.jpg
IMG_20240328_120143.jpg
IMG_20240328_120211.jpg

1.Arduino Nano board

2.Neo 6M GPS module

3.HMC 5883L compass module

4.MPU 6050 accelerometer module

5.SG90 servomotor

6.Red led

7.Blue led

8.ResitorsX2 470 ohm

9.Pushbutton

10.Active buzzer(optional part)

11.Protractor math

12.Case

13.Arduino IDE

14.Visuino software

Schematic Diagram

polaris schematic.png

The electrical diagram is not very difficult to execute. The active buzzer may be missing, it indicates by beeping when the servomotor indicates the position towards the sky.


The device is powered by a 9 volt battery connected with + to the Vin pin and negative to GND of the Arduino board.

Mechanical Assembly

IMG_20240328_123819.jpg
IMG_20240328_123911.jpg
IMG_20240328_123916.jpg
IMG_20240328_124220.jpg
IMG_20240328_123830.jpg
FTY1K61LUCOCKW2.jpg
snapshot113.png
snapshot114.png

The mechanical construction is important in this project. You can choose any other assembly method or any other box. It is important to place the compass module as far as possible from the rest of the components for a precise reading of the North angle. Otherwise, there are no construction restrictions. You can see in the images the version chosen by me and you can be inspired.

The compass module is mounted with the X axis along the indicator from the servomotor.

I mounted the accelerometer module on 2 nuts provided with springs for adjusting the parallelism to the earth's surface.

The GSM module has the antenna under the electronic board to avoid obstacles to the sky.



Calibration

snapshot116.png
snapshot117.png
snapshot118.png
snapshot119.png
snapshot124.png
snapshot125.png

Because it uses mechanical and optical indicators, the instrument requires 2 simple calibration steps.

Press the button connected to pin D8. The device enters servomotor calibration mode, the indicator will move from 0 to 90 degrees every 2 seconds. If the position does not correspond to the protractor, move the plastic support on the motor wheel to a precise indication.

Press the button again, the device enters accelerometer calibration mode. From the two spring screws, adjust in such a way that with the device placed on a flat surface, parallel to the surface of the earth, the red LED lights up continuously.


The Code

snapshot127.png
snapshot126.png
snapshot128.png
snapshot129.png
snapshot131.png
snapshot132.png
snapshot130.png
snapshot133.png

The code is built in the Visuino program, but you can also find the code in IDE format and a link to the libraries used by Visuino for this project.

If you use the Arduino IDE, you will have to copy the "Mitov" folder that contains the libraries into the folder with the libraries of the Arduino IDE program.

Open the Visuino program and distinguish the 3 modules used in the project and the Arduino board.

  • The "Compare Unsigned Value" component has the value 3. When the GPS module receives a greater or equal number of satellites, the blue LED starts flashing and the device starts working.


  • The "Compare Analog Range" component has the value set from 2 to 358. These are the degrees from the output of the "Compass Heading" component. When the device is in the range 358...2, the blue LED stays on continuously, so this value establishes the device's accuracy. You can try a more precise value by setting the range from 1...359, but the device will be more difficult to handle, recommending the use of a tripod in this case.


  • The "Map Analog" component sets the stroke of the servo motor pointer. The stroke is not linear and if the indicator does not show exactly at the two extremes, 0 and 90 degrees, you can modify the input of this component within small limits. If you notice in the images, I set the 90 degree input to 89 to compensate for the non-linearity of the servomotor stroke.



  • Attention: when uploading the code, disconnect the Rx pin of the Arduino board, reconnecting after the code has been uploaded!

Link to library https://app.box.com/s/tdynisrqobccnrx...

Operation

snapshot120.png
snapshot121.png
snapshot122.png
snapshot123.png
snapshot123.png
hq720.jpg
main-qimg-0d9ed29bfc557e3dd83186bd78c173c8.jpg
finding-zenith.png
567fef9b-a28b-4733-9002-62fb5c627695_900_900.jpg
  • The tool works both day and night, but only outside buildings. On clear nights you can see the north star following the indications of the instrument.

  • Attention: The device does not work in the southern hemisphere, below the equator. The North Star is not visible from the southern hemisphere!



Turn on the device by connecting the positive battery to the Vin pin of the Arduino board.

Wait 10-20 seconds until the blue LED starts flashing. This means that the GPS module has received a minimum number of 3 satellites.

Start turning the device clockwise or counterclockwise.As the servo pointer moves towards the North Pole, the blue LED flashes faster.

When the LED flashes very quickly, move slowly until the LED stays on. Hold the position for 5 seconds with the blue LED on continuously.

The servo motor indicator will move from 0 to 90 degrees depending on your latitude.

So the indication will show you both your latitude and the angle at which the North Star is in relation to the horizon in the north direction.

The angle of the Polaris star and the latitude are equal, as you can see in the attached images.


Lift the instrument and look in such a way that the horizon line is in the same line as the servo motor line. Try to keep both LEDs lit continuously. On a clear night you will see the North Star at the top of the indicator!



The project can be an excellent start for beginners in astronomy or for didactic use.

For other details, you can post your questions in the comments section.