Zeroing the device to true North, based on Magnetic North, Longitude and Latitude.
Creating a list of Azimuth points for a time series between a start time, and end time, by a given interval (seconds?)
Correct the Azimuth to a device specific angle (the Arduino tracks what angle it’s currently at, after zeroing it)
Pipe updated angle and movement commands to the Arduino over the relevant period of time
Android to Raspberry Pi Bluetooth connection to share Longitude, Latitude, and time
It seems very complicated!
I'm proposing a simpler architecture. On hardware side,
The turntable control unit has a GPS receiver. It measures location (including altitude) and time.
The turntable has a magnetic sensor (e.g. HMC5883 or LSM303). It is mounted beneath the rotating plate, and measures the orientation in relation to the magnetic north. A "slip ring" is needed to connect this sensor to the control unit.
The control unit could be Raspberry Pi or ESP32.
There's still an Arduino Uno controlling the motor, but ideally the motor can be directly controlled by Raspberry Pi or ESP32.
On software side, the workflow is:
Initialize GPS and wait for initial location and time measurement.
Transmit a "Z" command to the Uno, putting it to "stopped" state. It does not matter what position is zero.
Read a time measurement from GPS.
Read a magnetic heading measurement H from magnetic sensor. After adjusting with magnetic declination, it indicates that the turntable is pointing to H-DEC from true north.
Compute the solar azimuth angle A. In order to point to the sun, the turntable must be rotated clockwise for D=A-(H-DEC).
Transmit a "B" command with argument D, turning the turntable for D degrees.
Wait for command completion acknowledgement ("-").
Go to step 4.
Design rationale:
While having a webapp or smartphone looks fancy, they only increase system complexity.
Uploading timestamp from a smartphone is unreliable, because the internal oscillator in microcontroller or Raspberry Pi are inaccurate, and there could be several minutes of error after a full day.
If we use a GPS to obtain accurate timestamp, it can also be used to measure location.
Finding north is a big challenge. While the compass and GPS in a smartphone could help somewhat, it's impossible to achieve better than 5-degree accuracy. Therefore, we need a magnetic sensor attached to the rotating plate.
The magnetic sensor can only find magnetic north, while solar azimuth angle is counted from true north. Thus, we need WMM to adjust the sensor reading.
WMM requires an update every five years, hence the control unit must support updates. Updates could be wireless, through SD card, or reflashing the firmware with a USB cable.
I saw this list on on wiki:
It seems very complicated!
I'm proposing a simpler architecture. On hardware side,
On software side, the workflow is:
Design rationale:
Cost estimation of the control unit and sensors:
Regarding ESP32 vs Raspberry Pi (or other single board computer):