[arduino Motor Shield] Line Following Robot (FC-51)




I have noticed a lot of people make line following robots but not much using the arduino motor shield. And Since arduino didn't name it a pop-out name it got messed up between the shield and the arduino itself.So I said instead of making other people go through the process that I did I'll make a tutorial for them.


motors on the shield require more amps than an AA or a 9V battery can supply keep in mind that the shield can supply 4 amps to both channels (2 amps each) and a range from 6v to 12v DC. To know how much yours is visit:




I had the problem where the motors don't move unless i plug it using USB, until I found out that my battery only supplies less than 500mAh (milliAmps an Hour) so i went and bought 2200mAh rechargeable AA batteries and that did the trick.

So what are we waiting for lets begin...

Step 1: PARTS

In this project you will need:

1. 2x IR line follow sensor (I used fc-51)

2. 1x arduino motor shield

3. 1x any arduino

4. (optional) 2WD robot platform [or create your own]

5. 2x 6v motors (9v would work as well)

6. 5x AA (1000mAh or more) batteries

Step 2: Circuit and Connections


I couldn't find the fc-51 in fritzing so i put the humidity sensor there is no differences in the connection.

OUT of left sensor goes to A5

OUT of right sesnor goes to A4

POWER of both sensors go to 5V

GND of both sensors go to GND

Step 3: CODE

Please keep in mind that I wrote the code and it took me a lot of time so if you want to post it anywhere else please refer them to THIS instructable.

Thanks to all of you who read my post.

THIS IS my first post, I hope you like it.

and follow me because I will post the obstacle avoiding and many more robots soon with this motor shield too.

If you have ANY question don't hesitate to post them below.

youtube channel:




    • DIY Summer Camp Contest

      DIY Summer Camp Contest
    • Planter Challenge

      Planter Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    6 Discussions


    Reply 2 years ago

    I am having adafruit motor shield , used the circuit and code but my robot is not moving. Any suggestions? And please reply as soon as possble


    Reply 3 years ago on Introduction

    H-bridge is programmed the same way.. search online for programming it.

    Sorry I cant write the code for you as I have exams maybe a month or 2 so follow me to get the good news.

    Thanks Ofibro.

    Sasuch Uzuto

    2 years ago

    I am going to make this for my Physics project. Just the one I needed, with motor shield. Thank you very much! Arigatto!


    3 years ago


    I am trying linefollower robot using this instructable but i hav motorshield of adafruit.can i use the my motorshield for this robot?