[Swlug] Entertaining error.

Curon Davies curond at gmail.com
Fri Jul 19 11:57:59 UTC 2024


>
> Two stepper motors will adjust the position of the assembly the ADCs are
> mounted on so that it will be able to track the sun precisely during the
> day.
>

Solar tracking is well established and predictable, have you thought about
using one of the many libraries available for Python?

https://pysolar.readthedocs.io/en/latest/

pysolar claims a maximum azimuth error of 0.176 degrees; I doubt you could
get anywhere near that? (the biggest error would be getting the compass
points aligned)

Curon

Ar Iau, 18 Gorff 2024 am 23:38 Rhys Sage via Swlug <swlug at mailman.lug.org.uk>
ysgrifennodd:

> My Pi Pico is producing readings from the 3 ADCs but I needed to calibrate
> the ADCs so I modified the code thusly...
> import machine
> import utime
> analog_value = machine.ADC(0)
> analog_value1 = machine.ADC(1)
> analog_value2 = machine.ADC(2)
> #zero values
> correction = analog_value.read_u16()
> correction1 = analog_value1.read_u16()
> correction2 = analog_value2.read_u16()
> while True:
>     reading = int((analog_value.read_u16() - correction)/256)
>     reading1 = int((analog_value1.read_u16() - correction1)/256)
>     reading2 = int((analog_value2.read_u16() - correction2)/256)
>     print("ADC 0: ",reading, " ADC 1 ", reading1, " ADC 2 ", reading2)
>     utime.sleep(0.2)
>
> Afterwards I realised that would not work in the real world. The plan for
> the ADCs is for each to read a patch of sunlight reflected off a white
> reflector in order to ascertain which is most illuminated by the sun.
>
> Two stepper motors will adjust the position of the assembly the ADCs are
> mounted on so that it will be able to track the sun precisely during the
> day.
>
> I realised that as soon as the power goes off it will have to be re-aimed
> and re-calibrated. Better instead to use electronics and put presets on the
> LDRs in order to calibrate for optimal aim. Thus, when the sun comes up in
> the morning and the thing comes alive, it'll be able to find the perfect
> aiming point.
>
> Usual issue - I spend so much time on real life I have little to no time
> for programming projects. Out all day Tuesday, out all day today. Out all
> day tomorrow and Saturday.
>
> The ultimate aim of this project (which will include some 3D printed
> parts) will be to produce a device that can track the sun, focussed through
> a flat magnifier and aimed at a coin held in an insulated mount. I just
> want to see if I can melt the coin by the power of the sun though the
> tracking software will serve another project that's planned later down the
> line.
>
> Rhys Sage
>
> --
> Swlug mailing list
> Swlug at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/swlug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/swlug/attachments/20240719/294b6b53/attachment-0001.htm>


More information about the Swlug mailing list