Close

Software design: transform an idea into real movements

A project log for mysoltrk - a solar tracker, reinvented

A different approach for a solar tracker, alternative movements, to be installed on the outside, to optimize the efficiency of solar panels

fulvioFulvio 06/16/2023 at 07:550 Comments

Now it's time to test the prototype #1 with the actuators.

We have realized a Arduino example, you can find it at github

Before we talk, let's watch the video:

The first think we said was: it works!

With a tiny processor, with a bunch of discrete components we are able to pilot a DIY actuators without limit switches.

This trick helps us to significantly reduce the complexity of the hardware.

Some notes about the code

// Program params
#define MAX_SAMPLES                 10
#define IGNORE_SHUNT_VREF_FOR_      1000L   // milliseconds
#define MAX_SHUNT_VALUE             20      // threshold
#define MIN_VREF_VALUE              100     // below this value the external power supply (eg: solar panel) supplies too little energy
#define MAX_SECONDS_MOVEMENT        180     // max seconds to move actuator
  1. MAX_SAMPLES: we use an array to read analog values and give an average of the values derived from the scan
  2. IGNORE_SHUNT_VREF_FOR_: when motor starts, we can ignore first values
  3. MAX_SHUNT_VALUE: a reference value, above this value it is assumed that the motor is straining and therefore it can be deduced that it has reached the end of its stroke
  4. MIN_VREF_VALUE: a reference values, below this value it is assumed that external power (solar panel) produce few energy and the engine should be stopped
  5. MAX_SECONDS_MOVEMENT: an arbitrary value, high enough to reach the end of actuator stroke
    digitalWrite(ACTUATOR_R_PIN1, LOW);
    digitalWrite(ACTUATOR_R_PIN2, LOW);
    digitalWrite(ACTUATOR_L_PIN1, LOW);
    digitalWrite(ACTUATOR_L_PIN2, LOW);

When program start, we put L298n pins to low.

Next, we put pin to high once at time to keep consumption low.

The result is one move at time for a single actuator.

Current absorption

As you can see on video, the circuit consumes about 0.1W with motor off and 0.2W with one motor on.

We think a good milestone has been reached!

Discussions