Autonomous 2nd Sun

by Markus Opitz in Workshop > Science

12348 Views, 185 Favorites, 0 Comments

Autonomous 2nd Sun

Titel-0.jpg
Gif-Titel1.gif

Is it possible to use the principle "angle of incidence equals angle of reflection" in a meaningful way?


As a teacher, I also do various conversation training in English classes. To make it interesting in one game, the students are supposed to engage in conversation using survival techniques and discuss them. In an instructional text on signals it says:

" ln sunlight a simple mirror can generate 5 to 7 million candle power of light."

I have memorized this sentence. And since everyone is talking about saving energy and some rooms in my house don't have direct sunlight for a significant part of the day, this project with a sun mirror is the logical consequence.


Of course, every electronics enthusiast knows solar cells that align themselves with the sun. All you need are two servo motors, 4 light-sensitive resistors (LDR) and a microcontroller. But how does the mirror know where the sun is and where the light beam should shine?

A case for Arduino!



Supplies

Supplies.jpg

Arduino nano (e.g. AZ-Delivery)

4 servos MG996R (e.g. AZ-Delivery)

2 Metal brackets (instead of pan & tilt kits)

plastic mirror (light)

capacitor 470mF

4 light dependent resistors (LDR)

4 resistors 1 kOhm

joystick knob (e.g. AZ-Delivery)

switch + button

LED

breadboard or PCB


optional:

solar panel 5V

LiPo unit + 2 batteries

Principle

capture_001_06062022_213013.jpg
capture_002_06062022_232254.jpg

Everyone has used a mirror to catch the sunlight and blind someone or give signals. To light up your house, you can stand in the landscape with a mirror in your hand, but that quickly becomes boring.

I want to automate that.

To do that, I first have to find out:

- Where is the target?

- Where is the sun?

- At what angle do I have to put the mirror?


With the upper Pan & Tilt unit we aim at a desired point using a small joystick and confirm the servo angles by pressing the joystick button. These x/y coordinates are stored in the EEPROM of Arduino.


After that, the tracker searches for the brightest light source, the sun, and also stores the set angles. At the same time, the tracker has aligned the solar cell with the sun to collect energy for future movements.


Then the mirror has to align itself by bisecting the angle between the sun and the target. This applies to both the x-axis and y-axis angles.


Pan & Tilt Units

IMG_3646.JPG
IMG_3647.JPG
IMG_3651.jpg

The Pan & Tilt units are available ready to buy. They don't hold much weight, but for our purposes it might be enough. Assemble them according to the instructions.

Well, it turned out that the microservos "SG90" together with the leverage are not very powerful. So I got myself some strong"MG996R" and built a pan & tilt device with two simple metal brackets (as shown in the picture).

Lower servo: x-axis

Upper servo: y-axis



The servos need a lot of current when in operation. Even at rest they draw energy.

Two tricks:


a) Install a capacitor between 5V and GND to reduce any tremors in the servos.

b) The assignment Servo1.attach(2) (i.e. the control of the servo by Pin 2) is only made shortly before the work command. After the work is done, the servo is detached again (Servo1.detach()). Then, for example, the servos for the mirror can be attached.


LDR Sensor

LDR--1.jpg
LDR--2.jpg

In short, the optically separated light-sensitive resistors are used to determine in which direction the brightest light source is located (top left/right, bottom left/right) and the servos are then aligned until all four values are approximately equal. Then the optimal alignment is achieved.

I cut the LDR sensor partition from plastic and glued it. Solid cardboard is also suitable. An LDR is placed in each of the four compartments and fixed with hot glue. To be able to handle the cables better, I put the resistors that you can see in the circuit diagram on a small board and added connection pins.


Circuit

circuit.jpg

Unfortunately, I haven't had time to solder all the components onto a board yet. But the installation on a breadboard also works excellently.


Software

Organigramm.jpg

The software works as follows:

After setting up all components (LDR, servos, variables), it checks whether the slide switch is positioned at "set". If it is, the joystick can be used to aim at the target of the light beam via the LDR. (The LDRs point to the target.) Pressing the joystick button saves the coordinates.

If the switch is set to "automatic", the LDR unit aligns itself with the light source/sun together with the solar cell. If no change occurs for a while, these coordinates are also saved. The positions of the servos are already given in angles (0-180). This makes our calculation easier.

Now the angle bisectors are calculated from the sun and target coordinates and transmitted to the mirror servos. The mirror aligns itself in x- and y-direction so that it brings the light beam to the target.

After that, the unit sleeps for an adjustable time to save energy.

Then the mirror realigns itself again.


The special thing about the joystick control:

Normally the servos are oriented to the values of the potentiometers built into the joystick/thumbstick. If you let go of the control, it centres itself by springs and jumps back to the centre, as do the control signals of the servos. To prevent this from happening, the control value only jumps in small steps when the joystick is moved. When centering, nothing happens.


LowPower:

Sometimes the LowPower.h library is not yet integrated in your Arduino IDE. Download the zip file:

https://github.com/rocketscream/Low-Power

or

https://github.com/lowpowerlab/lowpower

"Code", "Download ZIP"

and include it with:

Sketch --> include Library --> add Zip-library

Mounting

IMG_3660.JPG
IMG_3648.JPG

I mounted the two units as close to each other as possible on a wooden frame. The slight angular shift with respect to the sun and the target is negligible. Make sure that the servos with mirror/solar cell can move without contact.


Reflections

Of course you can also use only one pan&tilt unit. However, the servos with tracker and mirror would have to move back and forth during the search and would possibly cause disturbing light effects.

Usage

IMG_3615.JPG
Film3-set1.gif
Film1-1.gif


- Switch to "Set“

- Use the joystick to aim at the target via the LDR device. Press joystick button to save the coordinates.

- Switch to "Automatic“

+ Tracker aligns itself with the sun.

+ Mirror aligns to bisector between sun and target.

+ Unit sleeps for x minutes.


The sun moves .....

24h = 360°

1h = 15°

20 min= 5°

10 min= 2.5°


In this way, you can redirect light to every dark corner, to every side of the house that is not facing the sun, to every atrium.

"Et lux perpetua luceat vobis."