Saturday, June 29, 2013

Simplified AVR USBasp Circuit Diagram

The circuit Mr. Fischl designed for avr usb asp cotains several jumpers. We can skip those if we do not want to use some features. So here comes the simplified circuit which works very well without any problem. Also the connections that goes to the target MCU is indicated. (Collected)



 
This is the same circuit with original pin configuration of atmega8 .







The farmware ,driver and details will be found in the following link



Friday, June 28, 2013

Dot matrix display

8*16 dot matix display using atmega8 and 74hc595


Proteus Design:


CODE:
#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>

const char dotmatrix[27][8] PROGMEM=
{

{
0b11000110,
0b11000110,
0b11111110,
0b11111110,          //A
0b10000010,
0b10000010,
0b01111100,
0b00111000,
},
{
0b11111110,
0b10000001,
0b10000001,
0b10000110,
0b11111110,            //B
0b10000001,
0b10000001,
0b11111110,
},
{
0b01111110,
0b10000001,
0b10000000,
0b10000000,            //C
0b10000000,
0b10000011,
0b10000001,
0b01111110,
},
{
0b11111000,
0b11000100,
0b11000110,
0b11000110,
0b11000110,              //D
0b11000110,
0b11000100,
0b11111000,
},
{
0b11111110,
0b11000000,
0b11000000,
0b11111000,            //E
0b11111000,
0b11000000,
0b11000000,
0b11111110,
},
{
0b10000000,
0b10000000,
0b10000000,
0b10000000,
0b11111000,                //F
0b10000000,
0b10000000,
0b11111111,
},
{
0b01111110,
0b10000010,
0b10001110,
0b10000000,                //G
0b10000000,
0b10000000,
0b10000001,
0b01111110,
},
{
0b10000001,
0b10000001,
0b10000001,
0b10000001,                //H
0b11111111,
0b10000001,
0b10000001,
0b10000001,
},
{
0b01111100,
0b00010000,
0b00010000,
0b00010000,                //I
0b00010000,
0b00010000,
0b00010000,
0b01111100,
},
{
0b00001100,
0b00010010,
0b00010010,
0b00010000,                //J
0b00010000,
0b00010000,
0b00010000,
0b01111110,
},
{
0b10001100,
0b10010000,
0b10100000,
0b11000000,                //K
0b11000000,
0b10100000,
0b10010000,
0b10001100,
},
{
0b11111110,
0b10000000,
0b10000000,                //L
0b10000000,
0b10000000,
0b10000000,
0b10000000,
0b10000000,
},
{
0b01000010,
0b01000010,
0b01000010,
0b01000010,
0b01000010,                //M
0b01011010,
0b01100110,
0b01000010,
},
{
0b10000001,
0b10000011,
0b10000101,
0b10001001,
0b10010001,                //N
0b10100001,
0b11000001,
0b10000001,
},
{
0b00111100,
0b01000010,
0b10000001,
0b10000001,                //O
0b10000001,
0b10000001,
0b01000010,
0b00111100,
},
{
0b10000000,
0b10000000,
0b10000000,
0b10000000,                //P
0b11111110,
0b10000001,
0b10000001,
0b11111110,
},
{
0b00000011,
0b10000100,
0b01111110,
0b10001001,            //Q
0b10010001,
0b10000001,
0b10000001,
0b01111110,
},
{
0b10000110,
0b10001000,
0b10010000,
0b10100000,
0b11111110,            //R
0b10000001,
0b10000001,
0b11111110,
},
{
0b01111100,
0b10000010,
0b00000010,
0b01111100,                //S
0b10000000,
0b10000000,
0b01000010,
0b00111100,
},
{
0b00010000,
0b00010000,
0b00010000,
0b00010000,                //T
0b00010000,
0b00010000,
0b00010000,
0b11111110,
},
{
0b00111100,
0b01000010,
0b10000001,
0b10000001,                //U
0b10000001,
0b10000001,
0b10000001,
0b10000001,
},
{
0b00011000,
0b00100100,
0b01000010,
0b01000010,                //v
0b10000001,
0b10000001,
0b10000001,
0b10000001,
},
{
0b11000011,
0b11000011,
0b10100101,
0b10011001,                //W
0b10000001,
0b10000001,
0b10000001,
0b10000001,
},
{
0b10000001,
0b10000001,
0b01000010,
0b00100100,            //X
0b00011000,
0b00100100,
0b01000010,
0b10000001,
},
{
0b00011000,
0b00011000,
0b00011000,
0b00011000,            //Y
0b00100100,
0b01000010,
0b10000001,
0b10000001,
},
{
0b11111111,
0b11000000,
0b01100000,
0b00110000,                //Z
0b00011000,
0b00001100,
0b00000110,
0b11111111,
},
{
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
},

};

int main(void){


DDRD=0xFF;
DDRC=0xFF;
PORTD=0xFF;
PORTC=0x00;
int k,j,l,q,i,s,t=1,sp=5,in,dec,array[]={18,0,4,4,3,26,26,26};
char A;
unsigned long   aaa,x;


while(1){t=1;
    for(s=0;s<=4;s++){
       for(q=7;q>=0;q--){
          if(t){q=32;t=0;}
          for(j=0;j<sp;j++){            //defines speed
            for(k=0;k<=7;k++){


            aaa=0x00;
            A=pgm_read_byte(&(dotmatrix[array[s]][k]));
            aaa=aaa|A;
            aaa=aaa<<8;
            A=pgm_read_byte(&(dotmatrix[array[s+1]][k]));
            aaa=aaa|A;
            aaa=aaa<<8;
            A=pgm_read_byte(&(dotmatrix[array[s+2]][k]));
            aaa=aaa|A;
            aaa=aaa<<8;
            A=pgm_read_byte(&(dotmatrix[array[s+3]][k]));
            aaa=aaa|A;


            aaa=(aaa>>q);




                    for(i=31;i>=0;i--){
                        PORTD=0b11111111;
                        PORTC=0b00000000;
                        x=aaa&(1<<i);
                        if(x)
                        PORTC=0b00000011;
                        //_delay_ms(1);}
                        else
                        PORTC=0b00000010;
                        //_delay_ms(1);}
                    }

                    PORTC=0b00000100;

                    PORTD=0b11111111^(1<<(k));

                    if(t==1)
                    _delay_ms(0.1);
                    else
                    _delay_ms(0.2);



                }
            }



        }
    }
}




return 0;
}


Tuesday, June 25, 2013

Bangladeshi Stores for Elcetonics and Robotics Spare Parts

Stores where u can find electronics and robotics parts at cheap rate by ordering by mobilephone.

1.Speedytron Electronics

Facebook Page: Speedytron Electronics
Mirpur, Dhaka.
Email: speedytron@asia.com



2.Telecom Spares
Facebook Page:Telecom Spares
Patuatuli,Puran Dhaka
Email: ahsan4141@yahoo.com



3.New Mitsu Electronics
Vasani Stadium, Dhaka
Cell:01710-846477



Bangladesh Online Stores (Rate is higher).

1. Techshop.com
2. store.roboticsbd.com
3.Facebool Page: hobbyshopbd (cheaper rate)
4.www.smrtechbd.com

Friday, June 21, 2013

How to make a line follower robot

Here u will find some information but no details is given. For details just google. U will find may sites and blogs with details.


What is line follower Robot?

A line follower robot is a robot that runs following a line in an arena and may be do some other staffs . 



What do I need to make one?

You will need five things.
1. A circuit which includes a micro controller (brain of the bot).
2.Motors to run the bot.
3.Sensors to follow the line.
4.A Chassis to make a structure.
5.Battery as power supply.

How can I make the circuit?

You can create the circuit from the schematic you designed by using vero board and soldering or u can design a PCB  then print it and then solder. For designing PCB u can use Preteus or Eagle Cad.

What about the Microcontroller?

I use atmega32. It has 8 ADC channel which can be used. It has enough memory and pins  and easy to use. C language can be used to program it.


What kind of motor do I use?

U can use small DC geared motor. U can use L293d as motor driver IC. Speed control can be done by PWM. But the problem of u this type of motor is u can  not stop the bot suddenly due to inertia and accurate speed control is possible only is a limited range.
U can also use stepper motor. They will give very accurate movement. U can add external gear for higher torque. But beginner may find them difficult in handling . I found the awesome.
U can also use modified servo motor for continuous rotation. They are then variable speed geared dc motor. They very easy to control by PWM also no driver IC is not needed. May be very handy for beginners but a little bit costly.

How do I make sensors?

Reflection of LED light is higher in white surface and lower in black surface. This phenomena is used to identify the position of the bot in the arena. Both LDR and photo diode give higher resistance if incident light is lower and lower Resistance if incident light is higher. This feature is used to make sensors.For making sensors u can use LDR and LED pair . But for black and white surface IR emitter and IR photo diode will be the best. In the circuit u can use voltage divider arrangement take input using microcontroller adc pin. For faster response Comparator arrangement with opamp is good. A pot must be kept for calibrating in comparator.

How do I make Chassis?

Chassis can be made in many different ways. Make sure that weight is as low as possible and the body is rigid enough. For that u can use plastic board.

What will be the arrangement of wheel?

The easiest arrangement is two wheel with two motors in the backside and one free moving wheel in the front side. This will allow you differential movement. Just google "differential movement". You can collect wheels from old toy or can buy a new toy and take the wheels from there. For the free moving wheel u can use ball caster or can use rubber ball caster.



Which battery do I use?

You can use rechargeable Lippo battery. You can also use rechargeable Li-ion battery. Two or three mobile phone battery in series is a good choice but a bit expensive. Battery with higher Ah rating will give  more backup.

What will be the algorithm?

 Simply saying when the bot is drifting off the line to the left then turn right a little bit and vice versa. Many adjustment and modification is needed for faster and smooth run. Many different algorithm can be used. Just google and learn. PID is a famous one for a continuous and smooth line.


Some special tips:
1. Keep the weight as low as possible for lower moment of inertia.

2. Use some kind of shield for the sensors to keep it out of external light.

3. Use at least three sensor on each side of the line and another one a bit in distance on each side  for crossing checking that means total of eight sensors.

4.Use rechargeable batteries with enough backup capability.


Some links: (U will find plenty of them in internet )

Photos of some line follower

Bangladeshi Stores for Elcetonics and Robotics Spare Parts 

Choice of Motor for line follower

http://futuredreamersrobotics.blogspot.com/2013/02/making-line-follower-robot.html

http://futuredreamersrobotics.blogspot.com/2013/01/making-light-sensor.html

http://extremeelectronics.co.in/robotics/making-a-line-sensor-using-ir-receiver/

http://extremeelectronics.co.in/avr-tutorials/line-following-robot-using-avr-atmega8/