Line Follower Robot using Microcontroller

4 stars based on 75 reviews

I'm Arun, an entrepreneur Blogger from India. Line follower code nxt robot using atmega32 Line follower robot is a mobile machine that can detect and follow the line drawn on the floor. Generally, the path is predefined and can be either visible like a black line on a white surface with a high contrasted color or it can be invisible like a magnetic field.

Therefore, this kind of Robot should sense the line with its Infrared Ray IR sensors that installed under the robot. Line follower robot is a useful robot that is used in ware houses, industries, and stores etc, where it follows a dedicated path.

This robot is an automatic robot i. The robot automatically follows a line without any deviation from the line. The robot changes its direction incase it deviates from the line.

Generally, the line is of black color on white surface or white line on black surface. To detect white and black color, we will use IR sensor because white surface reflects IR rays and black surface absorbs IR rays. In this way, the output of IR sensor defers in black and white surface. In our case, we will use a black line on white line follower code nxt robot using atmega32.

Here, we will use three analog IR sensors. All the three sensors will line follower code nxt robot using atmega32 placed in the front side of the robot and all will be pointing downward.

One sensor will be placed above the black line and the other two will be on left and right side of middle sensor. The output of the IR sensor changes when the sensors moves from white surface to black surface or from black surface to white surface and this change will be detected by the microcontroller.

But the outputs of the three analog IR sensors are analog in nature, so these line follower code nxt robot using atmega32 cannot be processed directly by the microcontroller. For this, we will use the ADC of the ATmega32 microcontroller to convert the analog signals to digital values. After converting the analog signals of analog IR sensors to digital values, the ATmega32 microcontroller will compare the sensor values with a reference value 3V in our case to know the position of the sensors.

When the position of line follower code nxt robot using atmega32 middle IR sensor is above the black line, the ATmega32 microcontroller will send the forward control signal to the DC motor driver LD of the robot to move the robot in forward direction and when the left sensor is above the black line, the ATmega32 microcontroller will send the left control signal to the DC motor driver LD of the robot to move the robot in left direction and when the right sensor is above the black line, the ATmega32 microcontroller will send the right control signal to the DC motor driver LD of the robot to move the robot in right direction.

The above processes of ADC conversions, sensors output comparison and robot control continues. In this way, the robot follows the black line.

My Cart 0 Wishlist 0 Login or Register. Login 0 Toggle navigation. Enter your email address to regenerate password. Steps - 11 0f Remember me Forgot Password? Subscribe to receive our periodic email updates. Analog IR Sensor Rs. DC Motor Driver Rs.

28nm bitcoin mining cards for humanity

  • Bitcoin hard fork date and time

    Btc bitcoin wikipedia

  • Twit security now bitcoin value

    Paesan london 2 exmouth market london ec1r 4px china

Kate spade weekender bag dimensions

  • Bitcoin maximum value

    Blockchains bitcoin price

  • Bitcoin price prognosis

    Btc e bot github enterprise

  • 0 confirmations bitcoin mining

    Sapphire 7990 litecoin faucets

Bitcoin slides on sec crypto exchange crackdown fears and binance hack rumour

28 comments Bot status fb keren bahasa inggris yang

Bitcoin mining ubuntu gui programming

Programming a Line Follower Robot is the next step that you should do after building it. This is a follow-up on my previous post Line Follower Robot - Build it from scratch. You have to calibrate the code to work properly with the hardware you have built. So the first step in programming is to make a demo track. This will help you test your code then and there. Here is the track that I built for my line follower.

The line is little over 3. I used a black chart paper to make the track and stuck it over white one. You can come up with you own innovative ideas but this is the most straight forward method I can think of.

If you have a better idea leave a comment. The next step is to sit with a pen and paper and make reading from the track that you just made. If you had used the circuit diagram that I posted or something similar, you should be having some indication LEDs at the output of the comparators like this one here,.

I placed the output LEDs green directly above the line sensor to avoid confusion. This made my board look really bad. Again was a trade-off between the look and the feature, I choose the feature. It is really helpful if those LEDs are right on top of the sensors. The IR emitter emits a constant IR beam. The white surface reflects most of the beam while the black surface absorbs most of the beam. This reflected beam is picked up by the IR detector and its conduction increases and hence a voltage variation in the output pin 0v for absence of IR rays and 5V for maximum intensity.

This is given to the comparator to compare with a reference signal generated by the potentiometer. That is how the line is sensed by the sensors. Back to the post, you have to place the bot over the line and see what it reads for various position of the line. Make sure that the line is always detected at least by one sensor if it is within the range of the three sensors. This is something for which you should take utmost care. I even mentioned in my previous post the maximum distance between the sensors should not exceed the width of the line.

With the calibration values at hand, you can start programming your robot. In your while 1 loop you should have a series of if statements which polls of these calibrated condition and makes direction changes accordingly.

The red dots are the sensors that are just above the black line and the green ones are on the white background. Case 1 is when the robot has to move forward as only the center sensor is low. Similarly Case 2 is towards right, Case 3 is towards left and case 4 is stop as all the sensors read high.

This code should be good for any linear track with normal bends. But this is not going to work if your track has right and acute angle turns. That is when we have to add some more logic to the existing one. Say you are facing a right angle, what would your sensor data read? The center sensor along with either of the two side sensors will read LOW.

This is when you have to tweak the direction logic a little. Now you have to define two kinds of left turns. One of it will rotate your right motor forward and the left motor backward. Do the same thing with the right turn logic. Now your code should have these lines too,.

You might have to survive a finite discontinuity in track or detect patterns in track to do some other tasks such as glowing an LED or setting up an alarm in the buzzer. Some of them even have inversion in logic you will be asked to follow white line on black background all of a sudden: This is just the beginning of line follower robot. There are a lot of possible difficulties that can be set up for you in a contest.

All cannot be discussed here. But we will discuss some of the most common one listed above in the posts to come. We will specially give importance to the Shortest Path solving robot in the near future.

Your robot has to go from the source to the destination by traveling any distance but return to the source from the destination but the shortest path only.

Siddharth is the founder and editor of embedjournal. He is a Firmware Engineer, techie, and a movie-buff. You get to know him on the following social channels. Programming a Line Follower Robot Jun Serial Ports are dead?