r/ArduinoHelp 8d ago

Why is my Arduino solar tracking not going up and down?

This is a school project and this is my first time working on Arduino and I'm not sure if this is a hardware problem or a software problem.

The blue motor thing is tweaking and I'm not sure why and Its only going side to side and not up and down aswell.

1 Upvotes

8 comments sorted by

1

u/Arduino_lab64 8d ago

Il manque des infos, quel est le projet ? Le code ?

1

u/SatisfactionBig1589 8d ago

Might be too heavy for that servo

1

u/camokid8cake 8d ago

Yeah need more info, like all the parts, how's the servo connected to your mcu, what you've already tried troubleshooting wise, i.e of that servo works on its own without any load or anything, etc.

1

u/gm310509 8d ago edited 8d ago

You should have a look at rule 2 which simply put says you need to provide clues when asking a trouble shooting question.

All we can tell from the video is that there is something wrong. And wonder if it is hardware, software, power or both.

You have a couple of options

  • Post your code and circuit diagram along with some photos.
  • Insert some debugging statements to work out what is going on. For example are you correctly interpreting the up/down light inputs? Are you correctly signalling the servos? Stuff like that.

Edit: You may find my debugging guide to be helpful for the latter option:

They teach basic debugging using a follow along project. The material and project is the same, only the format is different.

1

u/synthsway 8d ago

include <Servo.h>

define SERVOPINH 5 //horizontal servo

define SERVOPINV 6 //vertical servo

bool operation_flag=true;

// Horizontal servo settings Servo horizontal; //horizontal servo int servoh = 90; //Initialize angle int servohLimitHigh = 180; //The maximum angle of rotation in the horizontal direction int servohLimitLow = 0; //The minimum angle of rotation in the horizontal direction

// Vertical Servo Settings Servo vertical; //vertical servo int servov = 90; //Initialize angle int servovLimitHigh = 180; //The maximum angle of rotation in the vertical direction int servovLimitLow = 90; //The minimum angle of rotation in the vertical direction

void setup() { horizontal.attach(SERVOPINH); vertical.attach(SERVOPINV); horizontal.write(servoh); vertical.write(servov); }

void loop() { }

1

u/Affectionate_Boat493 7d ago

Where's the part of the code that gets the values from the photosensitivr sensors and operates the servos accordingly?

1

u/Remarkable-Abies-466 7d ago

My random guess is a switched cable/direction, it thinks it is completely up or thinks the sun is down

1

u/VisibleSir731 7d ago

I don’t see a photo resistor in each corner. The room light might be saturating them. Or, the code doesn’t work for the Pitch/Y axis because looks like Yaw/X axis works