92

Participated in an IEEE Hackathon where we built a line following robot. We were the slowest, but we had the most accuracy.

The image is our first attempt at getting it to work, consequently, we were the first team to actually get a prototype finished and working. Other people were trying to cram as many sensors as possible. We stuck with one, and 47 lines of code to make it work. Everyone else had more than 2 sensors and I can only imagine how much code they had.

Comments
  • 6
    That's awesome! Impressive work keep it up. I'd love to see more.
  • 11
  • 6
    47 lines of code? Wow that's impressive!

    Did you code it in C?
  • 6
    @MatanRad it's Arduino, so yeah kind of C.

    @oscarascal it would be even smaller if we didn't keep the debugging code in. Probably another 10 lines taken away for that
  • 3
    Can we see the source?
  • 1
    uff,the 'curve' at the bottom is a hard one. Good job on solving.
  • 2
    Curious about the source too!
  • 2
    @MatanRad Arduinoees is a C++ dialect.
  • 2
    I guess the best way is to follow the edge of the line? Light sensor shows .5 - go straight, less than .5 turn right wheel faster depending on the value and same for more than .5 just for other wheel.
  • 4
  • 2
    Interestingly our servos were not calibrated correctly, and so we had to use a for loop to figure out where each number was. We could also get a rough estimate of speed this way too.
  • 2
    Ahhh. That last curve. I almost wish it had made it in the second time. Damnit! Great work!
  • 0
    Might I recommend a 3pi from Pololu? 😊
  • 0
  • 0
    Good work man. Super awesome stuff!
  • 2
    //TODO: Watch video (^) later
  • 0
    I think I'd use 4 wheels and 2 sensors if speed matters. What kind of sensor do you use by the way? Is it done special line but our just optical?

    4 wheels for stability and one sensor to look ahead. Can do wonderful optimization with it like speed up if line is straight.
  • 0
    @hjk101 I'd disagree and say that two wheels and a free moving wheel is enough. With four wheels turning could become difficult. The motor we were using were servos.

    In our case we had no choice but to use 2 wheels. Using 4 would have deplete the battery too fast. Not only that but fine motor control was difficult given that we had to use low voltage to move (3.3v)

    As for sensors we used IR sensors. Using one was rather effective. Using two with one pointing ahead might have worked, but there are some edge cases that may have caused problems, for example the sharp angled lines may trick the bot into thinking its on a straight away because it sees all black.
  • 0
    I used to compete in RoboCup juniors's rescue line category. We did this and much much more. I loved it!
Add Comment