Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Hand Gesture Controlled Wireless Robot

By Hai Prasaath K September 8, 2017

The wireless robots are controlled in many ways. Usually, these robots are controlled with the help of a remote control which connects with the robot via Bluetooth, Wi-Fi or RF interface. The remote control has physical buttons to move the robot in different directions. The use of a remote control having buttons to control a robot has a drawback when the robot needs to be controlled instantly and precisely. It involves delay due to the response time of the human handling the remote control.
 
The response time in controlling the robot can be reduced by providing some sort of advanced human interfaces like controlling the robot via gestures, eye movements or brain waves. This way, not only the response time required for controlling the robot can be reduced, the robot can also be controlled more precisely. In this tutorial, a gesture controlled robot is designed which can be controlled directly by the hand gestures. 
 
The remote control developed in this project is a glove equipped with accelerometer based circuitry. The remote control is used to move a wireless robot in forward, backward, left and right direction and to stop the robot. The accelerometer used in the development of this remote control is ADXL335. The remote circuitry is based on the AVR microcontroller – Atmega 32. It uses 434 MHz RF module to connect with the wireless robot. In the robot circuitry, simply, an RF receiver circuit is interfaced with the motor driver IC. The robot is built on two-wheel and a castor body. There are two geared DC motors attached to the wheels and coupled with the L293D motor driver IC to move the robot. 
 
In this tutorial, a prototype model is developed. That is why, instead of encasing the remote circuitry in a glove, it is assembled on a breadboard. An LCD is also interfaced in the remote circuitry to monitor the change in axis values during the calibration and testing of the control circuitry. Once the control circuitry is successfully tested, the LCD section can be removed from the circuit and code and the tested remote circuitry can be encased in a glove. 
 
The control circuitry of the wireless robot does not have any controller. The robot is directly controlled by the digital data passed on the RF interface. The remote circuitry has AVR Atmega 32 as the sitting microcontroller. The code managing to interpret accelerometer signals and to pass appropriate digital data to the wireless robot runs on the AVR controller. The AVR code is written and compiled using the AVR studio. 
 
Prototype of AVR based Gesture Controlled Wireless Robot
 
Fig. 1: Prototype of AVR based Gesture Controlled Wireless Robot
 

Components Required – 

List of Components required for AVR based Gesture Controlled Wireless Robot
 
Fig. 2: List of Components required for AVR based Gesture Controlled Wireless Robot

Block Diagram – 

The remote circuitry is built by assembling together the following building blocks – 
 
Block Diagram of Transmitter Side of AVR based Gesture Controlled Wireless Robot
 
Fig. 3: Block Diagram of Transmitter Side of AVR based Gesture Controlled Wireless Robot
 
 
 The control circuitry of the wireless remote is built by assembling together the following building blocks – 
 
Block Diagram of Receiver Side of AVR based Gesture Controlled Wireless Robot
 
Fig. 4: Block Diagram of Receiver Side of AVR based Gesture Controlled Wireless Robot
 
Circuit Connections – 
The project includes two circuits – one is the remote circuitry based on AVR microcontroller and other is the receiver circuit mounted on the robot. The remote circuitry has the AVR Atmega 32 as the sitting MCU. The LCD module, ADXL335 accelerometer sensor, Encoder IC and RF transmitter are interfaced to the AVR controller in the remote circuitry. The circuit connections of the remote circuitry are as follow – 
 
Image of Transmitter Side of AVR based Gesture Controlled Wireless Robot
 
Fig. 5: Image of Transmitter Side of AVR based Gesture Controlled Wireless Robot
 
 
AVR Atmega 32 – This is a 8-bit AVR RISC based microcontroller. It comes in a 40-pin package and has 2KB RAM, 32KB flash memory, 1KB EEPROM, 32 General Purpose Input Output (GPIO) pins, 8 10-bit ADC channels, One SPI, one UART and one TWI interface on-chip. The controller has three in-built timers of which 2 are 8-bit timers and one is a 16-bit timer. The controller operates up to a clock frequency of 16 MHz. By executing powerful instructions in a single clock cycle, the Atmega 32 achieves throughputs approaching 1 MIPS per MHz allowing the system designers to optimize power consumption versus processing speed. The controller comes available in 40-pin Dual Inline (DIP) Package. Check out the pin diagram and pin configuration of this AVR controller here. 
 
In this project 17 GPIO pins of the controller are used of which 11 pins are used to interface the character LCD, 2 pins are used to interface ADXL335 sensor and 4 pins are used to connect with the data pins of the encoder IC. 
 
16X2 LCD: The 16X2 LCD display is used to monitor the sensor values. It is interfaced with the AVR microcontroller by connecting its data pins to port B of the controller. The data pins DB0 to DB7 of the character LCD are interfaced to pins PB0 to PB7 of the AVR Atmega 32 respectively. The RS, RW and E pins of the LCD are connected to pins PD0, PD1 and PD2 of the AVR respectively. The circuit connections of the character LCD with the AVR controller are summarized in the following table – 
 
Table Listing Circuit Connections between AVR ATMega32 and Character LCD
 
Fig. 6: Table listing circuit connections between AVR ATMega32 and Character LCD
 
Accelerometer ADXL335 – ADXL335 is the accelerometer sensor used in the project. The sensor module has five terminals for ground, VCC, X-axis Analog output, Y-axis Analog Output and Z-axis Analog Output. The VCC and ground are connected to common VCC and ground respectively. The X-axis Analog Output and Y-axis Analog Output of the sensor module are utilized and interfaced to Port A Pin 0  and Port A pin 1 of the AVR controller respectively. 
 
RF Transmitter – The RF transmitter is used to transmit the control signals for motor control. The RF transmitter module is a small PCB sub assembly. The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is represented as variations in the amplitude of carrier wave. This kind of modulation is known as Amplitude Shift Keying (ASK). This RF module operates over 433 MHz frequency and uses ASK modulation technique. The pin configuration of transmitter module is as follow- 
 
Table Listing Pin Configuration of RF Transmitter
 
Fig. 7: Table listing pin configuration of RF Transmitter
 
The serialized data from the encoder is received at pin 2 of the module and passed on to the antenna from pin 4 of the module. 
 
HT12E IC – The HT12E IC converts the parallel data into serial data for passing it to the RF transmitter. HT12E encoder IC belongs to the 212 series of encoders. It is paired with 212 series of decoders having the same number of addresses and data format. HT12E is capable of encoding 12 bits, out of them 8 are address bits and 4 are data bits. Thus the encoded signal is a serialized 12-bit parallel data comprising of 4-bit data to be transferred appended with the address byte.
 
The data pins D0, D1, D2 and D3 of the IC are connected to the pins PC0, PC1, PC2 and PC3 of the AVR controller respectively. All the address pins of the encoder IC are hard-wired to ground, so it has an address byte of 0x00. The pin 17 of the IC is connected to pin 2 of the RF transmitter. So, the serialized data is passed from pin 17 of the IC to data input pin of the RF transmitter. 
 
HT12E has a transmission enable pin which is active low. When a trigger signal is received on TE pin, the programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium. HT12E begins a 4-word transmission cycle upon receipt of a transmission enable. This cycle is repeated as long as TE is kept low. As soon as TE returns to high, the encoder output completes its final cycle and then stops. 
 
The control circuitry of the robot consist of RF receiver, RF decoder IC and L293D motor driver IC. The circuit connections of the receiver circuit are as follow – 
 
Image of Receiver Side of AVR based Gesture Controlled Wireless Robot
 
Fig. 8: Image of Receiver Side of AVR based Gesture Controlled Wireless Robot
 
 
RF Receiver – The RF receiver detects the radio signal carrying the motor control signals. The RF receiver module has 8 pins and has following pin configuration – 
 
Table Listing Pin Configuration of RF Receiver
 
Fig. 9: Table listing pin configuration of RF Receiver
 
The RF receiver passes the serial data received over RF frequency from its pin 2 to pin 16 of the decoder IC.  
 
HT12D Decoder – The signal detected from the RF receiver is passed to the HT12D decoder. It converts the serial data back to the parallel data after separating data and addresses. HT12D belongs to the 212 series of decoders and can be paired with 212 series of encoders having the same number of addresses and data format. HT12D is capable of decoding 12 bits, out of them 8 are address bits and 4 are data bits. The 4-bit data is of latch type and when passed to the output data pins it remains unchanged until the new data is received.
 
The serial data received by the RF receiver is parallel output from its data pins as it is. The data pins of the decoder IC are interfaced with input pins of the L293D motor driver IC. So the digital logic at the data pins of the decoder control the rotation of the DC motors. All the address pins of the decoder IC are connected to ground to match the address byte to 0x00 same as of the transmitter circuit. 
 
L293D DC Motor Driver IC – The L293D is a dual H-bridge motor driver integrated circuit (IC). The Motor drivers act as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors. It has 16 pins with following pin configuration: 
 
Table Listing Pin Configuration of L293D Motor Driver IC
 
Fig. 10: Table listing pin configuration of L293D Motor Driver IC
 
There are two DC motors used for making the robotic car. The DC motors are interfaced between pins 3 and 6 and pins 14 and 11 of the motor driver IC. 
 
The L293D IC controls the DC Motors according to the following truth tables: 
 
Truth Table of L293D Motor Driver IC
 
Fig. 11: Truth Table of L293D Motor Driver IC
 
The pin 4, 5, 13 and 12 of the L293D are grounded while pin 1, 16 and 9 are connected to 5V DC and pin 8 is connected to 12V DC. The pins 2, 7, 10 and 15 of the motor driver IC are connected to data pins D0, D1, D2 and D3 of the decoder IC. The DC motor attached to right wheel is connected to pins 11 and 14 while motor attached to left wheel is connected to pins 3 and 6 of the motor driver IC. 
 
Geared DC Motors – In this robot, 12V geared DC motors are attached to the wheels. Geared DC motors are available with wide range of RPM and Torque, which allow a robot to move based on the control signal it receives from the motor driver IC. 
 
Power Supply – In the remote circuit, RF transmitter, encoder IC, AVR controller and LCD module need a 5V regulated DC for their operation. In the receiver circuit the motor driver IC needs 12V DC while the RF receiver and decoder IC need 5V DC for their operation. A 12V NIMH battery is used as the primary source of power in both the circuits.
 
The supply from the battery is regulated to 5V and 12V using 7805 and 7812 ICs. The pin 1 of both the voltage regulator ICs is connected to the anode of the battery and pin 2 of both ICs is connected to ground. The respective voltage outputs are drawn from pin 3 of the respective voltage regulator ICs. An LED along with a 10K Ω pull-up resistor is also connected between common ground and output pin to get a visual hint of supply continuity. Despite using 12V battery, 7812 is used to provide a regulated and stable supply to the motor driver IC. 

How the circuit works – 

As the battery is attached to the robot, the RF receiver is configured to pair with the RF transmitter and it starts receiving the data. On the transmitter side, first the initial messages are flashed on the LCD display and the AVR microcontroller starts reading the X-axis and Y-axis data from the ADXL335 accelerometer module in the form of analog voltage. The voltage is sensed by the analog input pins and converted to a digitized reading using in-built ADC channels.
 
The ADC channels are 10-bit long, so, the digitized reading of accelerometer’s X-axis and Y-axis varies from 0 to 1023.  The digitized values are displayed on the LCD module along with the control command passed for the respective axis values. The reading is manipulated to determine whether the accelerometer has tilted forward, backward, left side or right side. Depending upon the tilt of the accelerometer, the controller passes on appropriate data bits to the RF encoder to drive DC motors for forward, backward, left or right movement of the robot. 
 
The same digital logic is reflected at the data pins of the decoder IC as it is.  The robot can be moved forward, backward, left or right by implementing the following input logic at the motor driver pins – 
 
Logic Table of L293D Motor Driver IC for AVR Robot
 
Fig. 12: Logic Table of L293D Motor Driver IC for AVR Robot
 
Check out the programming guide to learn how the AVR controller reads data from the ADXL335 accelerometer sensor and manipulate X-axis and Y-axis values to determine control commands. Learn from the code how digital data is passed on to the RF module for controlling the robot. 

Programming Guide – 

In order to program Atmega 32 microcontroller, AVR studio 4 and GCC compiler are the software tools required. For learning how AVR studio 4 is used see the following tutorial – 
 
Working with AVR Studio
 
First of all, separate header files are imported for the Initialization of lcd, ADC and ADXL335 accelerometer. The lcd.h, adc.h and adxl335.h are included for the LCD programming, ADC and accelerometer respectively.
 
#include <avr/lcd.h>
#include <avr/adc.h>
#include <avr/adxl335.h>
 
In order to make header files work, they must be copied to the following folder – C > WinAVR-20090313 > avr > include > avr and paste the downloaded header files in the folder.
 
Note that in the path WinAVR-20090313, 20090313 is a number appended to the installation folder. This number can be different in a different installation of the AVR Studio.
Screenshot of Initialization in AVR Code for Gesture Controlled Wireless Robot
 
Fig. 13: Screenshot of Initialization in AVR Code for Gesture Controlled Wireless Robot 
 
 
Next, the ports are defined which are connected to the LCD and Accelerometer.  They are initialized for the maximum and minimum values of x and y axis at the range where the robot has to be controlled.  
 
 
Screenshot of Main Function in AVR Code for Gesture Controlled Wireless Robot
 
Fig. 14: Screenshot of Main function in AVR Code for Gesture Controlled Wireless Robot 
 
 
The main function provides logic for the entire operation of the remote circuitry. In this function, the pins are declared as input or output pin for the port that are already initialized.
 
Screenshot of Infinite Loop in AVR Code for Gesture Controlled Wireless Robot
 
Fig. 15: Screenshot of infinite loop in AVR Code for Gesture Controlled Wireless Robot
 
 
The while loop inside the main() function is an infinite loop, where the sensor data is read and the conditions are implemented to make the robot run. check out the complete AVR code.

Project Source Code

###

//Program to 
#ifndef _ADC_H_

#define _ADC_H_        1





#include<avr/io.h>

#include<util/delay.h>





void adc_init(void);





// This function is declared to read the digital value of the ADC conversion    



int read_adc_channel(unsigned char channel);







/*Function definations*/

void adc_init(void)

{                    

ADCSRA=(1<<ADEN)|(1<<ADSC)|(1<<ADATE)|(1<<ADPS2);

SFIOR=0x00;

}





int read_adc_channel(unsigned char channel)

{

    int adc_value;

    unsigned char temp;

       ADMUX=(1<<REFS0)|channel;

       _delay_ms(1);

    temp=ADCL;

    adc_value=ADCH;

    adc_value=(adc_value<<8)|temp;

       return adc_value;

}  

#endif

//ICD Header File

#ifndef    _LCD_H_

#define    _LCD_H_    1

#include <avr/io.h>

#include <util/delay.h>

#include <stdlib.h>



#ifndef LCD_DATA_PORT

#warning "LCD_DATA_PORT not defined for <avr/lcd.h.Default Port is PORTA>"

#define LCD_DATA_PORT    PORTB    

#endif



#ifndef LCD_CONT_PORT    

#warning "LCD_CONT_PORT not defined for <avr/lcd.h.Default Port is PORTB>"

#define LCD_CONT_PORT PORTD

#endif



#ifndef LCD_RS

#warning "LCD_RS not defined for <avr/lcd.h.Default Pin is PD0>"

#define LCD_RS PD0

#endif



#ifndef LCD_RW

#warning "LCD_RW not defined for <avr/lcd.h.Default Pin is PD1>"

#define LCD_RW PD1

#endif



#ifndef LCD_EN

#warning "LCD_EN not defined for <avr/lcd.h.Default Pin is PD2>"

#define LCD_EN PD2

#endif



void lcd_data_write(char data);

void lcd_command_write( char command);

void lcd_init();

void lcd_string_write( char *string);

void lcd_number_write(int number,unsigned char radix);



void lcd_data_write(char data)

{

LCD_CONT_PORT=_BV(LCD_EN)|_BV(LCD_RS);

LCD_DATA_PORT=data;

_delay_ms(1);

LCD_CONT_PORT=_BV(LCD_RS);

_delay_ms(1);

}





void lcd_command_write(char command)

{

LCD_CONT_PORT=_BV(LCD_EN);

LCD_DATA_PORT=command;

_delay_ms(1);

LCD_CONT_PORT=0x00;

_delay_ms(1);

}



void lcd_init()

{

    lcd_command_write(0x38);

    lcd_command_write(0x01);

    lcd_command_write(0x06);

    lcd_command_write(0x0e);    

}



void lcd_string_write(char *string)

{

while (*string)

lcd_data_write(*string++);

}



void lcd_number_write(int number,unsigned char radix)

{

char *number_string="00000";

itoa(number,number_string,radix);

lcd_string_write(number_string);

}

#endif

###

 


Circuit Diagrams

Circuit-Diagram-Receiver-Side-AVR-Gesture-Controlled-Wireless-Robot
Circuit-Diagram-Transmitter-Side-AVR-Gesture-Controlled-Wireless-Robot

Project Video


Filed Under: Electronic Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Sendust vs Ferrite for SMPS
  • connector model question
  • value of feedback resistance in self biased inverter
  • Industrial Relay Board Design for Motorcycle Use
  • sim7090g

RSS Electro-Tech-Online.com Discussions

  • using a RTC in SF basic
  • It's Amazing What A Buck And A Quarter....
  • Microinverters and storeage batteries?
  • ac current limiting
  • More fun with ws2812 this time XC8 and CLC

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • Infineon launches 3D magnetic sensors with ±50 mT to ±160 mT measurement ranges
  • Nexperia adds 1200 V 20 A silicon carbide Schottky diodes to power portfolio
  • EPC introduces 15 ARMS per phase motor drive in 32 mm diameter form factor
  • Non-contact angle sensors deliver +0.3% linearity across full measurement range
  • TDK introduces RGF board-mount EMI filters for high-current power supply applications

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe