Hi all, I am new here and about to make a debut in robotics with a simple line follower robot.
I have chose AVR ATmega8 as my microcontroller because I found out that we can chose which pins we want as input and which ones as output. So this seems pretty cool for a microcontroller. Also i figured out that it is cheaply available here.
The working of my robot will be very simple. Three(or 5 if I feel later) sensors to detect white line which will be created by me. I will use a bright red LED and photoresistors to make the sensor. These sensors will give analog input to the ATmega8 which will process the data and accordingly adjust the supply for 2 DC motors(maybe using a L293D) to move the robot in different directions.
Since this is my very first robot, i want to make everything myself(means no kit, no prebuilt boards. Just a bit of advice from experienced people like you).
The things which I need to know is :
1) Is there any use of external crystal?(i dont understand the working of this crystal part and hence hope to avoid it)
2) How do I program it (The circuit schematic for the programmer.) I read the PICAXE manual and found that programming a PICAXE is easy as the circuit requires only 2 resistors. Is programming an ATmega8 simple as that?
3) What battery voltage shoud I use so that the circuit is not fried up. Also let me know the input/output current/voltage of parts for which I should take care.
The values of resistance are just for example. This is what is supposed to be my white line sensors
Another thing : I will be using Imagecraft ICC AVR software for programming the microcontroller as I once saw it and found it very easy to use. I am good with C-programming(another reason to choose AVR over PICAXE)
Hope to find help soon…thnx in advance
Soon I will start with this and upload pics as i finish it
1) Crystals are used because they go up to higher values and they are more accurate than the internal resonator. It`s completely optional though.
2) Program AVRs with ICSP or ISP (same thing). The simplest one uses a parallel port on your computer and a few resistors and all the hard work is done by the program writing software, but buying a good reliable programmer is worth the money in the long run.
Picaxe chips, like Arduinos, have a bootloader software already on the chip. That makes uploading easy when you have to do it a lot. You can find AVR bootloaders all over the net.
3) Feed 6v through a low dropout 5v regulator to give a smooth 5v supply for the chips.
I have created a schematic for the robot. I know it is still incomplete.
Have a look and tell me what changes I will have to make to get a perfect working circuit
I know it is a mess but i tried my best to make it look cleaner.
Anyways let me know what improvements I will have to make
I was thinking that I have made a circuit without any capacitors and resistors so I think I maybe missing something somewhere.
Also I wish to add LEDs to make it more cool. Like when robot is turned on, it will light an LED. When a motor is in forward direction it will lit another LED. When it is in backward direction, it will lit someother LED…etc…etc
Hope to find your replies soon…I am very impatient with this one
The programmer looks fine. I think they call those DAPA. I used one too before I upgraded my PC to one without a parallel port and found that it worked sometimes.
The schematic seems OK. Will you be using a bootloader? Youll want to use atmega pins 2 and 3 for communication and not motor control because theyre hardware serial.
Your motor supply is from the regulator which may push it past its limits unless they are really puny motors or you have a big regulator. Instead you can run unregulated 6v to the motor voltage pins of the L293. Pins 1 and 9 of the L293 are enable pins and can be wired to PB1 and PB2 for pwm control.
Put some capacitors around the regulator as shown here. Also put a 0.1uf ceramic across the GND and V pins of the Atmega right up close to it.
Don`t worry about resistors. You will use some later when you add more things to it like LEDs.
Think about adding a power switch and reset button to make testing easier for you.
I just saw and a little suggestion comes to my mind. just see if it is helpful.
While connecting Atmega8 to L293D, it is a good idea to connect the Input2 (pin 2 of L293D) and Input3 (pin 10 of L293D) to pin 15 and 16 of Atmega8, respectively. The advantage is that, these pins OC1A and OC1B can be used to generate a PWM and would be very helpful when you would like to control the speed of the motors by the Atmega8 (may be later when you get more comfortable with the AVRs).