Need help with a project

I'm creating a bot for a competition and I ran into some problems. Here's a pic of the bot if that helps and a pic of the track. It's supposed to follow the line and collect the ping pong balls along the track but the issue is, when I tried to program it I don't know where to start, I'm using an MPU6050 for the pivots here since there are boxes around the pingpong balls and an 8 channel IR sensor array for the lines. Any advice would help, thanks a lot!


You should start with less ambitious project. Something with LEDs, then timers and millis, working with motors and sensors. Learn programming with books and library examples. A typical novices need a few years of learning to be able to program a bot yourself.

There are many tutorials on line followers and ping pong ball collecting robots. I think you can see them and make some modifications.

Start with the Arduino Cookbook. Then maybe you will be able to start.

Say more about this part.

a7

I agree, though ambitious, this project is for a competition. I do know how to use LEDs, timers, and non-blocking code. But this project really just stumped me, that's why I didn't know where to start because of the obscure track layout lol.

Thanks for your suggestion, there were many tutorials about line followers and ping pong ball collecting robots although those require, for example a continous track for line following, and for ping pong ball collection, a camera and computer vision. The project (i.e hardware) itself isn't that hard to grasp but the software side is bugging me out because of the mechanics of the competition.

We have robotics as part of our curriculum here in our country, this project is just for a competition that I wouldn't even dare to join if I wasn't selected lol. The mechanics and everything is ass but hey it's for experience.

Since there are wide gaps in the track, I figured that when the line sensors go off course/detect white, I would just switch to the MPU and make it go straight or pivot until it finds the line again, and I also tried to create a pre programmed track sequence but that ended up not working at all because the line sensors would conflict with the MPU. I decided to just use a line sensor then timed pivots for the preprogrammed sequence of turns.

Search "arduino micromouse" for example

I would not use the MPU.
Instead use wheel encoders to go straight and make turns.
Then solve a continuous path that collects all balls in one go.
Then program a line follower.
Then catch the side roads from the led array.

Ask Elon.

He knows a thing or two.

START:
  move to find a line
LINE FOUND:
  if line found, turn in direction of line, note line connection points (start, end)
FOLLOW LINE:
  if line moves left or right, correct direction
BALL FOUND:
  if ball found, collect ball, mark location, find line
GO HOME:
  if all balls collected, re-connect points to home, find line to drop

We actually used your idea, though not quite the same, but still based on your input. Thanks LOL, we won as national winners. Proving all the people who already judged my skills based on my question WRONG! Love from the Philippines <3

Batangas State University? Mabuhay.

Won't disclose due to privacy reasons, but still around that region. Thanks again!