Skinny Satan

A cool Nerd To Hangout With

Motorized Skateboard Operated by Hand Gestures

gestured SkateboardI was just sitting in our Robotics Lab doing nothing. And then I had this  idea to make an automatic Skateboard,operated only by hand gestures. How much more awesome it can be? :D
well then i started gathering the parts. We had some very high torque BLDC motors just sitting there. They had 75KG/CM of torque each making it 150KG/cm for me. Me being only 60 KG it was enough for me.

IMG_20130804_122750
Then there was this accelerometer a faulty one, with only X axis Working and Y axis burnt down. I tried making it work without reading its datasheet and by mistake made it hot and its Y axis output went non functional.
So i had this 3 axis accelerometer with only X and Z axis working.

IMG_20130804_122732
Also had a uC board with atmega16 on it. Few long wires a Limit switch and a bunch of connectors.

IMG_20130804_122741

Thanks to my Mechanical Engineer friends they modified an old chasis for me with the help of a Caster wheel into a very good looking (Ahem!) Skateboard.
So i mounted my Motors, powered the drivers, Charged my Accelerometer.
But sadly i realised as the Y axis was burnt i won’t be able to turn it properly. But then there was a little chance of a solution. The Z axis was sure giving the change in outputs on both tilts. But the output was same. Well i fixed it by a Limit switch And a little bit of extra coding. I added both left and right turns in it. (Well i have to do Gesture + Limit switch for left turn but its still enough awesome ;) )
so I just powered it up with my 5S LiPo and whoa it worked. My childhood dream was right there. A hand gesture operated Skateboard.

I have still kept a kill switch as at certain times it goes out of control and i surely don’t want to get killed. :P

I Still have to reduce all those wires and make it RF.

IMG_20130804_122839

IMG_20130804_122805

Whats Next?
-have to fix it with a Proper Accelerometer.

-Make it wireless
-Improve Stability.
-Add proper deceleration while Stopping

Here is the code:

#include
#include
#include"LCD.h"
void fwd()
{
	PORTD |= (1<<PD3);
	PORTD &= ~(1<<PD2);
while(OCR1A<=28)
{
	OCR1A++;
	OCR1B++;
	_delay_ms(30);
}
}

void rev()
{
	PORTD &= ~(1<<PD3);
	PORTD |= (1<<PD2);
while(OCR1A<=18)
{
	OCR1A++;
	OCR1B++;
	_delay_ms(30);
	
}
}


void right()
{
	
	PORTD |= (1<<PD3);
	PORTD &= ~(1<<PD2);
	while(OCR1A<=20)
	{
		OCR1A++;
		OCR1B=0;
		_delay_ms(25);
	
	}
}

void left()
{
	PORTD |= (1<<PD3);
	PORTD &= ~(1<<PD2);
	while(OCR1B=2)
{
OCR1A--;
OCR1B--;

}

	OCR1A=0;
	OCR1B=0;


}

void main()
{	
int x=0,y=0,z=0;
DDRA=0x00;
//PORTB=0xFF;
ADCSRA=0b10001001;
ADMUX=0b00100000;
PORTA |= (1<<PA3);
DDRA |= (1<<PA4);
PORTA &=~(1<<PA4);
lcd_init();
DDRD=0xFF;
PORTD |= (1<<PD6);
PORTD &= ~(1<<PD7);
TCCR1A=0xA0;
TCCR1B=0x11;
ICR1=50;

//right();

while(1)
{
	
		ADCSRA |= (1<<ADSC);

		while(!(ADCSRA & (1<<ADIF)))
		{
		;
		}
		x=ADCH;
		//lcd_gotoxy1(0);
		//lcd_showvalue(x);
		ADMUX++;
		ADCSRA |= (1<<ADSC);

		while(!(ADCSRA & (1<<ADIF)))
		{
		;
		}
		y=ADCH;
		//lcd_gotoxy1(6);
		//lcd_showvalue(y);
		ADMUX++;
		
		ADCSRA |= (1<<ADSC);

		while(!(ADCSRA & (1<<ADIF)))
		{
		;
		}
		z=ADCH;
		//lcd_gotoxy1(12);
		//lcd_showvalue(z);
		ADMUX--;
		ADMUX--;
		
		if(x100)
		{
			lcd_gotoxy1(0);
			lcd_string("REV");
			rev();
		}
		else if(z<100)
			{
				if(!(PINA & (1<<PA3)))
				{
				lcd_gotoxy1(0);
				lcd_string("LFT");
				left();
				}
				else if(PINA & (1<<PA3))
				{
					lcd_gotoxy1(0);
					lcd_string("RGT");
					right();
				}
				
			}
		else
			{
				lcd_gotoxy1(0);
				lcd_string("STP");
				stop();
				_delay_ms(1000);
		
			}
		
		/*
		/*else if(!(PORTA & (1<<PA3)))
		{
			lcd_gotoxy1(0);
			lcd_string("STP");
		
		}
		else
		{
			lcd_gotoxy1(0);
			lcd_string("NWS");
		}
		*/
		
	}
	
}

Enjoy :D

P.S. I am from Third world Country so the skateboard surely isn’t looking professional enough as i haven’t seen one in my whole life and only in cartoons but well if i get time i will make it look better.

Update 28 December:
Sorry guys, I was busy for a while. As i promised I made it Wireless Now you can operate it from 150M of distance and freak out the people. Sadly i cant upload the video as the Internet connection is very low down here.

About these ads

4 comments on “Motorized Skateboard Operated by Hand Gestures

  1. Pingback: Motorized skateboard controlled by hand gestures

  2. Pingback: This motorized skateboard is controlled by hand gestures | Bits & Pieces from the Embedded Design World

  3. Raj Sojitra
    September 24, 2013

    Gr8 work Dude……… and it’s good if you post circuit schematic with header and source files. so it help others to understand it better.

    • S4t4n
      September 25, 2013

      yes thank you. i will keep it in mind while posting next projects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on August 10, 2013 by in Robotics and tagged , , , .
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: