Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

line follower whit atmega8

Status
Not open for further replies.

Igor Moreira

New Member
Hi. I'm new here. I'm building a line follower robot, I'd like to know if someone have a poject of line follower whit atmega8, I think it is nice to build a robot like this.

Thanks.
 
it's not just easy but also doable in a week. as you have someone who can possibly do the mechanical parts then first thing to do is make a rolling cassy. connect 2 motors to a base plate. use DC motors or Servos. if using DC it's easier to control with AVR but it makes a lot of noise so you must take some steps to make it smaller (add caps etc, search the Internet for ways to do it). if you have chosen the motors, gear reductions and wheels. connect them to your base plate. i think 10cmx10cm will do for a smaller line follower...

Then if you have this working start making a schematic. get yourself a microcontoller (like ATTiny2313, which has an analog comparator) or something bigger that also has ADC pins. chose transistors to drive your DC motors or connect the servo and find example codes on how to drive a servo. if you go to the DC way you must find a big enough transistor to support the voltage and amps of your motor and connect the transistor to the microcontroller. i suggest connecting it via opto isolator to further reduce the noise. then start controlling the bot use PWM if the chip has one so that you can change the speed of the motor. make your bot go round and round.

If your bot moves nice then start with the sensor part. make 2 sensors using red super bright LED's and LDR's connect them on an angle and shield them from other light sources with tape, cloth or wood(drill holes into wood blocks and insert the sensor and led in it like i did). connect those sensor modules in front of your bot. Actually the best place is about 3cm from the point where the turning wheels are, but in front will do also. start experimenting with them reading the ADC values or using an Analog comparator to see witch one is lighter or dimmer (to compare the LDR values without the need of ADC).

if you are certain your sensors work well then you can start making the final program for the bot. make a block diagram of what your bot must do (flowcharts) and then using them start making the program. how to make that is another weeks topic and if you cant think of it ask me if you have done all the other steps above...


I hope it helped you get on the right track. if you don't understand anything feel free to ask me.

Rain
 
cause AVR is a proffecional tool not some LEGO like tool like parallax makes. nad you can get an AVR for 1$ but parallax chips costs starts from $10
 
your help

made a line follower few months ago.... travelled bout 40cm a second on a straight. Used dc motors to drive the guy. What do you want to know bout it... or do you just want me to send you the documentation done on it. Also has an infared device to stop it from hitting objects
 
I agree that AVR is a decent choice but so are PICs, MSP430s, Z8s, ... Basically just about any uC will work because line following, in it's basic form, is pretty simple.

You need motor control (2 HBridges) and a set of line sensors (2 to 5 or more). You need a small number of I/O pins - 4 for motor control and one for each line sensor. It doesn't need much memory or speed. The program can be built as state machine. You can get much more sophisticated to get better speed but I'd start simple.

And, you really need to google for "line following rogot"
 
jevon maybe an image of the bot for us to see? or the vidoe of the bot rushig 40cm a sec..
 
Igor Moreira said:
Hi. I'm new here. I'm building a line follower robot, I'd like to know if someone have a poject of line follower whit atmega8, I think it is nice to build a robot like this.
Thanks.

I've just finished building a line follower robot ,I use six sensors which are arranged horizontally. You should use PIC or 89 rather than atmega8 ,it works more perfectly.
howere ,you must care about noise of sensor. It is very important for building a line follower robot .To eliminate the noise of sensor ,you can use software or hardware to solve this trouble
good luck
 
alright, will put a up a pic of it when i can find my camera. a nice idea for the line follower is to put 2 sensors on the sides at the back of it. these can be used to check for acute angle turns. its a little hard to spot those if all your sensors are in a line at the front... but thats just if u want to get fancy
 
David Cook - Something About Robotics... a book with some good insight into making line followers for any help
 
I'm try to replicate this project.
http://elm-chan.org/works/ltc/report.html
But I have some problems, I dont' have the atmega8 16AC, I have atmega8 16PI, I don't use PIC becouse I don't have the programator for PIC, only the Atmel programator, If you have some project or some program with atmega8 16PI - 6 sensors, It will help me.. Thanks for your helps.
 
sigh. those are completely different processors? I suggest you spend a little time in the datasheet (summary is ok) and try to figure out the different between those two chips. you might just be suprised.

on the ELM line follower. I've seen that design before and was struck by his sensors. he pulls his npn phototransistors low, not high and uses them in an emitter follower form. he also has a single dropping resistor for all 6 line sensor LEDs. this will result in varying radiance. He doesn't use any shielding but relies on some sort of calibration.

still it actually works.
 
Igor Moreira said:
So, I Think I'm on the wrong way?

I have no idea what that means, Go look at the datasheets for the atmega8 16AC and 16PI try to understand the differences.
 
The data sheet is the same, the diferce between 16AC and 16 PIC is the 16ac is commercial SMD and 16PI is industrial, My problem is the terminals. in 16ac I have the terminals ADC6 and ADC6, In 16PI I don't have those terminals. So, I need to know where is this in 16PI. My english is not so good, Sorry. /but thanks for your helps.
 
giaosucan said:
I've just finished building a line follower robot ,I use six sensors which are arranged horizontally. You should use PIC or 89 rather than atmega8 ,it works more perfectly.
howere ,you must care about noise of sensor. It is very important for building a line follower robot .To eliminate the noise of sensor ,you can use software or hardware to solve this trouble
good luck
I have only the atmel programator, I don't have the PIC programator.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top