What you learn today
- Track panels
- Park at night
- Show output
This week took you from sin and cos via atan2 and the daylight sensor to whole solar fields. The project is the chip that will then run for years in the control cabinet: a solar tracker with display.
The plant
| Device | Prefab | Name |
|---|---|---|
| Daylight sensor (oriented like the panels) | StructureDaylightSensor | “Sonne” |
| Solar panels | StructureSolarPanel | “Solar” |
| LED display output | StructureConsoleLED5 | “Leistung” |
| LED display efficiency | StructureConsoleLED5 | “Wirkung” |
| Flashing light | StructureFlashingLight | “Solarwarnung” |
The rules
- Day: take
Horizontalfrom the sensor,Vertical= 90 − sensor value, limited to 15 … 165. - Night (
Activate0): parking position 90° / 60°. - Output: sum of
Chargeof all panels “Solar”. - Efficiency: average
Ratioin percent. - Sensor gone: panels stay put, warning on – the displays keep running.
- Panels gone: output 0, efficiency −1, warning on.
So the displays keep running without a sensor, the chip does not jump back to the start on NaN but only over the tracking:
bnan h display # without sensor: turn nothing, but display
Milestones
- Tracking with conversion and limits
- Park at night
- Show output and efficiency
- Sensor gone: stay put, warning, display keeps running
- Panels gone: output 0, efficiency −1, warning
Sum over no panels gives 0, Average on the other hand NaN. That is exactly why the output shows 0 when panels are missing, and the efficiency needs a NaN guard.
Project task
Task
Build the solar tracker following the rules above. defines, aliases and reading the sensor are already there.
Milestones
- Milestone 1: tracking with limits
- Milestone 2: park at night
- Milestone 3: output and efficiency
- Milestone 4: sensor fails
- Milestone 5: panels removed
Hints
Hint 1
Tracking and parking as in lesson 186, but with bnan h display and the label display: after it.
Hint 2
Output with lbn … Charge Sum, efficiency with lbn … Ratio Average times 100.
Hint 3
If the panels are missing, the efficiency is NaN: snan, “or” it into the warning, set it to −1 with select.
Quiz
2 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed all milestones of the project
- Passed the quiz with at least 60 %
Without an account progress is saved in this browser only.
Report a mistake in this lesson
Please sign in to report. Sign in