Self Calibrating Sundial

11,990

121

20

Introduction: Self Calibrating Sundial

About: I have a master's degree in physics and my hobbies are: 3D printing, CAD design, arduino, astronomy, astrophotography, cosmology and sci-fi :)

I am an amateur astronomer and I have a small obsession regarding sundials. There are few types of Sundials, but all of them require calibration like positioning in South-North direction and tilting the plate at your latitude angle. I wanted to create Sundial that could be placed anywhere and it would calibrate itself.

Firstly I had to choose the right type of Sundial. Horizontal Sundial are easy to make, but the gnomon has to be mounted at the angle of your latitude, so if you change location you have to adjust the angle of the gnomon and the positions of the hour marks on the plate. In equatorial Sundials the gnomon is perpendicular to the plate and then the entire plate is tilted at latitude angle plus the hour marks are evenly spread every 15 degrees. I chose the equatorial Sundial because you don't have to adjust the hour marks and it's easy to tilt the entire plate at latitude angle.

I also had to come up with the system for the Sundial to find North-South direction so I used digital compass HMC5883L and continuous rotation servo. To find latitude I used Neo 6M GPS module.

Supplies

- Arduino Nano

- 2 x SG90 Servos

- HMC5883L digital compass

- GPS Neo 6M module

- 9V battery

- 9V battery clip

- Mini on/off slide switch

- 2 x M3x20mm bolt with nut

- Superglue

- Solder iron

- PLA/ABS

Tools:

- Soldering iron

- 3D printer

- Philips screwdriver

Software:

- Arduino IDE (https://www.arduino.cc/en/main/software)

- Cura (https://ultimaker.com/software/ultimaker-cura)

Step 1: CAD and 3D Printing

It took me about 20 working hours to design Self-calibrating Sundial and I had to make few adjustments after printing prototype. There is slot for GPS module and the antenna and the module itself is mounted inside the main body, but the antenna have to be mounted outside to maximise signal.

The digital compass is installed at the top of the main body to keep it as far as possible from interference from other electronic parts. I designed the slot for it, exactly on the South-North axis so it can be mounted only in the correct position.

I would recommend to use Cura for slicing model, but if you have your favourite slicing software that works well, there is no reason not to use it. I printed model in PLA, no brim or raft and 20% infill which is more than enough. I usually print with standard layer resolution 0.2mm, but if you wish to speed up printing you can increase the resolution to 0.3mm which is about the maximum for most FDM printers (without any upgrades).

NOTE: You have two different versions of the sundial plate, large and small. On the pictures above you can see the large version, but it you have smaller size 3D printer you can mount the smaller plate instead.

Step 2: Uploading the Code

Here is the code that you have to upload using Arduino IDE and instructions how to do that.

- Open Arduino IDE

- Open the code [File -> Open -> colour_instrument.ino]

- Connect Adruino Nano to PC/Laptop using USB cable

- Choose COM port [Tools -> Port “…” -> COM…]

- Choose Arduino board type [Tools -> Board: “…” -> Arduino Nano]

- Choose Arduino Nano processor type [Tools -> Processor: “…” -> ATmega328P] [It is possible that you will need to change it to ATmega328P (Old Bootloader) depending on Arduino Nano]

- Verify the code

- Upload

NOTE: After uploading the code and putting all electronics together, you will have to calibrate your continuous rotation servo. Change the value of myservo2.write(xx) ; (see picture above) to change speed and direction that your servo moves.

At certain value servo will not move and then if you increase that value it will move slowly left and if you decrease that value it will move slowly right. By increasing/decreasing that value more you can increase the speed.

I recommend to keep it slow as that will give Arduino the time to read the digital compass value and stop when it finds South.

I'm also still learning Arduino programming so the code is not perfect, but it works for now :)

Step 3: Making Continuous Rotation Servo

Standard SG90 servo is limited to 180 degrees movement and you have two options: either buy 360 continues rotation servo (expensive) or hack 180 degree servo and convert it to continuous rotation (cheap). Here is how to do it:

- Use Philips screwdriver and unscrew 4 small screws at the bottom of the servo and then remove the plastic cover.

- Make sure to put all the cog wheels back in the same configuration like on the picture above.

- Make a hole with small screwdriver where the shaft (see picture) supposed to go.

- Put all the cog wheels back in place and then screw the servo cover

You might come across different version of the SG90 servo and to change it to continuous rotation servo might need to follow instructions on this YouTube video https://www.youtube.com/watch?v=zV_5wUo7Kxs&t=104...

Step 4: Electronics

Please follow the connection diagram (see picture above) and then mount all components inside the cylindrical main body.

NOTE: If you decide to upload the code after soldering all components, make sure you disconnect Rx/Tx from GPS module as the code won't load.

Step 5: Assembly

- Glue the servo arms (should be included with SG90 servo) into bottom plate and into sundial servo arm

- The continuous rotation servo (the one we hacked in previous step) goes at the bottom and will be responsible for rotating entire Sundial and finding South-North direction.

- The regular SG90 servo should be mounted on to of the cylindrical case and then you can attach the 3D printed servo arm with glued arm.

- Mount GPS module with the antenna (remember to mount the module itself inside the case and the antenna outside)

- Mount on/off switch in the case

- Mount the digital compass in the slot at the top of the cylindrical case (see above picture)

- Put Arduino Nano and 9V battery in the designated slots (see above picture)

- Put two halves of the case together and use M3 bolts on both sides to secure it

- Glue the Sundial plate to the 3D printed servo arm (red part on the picture above)

Step 6: Self-calibrating Sundial in Action

The video below shows finished, working self-calibrating Sundial. First video is showing simulation in Fusion 360 and the second video is the actual Sundial. As you can see, after switching it on, it will rotate clockwise/anti clockwise until it finds South. Once that is done, you have to wait for GPS to find signal. Then it will transmit the latitude to the servo and it will tilt the plate at latitude angle.

This way this Sundial can be positioned in any direction and at any latitude. The only thing to remember is that it has to be placed on even ground.

Arduino Contest 2020

Second Prize in the
Arduino Contest 2020

1 Person Made This Project!

Recommendations

  • Fruit and Veggies Speed Challenge

    Fruit and Veggies Speed Challenge
  • DIY Summer Camp Contest

    DIY Summer Camp Contest
  • Make it Fly Challenge

    Make it Fly Challenge

20 Comments

0
Mr. E
Mr. E

1 year ago

Very cool ! If you ever update the dial face consider marking 9 and 10 pm for those of us up north, or even all 24 for the land of the midnight sun.

Well done, thanks for sharing.

0
KevinKarney
KevinKarney

1 year ago

A Great Idea! I love it. A small problem with the design. Between the autumn & spring equinoxes, the Sun will be below the plate so no shadow. This can be sorted by extending the gnomon downwards and making the plate transparent or by engraving the hours on the underside of the plate. Also if you add another servo to rotate the plate, you could make a dial that reads standard time rather than solar time, correcting for longitude and the Equation of Time. Contact me if you would like details. I would love it if you made this!!!!

0
poblocki1982
poblocki1982

Reply 1 year ago

Hi, thank you for your comment, I love your idea about the upgrade. As soon as I will have a little bit if time I will start working on v2.0 and please send me any comments or improvements you can think off and I will do my best to implement them :)

0
jnavarro1178
jnavarro1178

1 year ago

Very nice idea, and very educational instructable. Only one comment: I would have expected you to mount the dial upside down with respect to what is shown on the video. At noon the sun is highest and the shadow will be below the Gnomon, not above it.

0
poblocki1982
poblocki1982

Reply 1 year ago

Hi, you are right and thank you for your kind words. That was a prototype and I mounted it wrong way. After I made a video I corrected it :)

0
KevinKarney
KevinKarney

Reply 1 year ago

My remarks relate to a dial in the northern hemisphere......
Do add the plate rotation for longitude and Equation of Time! That would be really great. For details of the Equation of Time, see my website https://equation-of-time.info
0
KevinKarney
KevinKarney

Reply 1 year ago

With this design, the dial as shown works perfectly between the spring through to the autumn equinox. Not at the equinoxes themselves when the sun moves in the plane of the plate. See remarks above.

0
n6363l
n6363l

1 year ago

Question:
The magnetometer sensor finds only magnetic South. Is there compensation for the magnetic variation at a given lat/long in order to set it to True South? This would be another good reason to have the GPS to assist with the correction for mag variation via a table for world wide use.

0
poblocki1982
poblocki1982

Reply 1 year ago

Hi, you are right, it only finds magnetic south and at the moment there is no compensation to find true south. I did some tests and turns out that super precision isn't absolutely necessary for Sundials. Usually Sundial designed for specific latitude works pretty well for +/- 3 degrees difference which gives about 10 mins precision. However I'm working on better more precise and accurate version of self calibrating Sundial and I appreciate all sugenstions.

0
XTL
XTL

Reply 1 year ago

don't forget the southern hemisphere :)

0
poblocki1982
poblocki1982

Reply 1 year ago

Hi, you are absolutely right. I'm working an the code for Southern hemisphere and will upload it shortly :)

0
likhanecz
likhanecz

Reply 1 year ago

RMC - NMEA has its own version of
essential gps pvt (position, velocity, time) data. It is called RMC,
The Recommended Minimum, which will look similar to:
last 2 item before checksum should be magnetic variation and it's cardinale sign.


$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

Where:

RMC Recommended Minimum sentence
123519 Fix taken at 12:35:19 UTC
A Status A=active or V=Void.
4807.038,N Latitude 48 deg 07.038' N
01131.000,E Longitude 11 deg 31.000' E
022.4 Speed over the ground in knots
084.4 Track angle in degrees True
230394 Date - 23rd of March 1994
003.1,W Magnetic Variation
*6A The checksum data, always begins with *



if your gps module supplying magnetic variation with the RMC sentence then you read your compass and add the variation to it (E +, W -)
0
davidgoadby
davidgoadby

1 year ago

A nice project - well done! A neat extra feature could be a ring of LED's embedded in the dial to show the correct time even when the sun isn't shining. Or how about an actual hand underneath to cast a sort of shadow using a backlight? It's given me a few ideas and I will definitely make one of these. Thanks again for letting us share your design.

0
poblocki1982
poblocki1982

Reply 1 year ago

Hi, thank you .Actually that was my original idea too, but I decided to go with one step at the time :) Now when I have GPS and magnetic compass I'm working on adding LED's. Once finished I will post it either on Instructables or Thingiverse :)

0
Godovrall
Godovrall

Reply 1 year ago

Excellent work, maybe add some solar cells to replace the battery as well as power for the led upgrade you’re considering...

0
JohnG184
JohnG184

1 year ago

Very nice. I want one to mount on my truck dashboard !

0
Davilyn2
Davilyn2

1 year ago

Well, I don't have the skills or equipment to do something like this but kudos to you. You should make and sell these.

0
MartyJ1
MartyJ1

1 year ago

This mechanism might also be used to adjust a solar collector array, to follow the sun's path. (Solar arrays can be much more efficient if they can track and stay perpendicular to the sun's rays, both east-to-west and azimuth degree.) Instead of fixing in place to accurately show time, use time to change the movement to accurately follow the sun.

0
Makestreme
Makestreme

1 year ago

Great idea and well executed :)

0
poblocki1982
poblocki1982

Reply 1 year ago

Thank you :) it's been used as clock/decoration every time I'm having BBQ in my back garden lol