Turn servo 90 degrees during sun rise and sun set

Hi folks,

I just completed an all-sky-cam build which should only take pictures at night. To protect the camera sensor due to sunlight, the idea is to put a type of "cap" over the lens, an example below. The "cap" should start moving slowly over the lens as the sun rises and remove itself as the sun sets.

The controller is a Raspberry Pi and the servo is an SG90. I've already wired it to the RPi and can send commands to the servo with the "pi gpiod" node. Below is the flow as I currently have it to move it 90 degrees over. Any help on expanding the flow with the idea mentioned above is highly appreciated.

Jairo

Flow:

[{"id":"2a58b503dd48e2f8","type":"pi-gpiod out","z":"fdb1688a952261c8","name":"","host":"localhost","port":8888,"pin":"2","set":"","level":"0","out":"ser","sermin":"500","sermax":"1500","freq":"800","x":600,"y":180,"wires":[]}]

Example:


Why don’t you try using one of the ‘Cron’ contrib nodes?
https://flows.nodered.org/search?term=Cron&type=node

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.