IOT

How to design Wireless Gesture Controlled Robot Using Accelerometer & Arduino

There are several applications for hand gesture-controlled robots. It’s similar to self-contained Robot Projects. We’re going to use hand gestures to control a robot wirelessly. This is also a simple and user-friendly method of interacting with robotic arms. The forward, backward, left, and right directional motions are controlled by an accelerometer ADX335 that can detect x-axis and y-axis tilting movements. In this blog, we will discuss how to create a Wireless Gesture Controlled Robot with an Accelerometer and Arduino. 

As the project’s brain, we’re employing an ATmega328 microcontroller. The distinct wireless signals are encoded and decoded using an encoder IC HT12E and a decoder IC HT12D. Similarly, a 433 Mhz RF Module is utilized for wireless signal transmission and reception.

Hardware Required

  • 7805 5V Voltage Regulator IC
  • ATmega328 Microcontroller
  • LM1117-33 3.3V Voltage Regulator IC
  • HT12E Encoder IC
  • HT12D Decoder IC
  • L293D Dual H-Bridge Motor Driver IC
  • 433 Mhz Transmitter/Receiver Module
  • 200 RPM Motors – 2
  • ADXL335 3 Axis Accelerometer
  • 17 cm Single Strand Wire Antenna – 2
  • 9V Battery
  • 9V Battery Connector
  • 4.5V, 1.5Ah Lead-Acid battery
  • 5 or 6 Pin Female Connector for Accelerometer
  • 2 Pins Connector for Battery – 2
  • 16 Mhz Crystal Oscillator
  • LED 5 mm – 4
  • 22pF Ceramic Capacitor – 2
  • 0.1µF Ceramic Capacitor
  • 0.33µF Ceramic Capacitor
  • 10µF, 16V Electrolytic Capacitor
  • 1M Resistor
  • 1OK Resistor
  • 680K Resistor
  • 47K Resistor
  • 220-ohm Resistor – 4
  • Robot Chasis & Wheels
  • Jumper Wires

What is Human-Machine Interaction?

Human-machine interaction is a crucial part of a successful robotic system. The only way to communicate with a robot in the early years was to program, which took a lot of time and effort. Gesture-based recognition became possible as science and robotics progressed. Gestures can come from any physical move or state, however, they are most typically made with the hands or the face. Gesture recognition is a technique for a computer to comprehend human body language. This has reduced the demand for text interfaces and graphical user interfaces (Graphical User Interface).

What are Gestures?

A Gesture is a movement made with a part of your body, most often your hands, to convey emotion or information. A gesture is a type of nonverbal communication in which a person’s visible bodily gestures can convey a message. It is possible to control activities without contacting the real equipment by detecting these movements.

Left, right, up, down, forward, backward, clockwise, anticlockwise, and waving are the movements that users can recognize in this situation. You can also add right-left, left-right, up-down, down-up, forward-backward, and backward-forward to the mix.

Block Diagram

The accelerometer in our gesture-controlled robot collects hand motions and passes the data to a comparator, which assigns suitable voltage levels to the recorded movements. The data is subsequently passed through an encoder, which prepares it for RF transmission.

Block Diagram Gesture Controlled Robot

The information is received wirelessly through RF on the receiving end, encoded, and then transmitted to the microcontroller, which makes various decisions based on the received data. The motor driver ic receives these decisions and triggers the motors in various combinations to propel the robot in a specified direction. The block diagram above can help you understand how the robot works.

Circuit Diagram & Description

The 433 MHz frequency is used by the RF modules. It signifies that the RF module’s carrier frequency is 433 MHz. The RF module allows the operator to easily and wirelessly operate the robot. The following is a diagram of the transmitting end:

The RF receiver receives the broadcast signal, demodulates it, and then passes it on to the decoder IC. The decoder IC recovers the original data bits after decoding the coded waveform. The output is parallel, while the input is a serial-coded modulated waveform. The Valid Transmission (VT) pin on the decoder IC is pin 17. This pin can be used to attach a light that will indicate the transmission status. The led will blink if the communication was successful.

The encoder’s parallel data is delivered onto the microcontroller’s port 1.  This data is in the form of bits. These bits are read by the microcontroller, which then makes decisions based on them. The microcontroller compares the input bits to the coded bits that are burned into the microcontroller’s program memory and output on the basis of these bits. The output port of the microcontroller is port 2. The motor driver IC receives the output bits from this port and operates the motors in a specific configuration based on the hand movements.

A motor produces no electricity when it comes to a complete stop. When a voltage is applied to the motor and it starts to spin, it acts as a generator, producing a voltage that opposes the external voltage. This is known as Back Electromotive Force (BEF) or Counter Electromotive Force (CEF) (Back EMF). If the motors cannot move because of a load, the current may be strong enough to burn out the motor coil windings.

PCB & Gerber Files

Below are the PCB files for both the transmitter and receiver sections.

These PCB files can be converted to the Gerber file. So once the Gerber file is ready, you can order the PCB from

https://www.aipcba.com/. AiPCBA” is a quick prototyping solution for PCBs and PCB assemblies. PCB board supply, PCB assembly, electronic component procurement, and SMT assembly are among the services offered. HDI, FPC, FPCA, and the combination of small and medium-sized batches and prototypes in soft and hard PCBs are the emphasis of AiPCBA.

All you have to do is download the Gerber file from below and upload it to this site and place the order. You will get the good quality PCB within a week at a very cheap price.

Download the Gerber file below:

1. Transmitter Section PCB Gerber File

2. Receiver Section PCB Gerber File

Making the Hardware Part

So, here are some images taken throughout the construction and assembly of the project.

Source Code/program

The code for making a Wireless Gesture Controlled Robot with an Accelerometer and Arduino may be found below. Simply copy and paste the code into the Arduino UNO. Remove the ATmega328 microcontroller from the Arduino UNO board and place it in the PCB as described above once the code has been uploaded.

const int ap1 = A0;
const int ap2 = A1;
int sv1 = 0;
int ov1 = 0;
int sv2 = 0;
int ov2= 0;
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
pinMode(10,OUTPUT);
}
void loop()
{
analogReference(EXTERNAL); //connect 3.3v to AREF
// read the analog in value:
sv1 = analogRead(ap1);
ov1 = map(sv1, 0, 1023, 0, 255);
delay(2);
sv2 = analogRead(ap2);
ov2 = map(sv2, 0, 1023, 0, 255);
delay(2);
Serial.print(“Xsensor1 = ” );
Serial.print(sv1);
Serial.print(“\t output1 = “);
Serial.println(ov1);
Serial.print(“Ysensor2 = ” );
Serial.print(sv2);
Serial.print(“\t output2 = “);
Serial.println(ov2);
if(analogRead(ap1)<514 &&analogRead (ap2)<463) // for backward movement
{
digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
}
else
{
if(analogRead(ap1)<486 &&analogRead (ap2)>508) // for left turn
{
digitalWrite(13,LOW);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,LOW);
}
else
{
if(analogRead(ap1)>512 &&analogRead (ap2)>560) // for forward
{
digitalWrite(13,LOW);
digitalWrite(12,HIGH);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
}
else
{
if(analogRead(ap1)>550 &&analogRead (ap2)>512)//for right turn
{
digitalWrite(13,HIGH);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,HIGH);
}
 
else
{
digitalWrite(13,HIGH);
digitalWrite(12,HIGH);
digitalWrite(11,HIGH);
digitalWrite(10,HIGH);
}
}
}
}
}

Working of the Project

Only the X and Y directions are recorded by the accelerometer, which generates continuous analog voltage values. These voltages are sent to the microcontroller and encoder IC, which compares them to the reference voltages set by variable resistors on the IC. The voltage levels we’ve chosen are 1.7V and 1.4V. Every voltage created by the accelerometer is compared to these, and the IC outputs an analog 1 or 0 signal.

The encoder IC receives this analog signal as input. The encoder takes a parallel input and produces a serial coded waveform appropriate for RF transmission. Pin 14 of this IC, the Transmission Enable (TE) pin, is connected to a pushbutton. Only when the button is pressed will the coded data be sent to the RF module. This button ensures that no data is delivered unless we specifically request it.

The input signal is modulated by the RF transmitter utilizing Amplitude Shift Keying (ASK) modulation. It’s a type of modulation in which digital data is represented as fluctuations in the amplitude of a carrier wave.

The modulated output of the RF module is shown in the diagram below:

Conclusion

I hope all of you had understand how to design a Wireless Gesture Controlled Robot Using Accelerometer & Arduino. We MATHA ELECTRONICS will be back soon with more informative blogs.

Leave a Reply

Your email address will not be published.