Programming a Line Follower Robot

5 stars based on 58 reviews

The containers are painted metal probably steelwith a thin plastic coating on the inside. About this same time, the ChiBots robot club began discussing holding a robot line-following contest. Naturally, the colorful candy tin seemed like a perfect body to motorize and drive around the course.

I had two Buehler gearhead motors 1. They fit nicely and provide enormous torque at low speeds - exactly matching the needs for meticulous floor examination. Because the LEGO bar connects line following program for nxt robot using pic microcontroller friction to all standard compatible LEGO wheels, a wide selection of high-quality, inexpensive, production-precision tires are available and quickly interchangeable.

A screw hole is drilled and tapped threaded to lock the brass to the gearhead shaft. Since the shaft is off-center on the motor, the motor bodies are purposely misaligned with each other, so that the wheels actually line up.

Clamping wood to the metal frame. Drilling holes with tape protection. Masking tape blue protects the paint at the drill sites. Clamp a piece of scrap wood against the thin metal body to prevent vibration and tearing during drilling. Be sure to center punch holes before drilling!

A center punch looks like a solid metal pencil with a hardened pointy tip. Aim the tip against the location for the hole and then lightly strike the punch with a hammer.

The indentation created prevents the drill bit from walking away from the desired hole location. Print outs of circuits taped in place to guide center punching.

Wood to level the underside during LED and sensor hole drilling. The printed circuit boards will be attached to the body with size screws. To determine where the boards fit and where the holes should be drilled, Line following program for nxt robot using pic microcontroller printed the CAD circuit drawings and taped them to the body. The paper would shift and tear-up during drilling, so I just used it to center punch each of the holes and to determine drill bit sizes. The car body has wheel axles formed into the base.

A piece of scrap wood is taped in place to keep the candy container flat during drilling. Bare metal exposed with protruding burrs. LED and sensor holes. Most of the holes drilled cleanly, although many have burrs and rough protrusions. An unfortunate consequence of the drilling is the exposure of the raw metal of the body. Beneath the front of the robot, two rows of eight holes each are for phototransistors and one middle row of seven holes are for the ultra-bright, high-efficiency, low-current, red LEDs All Electronics CAT LED The LEDs provide a consistent and controllable source of light, to which the phototransistors sense the light reflecting off of the floor surface below.

To save money and to avoid multiplexing inputs, only six phototransistors are currently installed. A segment LED bar-graph fits into the front grill. Wax paper is taped against the front to prevent hot glue from spilling through the cracks during bar-graph mounting. Yellow color hot glue was used to fill the cracks, although clear or black would have been fine. The shards and scrap collect on the motors due to magnetic attraction. The above picture contains a more detailed shot of the brass coupler.

Complete instructions on making a motor shaft to LEGO wheel coupler are detailed in the book Robot Building for Beginnersor make couplers on a lathe. Also in the above picture, the rear of the opposite motor reveals the off-center shaft. Black paint to insulate phototransistors. Reddish-pink latex mask peeled off after painting. Remember earlier that the holes drilled in the metal body unfortunately exposed the bare metal?

With all the circuit boards installed, the robot refused line following program for nxt robot using pic microcontroller operate.

A quick voltmeter check revealed the motor power 10 to 18 volts had mixed with the logic power 5 volts. A motor power pin on a Molex connector on the power supply circuit board had burrowed through the thin plastic liner and contacted the body. Now, nylon washers add space between the body and the board to correct that line following program for nxt robot using pic microcontroller and provide an air channel for cooling.

The phototransistors at the front of the robot have metal cases. The metal cases touched the exposed metal in the burred holes. The metal cases also happen to connect to the logic power. Line following program for nxt robot using pic microcontroller used a line following program for nxt robot using pic microcontroller reamer to somewhat deburr and slightly enlarge the holes.

Then I painted the exposed metal on both the holes and the sensors. Not only does the paint protect the exposed metal from corrosion, but should provide enough electrical insulation in case the phototransistors accidentally touch the sides of the holes again.

The metal body proved to be a liability. Plastic frames are lighter, easier to work with, and self-insulate. On the other hand, steel is durable, strong, and feels less cheap. Before painting the sensors, I dabbed their lenses with reddish-pink latex mask.

After the paint dried, the masks were just peeled off. This latex mask is great stuff! I poured it over all the backs of the printed circuit boards as further electrical insulation.

No need to dry beyond tacky. Liquid latex is a weak conductor. A splotch on paper and an ohmmeter demonstrates kilohms of resistance, rather than multiple megohms. The volt and up motor power killed all microcontroller pins sinking current. Showing some signs line following program for nxt robot using pic microcontroller intelligence, I socket my DIPs.

The container has plenty of room for motors, batteries, and three homemade printed-circuit boards. With the exception of two pieces glued to the frame, everything disconnects either through screws or Molex connectors.

Either a pair of 9-V batteries or a pair of four AA cells supply power. In either case, the batteries are center tapped to provide line following program for nxt robot using pic microcontroller power to the Maxim voltage regulator for the logic circuits.

This saves on voltage drop, while still providing a full kick to the motors. An idea about using metal structural parts: Attach one lead to the body, and then manually probe each metal part on the PCBs once. I have a question about your method of center-tapping the power supply for the electronics. So theoretically even if both motors operate for the same amount of time, one battery will give out before the other? A simple ohmmeter check would have revealed the short before applying power.

In center-tapping, one battery does indeed drain faster than the other. Both batteries supply full power to the motors, but one takes on the additional load of the logic chips and LEDs. In essence, three fresh batteries can perform the work that would otherwise require four. The actual ratio depends on how much idle logic time vs. Regardless, you make an important point.

This particular center-tapping arrangement only provides power savings, not current savings and therefore not extended running time.

By the way, inductor and capacitor-based switching regulators are much more efficient for most applications. This allows for rapid replenishment or a change in weight 9 V batteries are obviously lighter.

Using two alkaline 9-volts tops the motor supply at 18 volts. These are a good choice only for competition runs. At the low end of the scale, using eight 1. Although in practice they seem to be capable of a little more than 10 volts. Tapping that provides half the rated value, 4. But since the chips are all high-speed CMOS or better, they operate just fine down to 3. The AA packs last a lot longer than 9-volt batteries. They are also capable of delivering more peak current. To counteract the added line following program for nxt robot using pic microcontroller, the packs are balanced in front of and behind the wheel shafts.

The tailpipe is actually a switch. By having a covert switch, no electronics mess with the racing car decorum when the lid is on. Years later, the tailpipe switch needed repairs. Click to see a movie of a strip of paper being moved underneath the sensors and the bar-graph LED displaying the robots sense of following. A Maxim MAX regulates logic voltage.

Notice the liberal use of capacitors on both the regulated and unregulated paths to make it through current surges without glitches. A green LED connects to the microcontroller board hinged above the power board.

The green LED blinks every second under microcontroller control. Also, the power switch is too difficult to reach. The 68HC08 microcontroller provides plenty of horsepower at 8 MHz.

Bitcoin kurs chart euro to us dollar

  • Bitcoin servers for sale

    Alethzero ethereum logo

  • Grondilu bitcoin values

    Bitcoin servers for sale

Event id 1017 bitstamps

  • Create a blockchain wallet

    Blockchain technology applications study guide

  • Bitcoin exchange money transmitter activity

    Bitcoin blockchain incidentedit

  • Tax rate on call options and also bitcoin trading bot strategy

    Deposito cryptsy bitcoin

Ledger wallet blue amazon

23 comments Smoker robot voice maker free download

Litecoin mining how to linux iphone 6s plus

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?