Monday, July 20, 2009

Controlling 3 Stepper Motors with the 12 way Interface

source: http://www.southwest.com.au/~jfuller/

This interface is designed for use with a three axis robot arm based on stepper motors out of 5 1/4" drives. The circuit uses two ULN2803 'drivers' controlled by logic ICs to allow mutliple lines to be controlled at the same time. (Logic circuit design by Ian Threlfo). How it Works: Click here for an explanation of the circuit logic.


This is also the first interface bearing the Educational Computing Association of Western Australia (ECAWA) logo, indicating it has been developed by the ECAWA Robotics Special Interest Group.



Logic Design

PCB

Component Overlay


Parts List

2 x 4081 AND gate
2 x 4030 NOR gate
2 x ULN2803 Driver
1 x 74LS244 buffer
12 x 560 ohm resistor
12 x 100Kohm resistor
1 x 10Kohm resistor
1 x 47 uF electrolytic capacitor
1 x 2.1mm power socket
1 x DB25 PCB mount, right angle socket
1 x serial cable (male to male)
1 x 1 amp bridge rectifier
1 x 7805 voltage regulator
1 x 7812 voltage regulator
12 x 3mm red LEDs
2 x 0.01 uF greencap capacitors
1 x PCB

Wednesday, July 15, 2009

Low Speed AVR Oscilloscope

This project by Vassilis Serasidis. You can fing his original page at http://www.serasidis.gr/circuits/AVR_oscilloscope/avr_oscilloscope.htm


Features

Frequency measurement

Voltage input

Power supply

Liquid Display Crystal

Measurement display area

Auto trigger

up to 5 kHz (square wave)

24V AC / 30V DC

12V DC

128x64 pixels

100x64 pixels


The maximum signal speed who can show up this oscilloscope is 5 kHz in square signal. For other signals (sine or triangle) the frequency is lower ( almost 1 kHz) for having clear view of the signal.

Below is the schematic.

Description

The operating voltage of the circuit is 12V DC. By this voltage, the power supply is producing 2 voltages. +8.2V for IC1 and +5V for IC2 and IC3. This circuit can measure from +2.5V to -2.5V or from 0 to +5V dependent by S1 position (AC or DC input). By using probe with 1:10 division you can measure almost 10 times higher voltages. Moreover, with S2 you can make an extra division by 2 the input voltage.

Programming The ATmega32

Burn the ATmega32 with AVR_oscilloscope.hex and select external crystal at the fuses section.

After that, you Must disable the JTAG interface from your ATmega32 microController. If you don't do that, the mega32 will show you the initial screen and when it go to the oscilloscope screen it will restart immediately to the initial screen and it will stay there for ever.

Calibrations

The only 2 things you have to calibrate is the LCD contrast trimmer P2 and the P1, to move the beam at the center of the LCD. To do that, apply only the power supply to the circuit and adjust the P2 up to the point you will see clear the appeared pixels on the screen. Then, adjust the P1 up to the point the beam is moved at the middle of the LCD (at the horizontal line of the cross).

Usage

You can move the beam up or down the screen by pressing the buttons S8 or S4 correspondingly to measure the voltage of the signal. 1 volt is taking up 1 square height. With S7 and S3 you can increase or decrease the measurement speed. This oscilloscope has an automatic trigger. That means, if you have a continuous signal (ex a triagle waveform) the auto trigger will work perfect. If your signal is not stable (ex a serial transmittion) you can freeze the screen by pressing S6 switch. At his case you can get a snapshoot of your measurment signal. By the time you release the S6, the snapshoot will end.


PCB (101x160mm) and components placing

V1.01 Download the source code and the hex file of AVR oscilloscope.

V1.00 Download the source code, hex, schematic and PCB of AVR oscilloscope.

Software to make your own 128x64 pixel logos for graphical LCDs .

So, what do you think guy's? isn't this is great projects? thanks to Mr Vassilis Serasidis for this great projects.

If you have any doubt, please go to http://www.serasidis.gr/circuits/AVR_oscilloscope/avr_oscilloscope.htm










Tuesday, July 14, 2009

ATmega 32 & DS1307 Digital Clock

This projects called Digital Clock used ATmega 32 and RTC DS 1307.

FEATURES OF DS1307
1. Real time clock counts seconds,minutes,hours, date of month,moth, day of week and year with leap year compensation valid up to 2100.
2. 56 byte nonvolatile RAM for general data storage
3. 2-wrire interface (I2C)
4. Automatic power fail detect
5. Comsumes less than 500 nA for battery back-up at 25′C
With this features, DS 1307 is great rtc can we use to build a perfect digital clock.


Here is the schematic for DS1307 Connection to ATmega 32:









The clock display used LCD, C Port for LCD, B.0 Port for SCL and B.1 Port for SDA Port 0.

Below is the sourcecode to read RTC DS1307 used CodeVision AVR Evaluation 2.03.9

Source 1 :

**************************************************************

#include

// I2C Bus functions
#asm
.equ __i2c_port=0×18 ;PORTB
.equ __sda_bit=0
.equ __scl_bit=1
#endasm
#include

// Alphanumeric LCD Module functions
#asm
.equ __lcd_port=0×15 ;PORTC
#endasm
#include

// Standard Input/Output functions
#include
#include
#define ADDA_ADDR 0×90
#define EEPROM_ADDR 0xA0
#define RTC_ADDR 0xD0
unsigned char data_rtc[8];
unsigned char kata1[16];
unsigned char kata2[16];
unsigned char kata3[16];
unsigned char kata4[16];
unsigned char kata5[16];
unsigned char kata6[16];

// Declare your global variables here

unsigned char bcd2dec(unsigned char input){
unsigned char tmp_data, tmp1;

tmp_data = input;
tmp1 = tmp_data % 16;
if (tmp_data > 15) tmp_data = tmp_data / 16;
else tmp_data = 0;
tmp_data = (tmp_data * 10)+tmp1;
return tmp_data;
}

void read_rtc(void){
unsigned char i, tmp_data;

i2c_start();
i2c_write(RTC_ADDR);
i2c_write(0);
i2c_stop();
i2c_start();
i2c_write(RTC_ADDR | 1);
for (i=0; i<6; tmp_data =" bcd2dec(i2c_read(1));" tmp_data =" bcd2dec(i2c_read(0));">

unsigned char dec2bcd(unsigned char input){
unsigned char tmp_data;

if (input > 9) tmp_data = ((input / 10)*16) + (input % 10);
else
tmp_data = input;
return tmp_data;
}

void write_rtc(unsigned char alamat, unsigned char data){
i2c_start();
i2c_write(RTC_ADDR);
i2c_write(alamat);
if (alamat <>

unsigned char read_nvram(unsigned char alamat){
unsigned char tmp_data;

i2c_start();
i2c_write(RTC_ADDR);
i2c_write(alamat);
i2c_stop();
i2c_start();
i2c_write(RTC_ADDR | 1);
tmp_data = i2c_read(0);
i2c_stop();
return tmp_data;
}

unsigned char read_EEPROM(unsigned char alamat){
unsigned char data;
i2c_start();
i2c_write(EEPROM_ADDR);
i2c_write(alamat);
i2c_start();
i2c_write(EEPROM_ADDR | 1);
data = i2c_read(0);
i2c_stop();
return data;
}

void write_EEPROM(unsigned char alamat, unsigned char nilai){
i2c_start();
i2c_write(EEPROM_ADDR);
i2c_write(alamat);
i2c_write(nilai);
i2c_stop();

delay_ms(10);}

void main(void)
{
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud rate: 9600
UCSRA=0×00;
UCSRB=0×18;
UCSRC=0×86;
UBRRH=0×00;
UBRRL=0×47;

// I2C Bus initialization
i2c_init();

// LCD module initialization
lcd_init(16);
putchar(’p');
while (1)
{
read_rtc();
//0123456789ABCDEF
sprintf(kata1,”%2d:”,data_rtc[2],);
sprintf(kata2,”%2d:”,data_rtc[1],);
sprintf(kata3,”%2d”,data_rtc[0],);
sprintf(kata4,”%2d-”,data_rtc[4],);
sprintf(kata5,”%2d-”,data_rtc[5],);
sprintf(kata6,”%2d”,data_rtc[6],);
lcd_clear();
lcd_gotoxy(3,0);lcd_puts(kata1);
lcd_gotoxy(6,0);lcd_puts(kata2);
lcd_gotoxy(9,0);lcd_puts(kata3);
lcd_gotoxy(3,1);lcd_puts(kata4);
lcd_gotoxy(6,1);lcd_puts(kata5);
lcd_gotoxy(9,1);lcd_puts(kata6);
delay_ms(100);

}
}

Source 2 :

**************************************************************

#include

// I2C Bus functions
#asm
.equ __i2c_port=0×18 ;PORTB
.equ __sda_bit=0
.equ __scl_bit=1
#endasm
#include

// Alphanumeric LCD Module functions
#asm
.equ __lcd_port=0×15 ;PORTC
#endasm
#include

// Standard Input/Output functions
#include
#include
#define ADDA_ADDR 0×90
#define EEPROM_ADDR 0xA0
#define RTC_ADDR 0xD0
unsigned char data_rtc[8];
unsigned char data_t[16];

// Declare your global variables here

unsigned char bcd2dec(unsigned char input){
unsigned char tmp_data, tmp1;

tmp_data = input;
tmp1 = tmp_data % 16;
if (tmp_data > 15) tmp_data = tmp_data / 16;
else tmp_data = 0;
tmp_data = (tmp_data * 10)+tmp1;
return tmp_data;
}

void read_rtc(void){
unsigned char i, tmp_data,y;

i2c_start();
i2c_write(RTC_ADDR);
i2c_write(0);
i2c_stop();
i2c_start();
i2c_write(RTC_ADDR | 1);
for (i=0; i<6; tmp_data =" bcd2dec(i2c_read(1));" tmp_data =" bcd2dec(i2c_read(0));">

unsigned char dec2bcd(unsigned char input){
unsigned char tmp_data;

if (input > 9) tmp_data = ((input / 10)*16) + (input % 10);
else
tmp_data = input;
return tmp_data;
}

void write_rtc(unsigned char alamat, unsigned char data){
i2c_start();
i2c_write(RTC_ADDR);
i2c_write(alamat);
if (alamat <>

unsigned char read_nvram(unsigned char alamat){
unsigned char tmp_data;

i2c_start();
i2c_write(RTC_ADDR);
i2c_write(alamat);
i2c_stop();
i2c_start();
i2c_write(RTC_ADDR | 1);
tmp_data = i2c_read(0);
i2c_stop();
return tmp_data;
}

void main(void)
{
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud rate: 9600
UCSRA=0×00;
UCSRB=0×18;
UCSRC=0×86;
UBRRH=0×00;
UBRRL=0×47;

// I2C Bus initialization
i2c_init();

// LCD module initialization
lcd_init(16);
while (1)
{
read_rtc();
//0123456789ABCDEF
data_t[0]=(data_rtc[2]/10)|0×30;
data_t[1]=(data_rtc[2]%10)|0×30;
data_t[2]=(data_rtc[1]/10)|0×30;
data_t[3]=(data_rtc[1]%10)|0×30;
data_t[4]=(data_rtc[0]/10)|0×30;
data_t[5]=(data_rtc[0]%10)|0×30;

data_t[6]=(data_rtc[4]/10)|0×30;
data_t[7]=(data_rtc[4]%10)|0×30;
data_t[8]=(data_rtc[5]/10)|0×30;
data_t[9]=(data_rtc[5]%10)|0×30;
data_t[10]=(data_rtc[6]/10)|0×30;
data_t[11]=(data_rtc[6]%10)|0×30;

data_t[12]=(data_rtc[3]/10)|0×30;
data_t[13]=(data_rtc[3]%10)|0×30;

lcd_clear();
lcd_gotoxy(3,0);lcd_putchar(data_t[0]);
lcd_gotoxy(4,0);lcd_putchar(data_t[1]);
lcd_gotoxy(5,0);lcd_putchar(’:');
lcd_gotoxy(6,0);lcd_putchar(data_t[2]);
lcd_gotoxy(7,0);lcd_putchar(data_t[3]);
lcd_gotoxy(8,0);lcd_putchar(’:');
lcd_gotoxy(9,0);lcd_putchar(data_t[4]);
lcd_gotoxy(10,0);lcd_putchar(data_t[5]);

lcd_gotoxy(0,1);lcd_putchar(data_t[12]);
lcd_gotoxy(1,1);lcd_putchar(data_t[13]);

lcd_gotoxy(3,1);lcd_putchar(data_t[6]);
lcd_gotoxy(4,1);lcd_putchar(data_t[7]);
lcd_gotoxy(5,1);lcd_putchar(’:');
lcd_gotoxy(6,1);lcd_putchar(data_t[8]);
lcd_gotoxy(7,1);lcd_putchar(data_t[9]);
lcd_gotoxy(8,1);lcd_putchar(’:');
lcd_gotoxy(9,1);lcd_putchar(’2′);
lcd_gotoxy(10,1);lcd_putchar(’0′);
lcd_gotoxy(11,1);lcd_putchar(data_t[10]);
lcd_gotoxy(12,1);lcd_putchar(data_t[11]);

delay_ms(200);

}
}

Tuesday, July 7, 2009

Humanoid: Albert Hubo


A robot called Robot Hubo is the creation of professor Jun Ho-Oh. Jun Ho-Oh from South Korea's Institute of Advanced Technology. This robotcan talk, walk and even smile because it have 66 motors, wow this is huge amount of motor for a humanoid. Albert Hubo run on Windows XP Platform with 4 foot 5 inches tall make this robot become a very interesting robot and the way it talk and moving is cool. See the video below, it's cool.

Below is the video from the Development of HUBO (KHR-3)



Great video to learn much about making the humanoid.