Gyro Sensor Controlled Car


3,972

22

3

Introduction: Gyro Sensor Controlled Car

I am an enthusiastic person who does not follow reality, instead who creates reality. I am sharin...

Had you ever played games by gyro Sensor on your mobile device ? Of course yes.

You can also use mobile gyro sensor to control any thing(i.e. cars,robots)in real life.you only need few things...

1)A Bluetooth module(HC-05).

2)A Micro controller development board(i am using AVR ATmega16).

3)A 12 volts battery.

4)Four DC geared motors & 4 wheels.

5)A chassis.

6)Some 1-2-1 Connector Wires.

7)A Android/Windows/ios Mobile/Tablet.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Chassis Construction

If you have a car then you can skip this part.

you just need to assemble motors on chassis by bolts.Now mount wheels on motors shaft.your car is ready.

Step 2: Electronics

Now connect bluetooth module to your microcontrollers Rx & Tx pin.Connect motors terminal to motor driver IC.

Now you just need to program your controller and connect to battery.

Step 3: Programming

This is a simple program for AVR ATmega16.......

#define F_CPU 1000000UL

#include

#include

#define USART_BAUDRATE 1200 // Baud Rate value

#define BAUD_PRESCALE ((F_CPU / (USART_BAUDRATE * 16UL)) - 1)

voidusart_init()

{

UCSRB |= (1 << RXEN)|(1<

UCSRC |= (1 << URSEL) | (1<

UBRRL = BAUD_PRESCALE;

UBRRH = (BAUD_PRESCALE >> 8);

}

unsignedintusart_getch()

{

while ((UCSRA & (1 << RXC)) == 0);

{

}

return UDR;

}

voidusart_putch(unsigned char send)

{ while(!(UCSRA & (1<

{

}

UDR=send;

}

voidputstr(unsigned char *str)

{

int i=0;

while(str[i]!='\0')

{

usart_putch(str[i]);

_delay_ms(100);

i++;

}

}

void main()

{

usart_init();

DDRC=0xff;

PORTC=0xff;

while(1)

{

int a= usart_getch();

if(a=='F')

{

PORTC=0b00000101;

}

if(a=='B')

{

PORTC=0b00001010;

}

if(a=='R')

{

PORTC=0b00000110;

}

if(a=='L')

{

PORTC=0b00001001;

}

}

}

Step 4: Final Step

Now you just need to download a app called Arduino Bluetooth RC Car from play store.

when you tilt your mobile it send data to bluetooth and bluetooth send data to microcontroller.

Turn on power of Car and have fun :)

If you have any query please comment below.

Be the First to Share

    Recommendations

    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    3 Discussions

    0
    rakib-1428
    rakib-1428

    3 years ago

    can you give me the code for arduino uno or mega?

    0
    arath2
    arath2

    4 years ago on Introduction

    the android app is customized for this code only or can be used for different purposes
    im planning to use at89s52
    is it possible for me to code using it???

    0
    prayag nao
    prayag nao

    Reply 4 years ago

    You can use with different type of controller