Need help to build solar tracker using Arduino and larger motor

I'm using 2 LDR to get sun position and move my servo motor. I would like to upgrade it to a larger and stronger motor using a Motor Controler.

This is the motor I'm looking to use and the controler

My code is working fine for my small servo motor and was wondering if this larger motor will require changed in my code to work....

#include <Servo.h>

Servo servo ;

int eastLDR = 0;

int westLDR = 1;

int east = 0;

int west = 0;

int error = 0;

int calibration = 600;

int servoposition = 90;

void setup()

{

  servo.attach(9);

}

void loop()

{

  east = calibration + analogRead(eastLDR);

  west = analogRead(westLDR);

  if (east < 350 && west < 350)

  {

    while (servoposition <= 150)

    {

      servoposition++;

      servo.write(servoposition);

      delay(100);

    }

  }

  error = east - west;

  if (error > 15)

  {

    if (servoposition <= 150)

    {

      servoposition++;

      servo.write(servoposition);

    }

  }

  else if (error < -15)

  {

    if (servoposition > 20)

    {

      servoposition--;

      servo.write(servoposition);

    }

  }

  delay(100);

}

I think before you worry about the code you need to get the motor to controller to Arduino defined.

For instance, Why wouldn't you use the 30 RPM motor instead of the 60 RPM?
The motor has an encoder, you can use it to count the motor rpm (or shaft, not sure which.

What are the design requirements that led you to choose that motor?

I look at this motor because I know they can work with Arduino

I pick the 30 RPM for the torque, as I want the motor to be able to resist winds for exemple. As for the shaft, it can easly connect to my solar panel structure.

I did not order the motor yet so I'm open for recommandation.

I need a motor that can have enough torque to resist winds and old the aluminium rotating structure that will build to old the 2 solar panel. Overall the structure with the panel will weight about 30 to 40 kg.

Thanks

The 5204 is NOT a servo motor but does have an encoder, so you will need to connecto to it
You can only control the speed and direction with that controller.
You use the encoder to know how far you have moved

You would probably want to use this controller with that motor:

Thats was my concern about the code, mine is about position where the 5204 seem to be speed related and not position.. Thanks!

I saw that but never use it. I'll have to look more in details. thansk!

Any motor will work with Arduino, if you have the correct motor driver.

To steer your installation, you need to estimate the amount of torque required, and order a gear motor capable of delivering at least twice that torque. Worm gears cannot be driven backward and help resist wind pressure.

Introduction to force and torque.

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